|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.yworks.yfiles.server.graphml.flexio.TableLayoutConfigurator
Support class that correctly configures a PartitionGrid
information
from a given table configuration.
To set up a PartitionGrid
a
TableLayoutConfigurator
has to prepare the graph
before the layout and restore it afterwards:
// graph is of type StyledLayoutGraph IncrementalHierarchicLayouter ihl = new IncrementalHierarchicLayouter(); TableLayoutConfigurator tlc = new TableLayoutConfigurator(); tlc.prepareAll(graph); graph.doLayout(ihl); tlc.restoreAll(graph);
Constructor Summary | |
TableLayoutConfigurator()
|
Method Summary | |
void |
cleanUp(Graph graph)
Destroy all information that results from a previous prepareAll(y.layout.LayoutGraph)
and a subsequent layout. |
double[] |
getColumnLayout(Table originalTable,
NodeLayout nodeLayout)
Return the sizes of all leaf columns. |
double |
getMinimalTableDistance()
Gets the minimal distance between two different table nodes. |
double[] |
getRowLayout(Table originalTable,
NodeLayout nodeLayout)
Return the sizes of all leaf rows. |
boolean |
isCompactionEnabled()
Specifies whether or not to enable size compaction for table nodes. |
boolean |
isFromSketch()
Specifies whether or not from sketch mode should be enabled. |
boolean |
isHorizontalLayout()
Gets whether the configurator will prepare its associated graph for a vertical (that is top-to-bottom or bottom-to-top) layout calculation or a horizontal (that is left-to-right or right-to-left) one. |
void |
prepareAll(LayoutGraph graph)
Setup partition grid information from a graph that contains table structures. |
void |
restoreAll(Graph graph)
Write back all information from the partition grid. |
void |
setCompactionEnabled(boolean compactionEnabled)
Specifies whether or not to enable size compaction for table nodes. |
void |
setFromSketch(boolean fromSketch)
Specifies whether or not from sketch mode should be enabled. |
void |
setHorizontalLayout(boolean horizontalLayout)
Sets whether the configurator will prepare its associated graph for a vertical (that is top-to-bottom or bottom-to-top) layout calculation or a horizontal (that is left-to-right or right-to-left) one. |
void |
setMinimalTableDistance(double distance)
Sets the minimal distance between two different table nodes |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TableLayoutConfigurator()
Method Detail |
public double getMinimalTableDistance()
public void setMinimalTableDistance(double distance)
distance
- The minimal distance between two different table nodespublic boolean isCompactionEnabled()
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
.
public void setCompactionEnabled(boolean compactionEnabled)
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
.
compactionEnabled
- Whether or not to enable size compaction for table nodes.public boolean isHorizontalLayout()
The default value for this property is false
.
public void setHorizontalLayout(boolean horizontalLayout)
The default value for this property is false
.
horizontalLayout
- Whether the configurator will prepare its associated
graph for a horizontal layout.public boolean isFromSketch()
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.
public void setFromSketch(boolean fromSketch)
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.
fromSketch
- Whether or not from sketch mode should be enabled.public void prepareAll(LayoutGraph graph)
If a DataProvider
is registered with the key
GraphRoundtripSupportBase.TABLE_DPKEY
the tables
are retrieved from this provider. Otherwise, a custom provider is created which retrieves
the tables from TableNodeStyle
or DynamicTableNodeStyle
instances.
graph
- public void restoreAll(Graph graph)
Note that it is not safe to call this method without a previous
prepareAll(y.layout.LayoutGraph)
. This method calls
cleanUp(y.base.Graph)
implicitly.
graph
- The graph to restore.public void cleanUp(Graph graph)
prepareAll(y.layout.LayoutGraph)
and a subsequent layout.
graph
- The graph to clean up.public double[] getColumnLayout(Table originalTable, NodeLayout nodeLayout)
This method does not modify the table. You also need to call cleanUp(y.base.Graph)
explicitly if you don't need the TableLayoutConfigurator
anymore.
originalTable
- The table.nodeLayout
- The final layout of the node that owns the table.
public double[] getRowLayout(Table originalTable, NodeLayout nodeLayout)
This method does not modify the table. You also need to call cleanUp(y.base.Graph)
explicitly if you don't need the TableLayoutConfigurator
anymore.
originalTable
- The table.nodeLayout
- The final layout of the node that owns the table.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |