Search this API

y.view.tabular
Class TableLayoutConfigurator

java.lang.Object
  extended by y.view.tabular.TableLayoutConfigurator

public class TableLayoutConfigurator
extends java.lang.Object

Convenience class that prepares tabular information provided by TableGroupNodeRealizer for assignment of layout information calculated by IncrementalHierarchicLayouter.

Note: The configurator's horizontalLayoutConfiguration property has to match IncrementalHierarchicLayouter's layout orientation. I.e. for layout orientation LayoutOrientation.TOP_TO_BOTTOM or LayoutOrientation.BOTTOM_TO_TOP horizontalLayoutConfiguration must be false and for LayoutOrientation.LEFT_TO_RIGHT or LayoutOrientation.RIGHT_TO_LEFT horizontalLayoutConfiguration must be true.

See Also:
CanonicMultiStageLayouter.getLayoutOrientation(), CanonicMultiStageLayouter.setLayoutOrientation(byte), isHorizontalLayoutConfiguration(), setHorizontalLayoutConfiguration(boolean)
 

Constructor Summary
TableLayoutConfigurator()
           
 
Method Summary
protected  Node getAnchorNode(Graph2D graph, HierarchyManager hm)
          Determines the anchor node for the given graph in the given graph hierarchy.
 double getTableToTableDistance()
          Returns the minimum distance between two consecutive table group nodes.
 boolean isCompactionEnabled()
          Returns true if size compaction for table nodes is enabled and false otherwise.
 boolean isFromSketchModeEnabled()
          Returns whether from sketch mode is enabled.
 boolean isHorizontalLayoutConfiguration()
          Returns true, if the configurator will prepare its associated graph for a vertical (that is top-to-bottom or bottom-to-top) layout calculation and false if the configurator will prepare its associated graph for a horizontal (that is left-to-right or right-to-left) layout calculation.
 void prepareAll(Graph2D graph)
          Performs all necessary layout preparations for the specified graph.
 void prepareAutoResizeTables(Graph2D graph)
          Configures the resize behavior of table contents of TableGroupNodeRealizer instances for automated layout calculation.
 void prepareTables(Graph2D graph)
          Prepares the tabular information provided by TableGroupNodeRealizer instances for automated layout calculation.
 void restoreAll(Graph2D graph)
          Performs all necessary resource cleanup and data translation after a layout calculation.
 void restoreAutoResizeTables(Graph2D graph)
          Performs resource cleanup and resets the resize behavior of table contents of TableGroupNodeRealizer instances after a layout calculation.
 void restoreTables(Graph2D graph)
          Performs resource cleanup and data translation for tabular information provided by TableGroupNodeRealizer instances.
 void setCompactionEnabled(boolean enabled)
          Specifies whether or not to enable size compaction for table nodes.
 void setFromSketchModeEnabled(boolean fromSketchModeEnabled)
          Specifies whether or not from sketch mode should be enabled.
 void setHorizontalLayoutConfiguration(boolean horizontal)
          Specifies whether the configurator should prepare a vertical (that is top-to-bottom or bottom-to-top) or a horizontal (that is left-to-right or right-to-left) layout calculation.
 void setTableToTableDistance(double tableToTableDistance)
          Specifies the minimum distance between two consecutive table group nodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableLayoutConfigurator

public TableLayoutConfigurator()
Method Detail

isFromSketchModeEnabled

public boolean isFromSketchModeEnabled()
Returns whether from sketch mode is enabled.

Returns:
true if from sketch mode is enabled.

setFromSketchModeEnabled

public void setFromSketchModeEnabled(boolean fromSketchModeEnabled)
Specifies whether or not from sketch mode should be enabled. If enabled, the positions of the table group nodes are considered, i.e., for horizontal layout configuration these nodes are sorted according to their y-coordinate and for vertical layout configuration according to their x-coordinate.

Parameters:
fromSketchModeEnabled - whether or not from sketch mode should be enabled.
See Also:
setHorizontalLayoutConfiguration(boolean)

getTableToTableDistance

public double getTableToTableDistance()
Returns the minimum distance between two consecutive table group nodes. The default minimum distance is 30.

Returns:
the minimum distance between two consecutive table group nodes.
See Also:
setTableToTableDistance(double)

setTableToTableDistance

public void setTableToTableDistance(double tableToTableDistance)
Specifies the minimum distance between two consecutive table group nodes. The default minimum distance is 30.

Parameters:
tableToTableDistance - the minimum distance between two consecutive table group nodes.
See Also:
getTableToTableDistance()

isHorizontalLayoutConfiguration

public boolean isHorizontalLayoutConfiguration()
Returns true, if the configurator will prepare its associated graph for a vertical (that is top-to-bottom or bottom-to-top) layout calculation and false if the configurator will prepare its associated graph for a horizontal (that is left-to-right or right-to-left) layout calculation. The default value for this property is true.

Returns:
true if the configurator will prepare its associated graph for a vertical layout calculation and false if the configurator will prepare its associated graph for a horizontal layout calculation.
See Also:
setHorizontalLayoutConfiguration(boolean), LayoutOrientation.TOP_TO_BOTTOM, LayoutOrientation.BOTTOM_TO_TOP, LayoutOrientation.LEFT_TO_RIGHT, LayoutOrientation.RIGHT_TO_LEFT, CanonicMultiStageLayouter.setLayoutOrientation(byte)

setHorizontalLayoutConfiguration

public void setHorizontalLayoutConfiguration(boolean horizontal)
Specifies whether the configurator should prepare a vertical (that is top-to-bottom or bottom-to-top) or a horizontal (that is left-to-right or right-to-left) layout calculation. The default value for this property is true.

Note: If horizontalLayoutConfiguration is false, IncrementalHierarchicLayouter's layoutOrientation has to be LayoutOrientation.TOP_TO_BOTTOM or LayoutOrientation.BOTTOM_TO_TOP and if horizontalLayoutConfiguration is true, IncrementalHierarchicLayouter's layoutOrientation has to be LayoutOrientation.LEFT_TO_RIGHT or LayoutOrientation.RIGHT_TO_LEFT.

Parameters:
horizontal - if false, the configurator will prepare its associated graph for a vertical layout calculation; otherwise the configurator will prepare its associated graph for a horizontal layout calculation.
See Also:
isHorizontalLayoutConfiguration(), LayoutOrientation.TOP_TO_BOTTOM, LayoutOrientation.BOTTOM_TO_TOP, LayoutOrientation.LEFT_TO_RIGHT, LayoutOrientation.RIGHT_TO_LEFT, CanonicMultiStageLayouter.setLayoutOrientation(byte)

isCompactionEnabled

public boolean isCompactionEnabled()
Returns true if size compaction for table nodes is enabled and false otherwise. If size compaction is enabled, the size of a column or row (or a table node for that matter) may be reduced due to layout calculation, but never below the column's or row's minimum size. If size compaction is disabled, columns and rows (and therefore table nodes) may only grow due to layout calculation. The default value for this property is true.

Returns:
true if size compaction for table nodes is enabled and false otherwise.
See Also:
setCompactionEnabled(boolean)

setCompactionEnabled

public void setCompactionEnabled(boolean enabled)
Specifies whether or not to enable size compaction for table nodes. If size compaction is enabled, the size of a column or row (or a table node for that matter) may be reduced due to layout calculation, but never below the column's or row's minimum size. If size compaction is disabled, columns and rows (and therefore table nodes) may only grow due to layout calculation. The default value for this property is true.

Parameters:
enabled - if true, size compaction is enabled; otherwise size compaction is disabled.
See Also:
isCompactionEnabled()

prepareAll

public void prepareAll(Graph2D graph)
Performs all necessary layout preparations for the specified graph. Invokes
prepareAutoResizeTables(graph); prepareTables(graph);

Parameters:
graph - the Graph2D instance that is prepared for automated layout calculation.

prepareAutoResizeTables

public void prepareAutoResizeTables(Graph2D graph)
Configures the resize behavior of table contents of TableGroupNodeRealizer instances for automated layout calculation.

Parameters:
graph - the Graph2D instance that is prepared for automated layout calculation.

getAnchorNode

protected Node getAnchorNode(Graph2D graph,
                             HierarchyManager hm)
Determines the anchor node for the given graph in the given graph hierarchy. Only direct children of the anchor node are taken into account when preparing table nodes for layout calculation.

The default implementation returns null.

Parameters:
graph - the Graph2D instance that is prepared for automated layout calculation.
hm - the HierarchyManager instance representing the graph hierarchy to which the current graph belongs.
Returns:
null by default.
See Also:
HierarchyManager.getAnchorNode(y.base.Graph), HierarchyManager.getChildren(Node)

prepareTables

public void prepareTables(Graph2D graph)
Prepares the tabular information provided by TableGroupNodeRealizer instances for automated layout calculation.

Parameters:
graph - the Graph2D instance that is prepared for automated layout calculation.

restoreAll

public void restoreAll(Graph2D graph)
Performs all necessary resource cleanup and data translation after a layout calculation. Invokes
restoreTables(graph); restoreGroups(graph);

Parameters:
graph - the Graph2D instance that was previously prepared for automated layout calculation.

restoreAutoResizeTables

public void restoreAutoResizeTables(Graph2D graph)
Performs resource cleanup and resets the resize behavior of table contents of TableGroupNodeRealizer instances after a layout calculation.

Parameters:
graph - the Graph2D instance that was previously prepared for automated layout calculation.

restoreTables

public void restoreTables(Graph2D graph)
Performs resource cleanup and data translation for tabular information provided by TableGroupNodeRealizer instances.

Parameters:
graph - the Graph2D instance that was previously prepared for automated layout calculation.

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.