public class TableLayoutConfigurator extends Object
PartitionGrid
that matches a given table configuration of an IGraph
and registers IMapper
for that grid at the graph.
Typically, this class is used as part of the convenience class LayoutExecutor
to prepare(IGraph)
a
partition grid before the layout is calculated and restore(IGraph)
the graph afterwards.
Constructor and Description |
---|
TableLayoutConfigurator() |
Modifier and Type | Method and Description |
---|---|
void |
cleanUp(IGraph graph)
Destroy all information that results from a previous
prepare(IGraph) and a subsequent layout. |
double[] |
getColumnLayout(ITable originalTable,
RectD nodeLayout)
Return the sizes of all leaf rows.
|
double |
getMinimumTableDistance()
Gets the minimum distance between two different table nodes.
|
double[] |
getRowLayout(ITable originalTable,
RectD nodeLayout)
Return the sizes of all leaf rows.
|
boolean |
isCompaction()
Specifies whether or not to enable size compaction for table nodes.
|
boolean |
isFromSketchEnabled()
Specifies whether or not from sketch mode should be enabled.
|
boolean |
isHorizontalLayoutEnabled()
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 |
prepare(IGraph graph)
Setup partition grid information from a graph that contains table structures.
|
void |
restore(IGraph graph)
Write back all information from the partition grid.
|
void |
setCompaction(boolean value)
Specifies whether or not to enable size compaction for table nodes.
|
void |
setFromSketchEnabled(boolean value)
Specifies whether or not from sketch mode should be enabled.
|
void |
setHorizontalLayoutEnabled(boolean value)
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 |
setMinimumTableDistance(double value)
Sets the minimum distance between two different table nodes.
|
public void cleanUp(IGraph graph)
prepare(IGraph)
and a subsequent layout.public double[] getColumnLayout(ITable originalTable, RectD nodeLayout)
This method does not modify originalTable
. You also need to call cleanUp(IGraph)
explicitly if you
don't need the TableLayoutConfigurator
anymore.
originalTable
- The tablenodeLayout
- The final layout of the node that owns the tableoriginalTable
, in their natural order.public final double getMinimumTableDistance()
setMinimumTableDistance(double)
public double[] getRowLayout(ITable originalTable, RectD nodeLayout)
This method does not modify originalTable
. You also need to call cleanUp(IGraph)
explicitly if you
don't need the TableLayoutConfigurator
anymore.
originalTable
- The tablenodeLayout
- The final layout of the node that owns the tableoriginalTable
, in their natural order.public final boolean isCompaction()
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
.
setCompaction(boolean)
public final boolean isFromSketchEnabled()
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.
setFromSketchEnabled(boolean)
public final boolean isHorizontalLayoutEnabled()
The default value for this property is false
.
setHorizontalLayoutEnabled(boolean)
public void prepare(IGraph graph)
public void restore(IGraph graph)
public final void setCompaction(boolean value)
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
.
value
- The Compaction to set.isCompaction()
public final void setFromSketchEnabled(boolean value)
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.
value
- The FromSketchEnabled to set.isFromSketchEnabled()
public final void setHorizontalLayoutEnabled(boolean value)
The default value for this property is false
.
value
- The HorizontalLayoutEnabled to set.isHorizontalLayoutEnabled()
public final void setMinimumTableDistance(double value)
value
- The MinimumTableDistance to set.getMinimumTableDistance()