C

TableLayoutConfigurator

Creates a LayoutGrid that matches a given table configuration of an IGraph and returns a LayoutGridData<TNode, TEdge, TNodeLabel, TEdgeLabel> for that grid.
Inheritance Hierarchy

Remarks

Typically, this class is used by class LayoutExecutor to prepare a layout grid before the layout is calculated and restore the graph afterwards.

See Also

Developer's Guide

Members

No filters for this type

Constructors

Creates a new instance.

Parameters

Properties

Gets or sets whether size compaction for table nodes is enabled.

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.

final
Gets or sets whether 'from sketch' mode is 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.
final
Gets the LayoutGrid created in the prepare method.
readonlyfinal
Gets or 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.
The default value for this property is false.
final
Gets or sets the minimum distance between two different table nodes.
The default value is 50.
final

Methods

Destroy all information that results from a previous prepare and a subsequent layout.

Parameters

graph: IGraph
Returns the LayoutGridCellDescriptor assigned to the node.
The descriptor is assigned to the node in prepare and is only valid before restore is called so an InvalidOperationError is thrown when this method isn't called between those two.
final

Parameters

node: INode
The node to return the assigned cell for.

Return Value

LayoutGridCellDescriptor
The LayoutGridCellDescriptor assigned to the node.
Returns the ITable the node belongs to.

The node to table association is resolved in prepare and is only valid before restore is called so an InvalidOperationError is thrown when this method isn't called between those two.

The associated table is the ITable provided by the node itself or one of its ancestors via lookup. If no associated table can be found, null is returned.

final

Parameters

node: INode
The node to lookup the table for.

Return Value

ITable
The ITable the node is associated with or null.
Returns the LayoutGridColumn in the grid to which the leafColumn is mapped.

The columns are mapped to the grid in prepare and are only valid before restore is called so an InvalidOperationError is thrown when this method isn't called between those two.

Note that only leaf columns (columns with no childColumns) are mapped to grid columns so null is returned for any other column.

final

Parameters

leafColumn: IColumn
The column to return the column descriptor for.

Return Value

LayoutGridColumn
The LayoutGridColumn the leafColumn is mapped to.
Return the sizes of all leaf rows.
This method does not modify originalTable. You also need to call cleanUp explicitly if you don't need the TableLayoutConfigurator anymore.

Parameters

originalTable: ITable
The table
nodeLayout: Rect
The final layout of the node that owns the table

Return Value

number
The sizes of all leaf rows in originalTable, in their natural order.
Returns the LayoutGridRow of the row in the grid to which the leafRow is mapped.

The rows are mapped to the grid in prepare and are only valid before restore is called so an InvalidOperationError is thrown when this method isn't called between those two.

Note that only leaf rows (rows with no childRows) are mapped to grid rows so null is returned for any other row.

final

Parameters

leafRow: IRow
The row to return the row descriptor for.

Return Value

LayoutGridRow
The LayoutGridRow the leafRow is mapped to.
Return the sizes of all leaf rows.
This method does not modify originalTable. You also need to call cleanUp explicitly if you don't need the TableLayoutConfigurator anymore.

Parameters

originalTable: ITable
The table
nodeLayout: Rect
The final layout of the node that owns the table

Return Value

number
The sizes of all leaf rows in originalTable, in their natural order.
Returns the INode which provides the table in its lookup.
The node to table association is resolved in prepare and is only valid before restore is called so an InvalidOperationError is thrown when this method isn't called between those two.
final

Parameters

table: ITable
The table for which the corresponding owner node is searched.

Return Value

INode
The INode which provides the table in its lookup.
Returns whether node is recognized as a table node by this instance.
final

Parameters

node: INode
The node to check.

Return Value

boolean
true if this instance treats node as a table node.
Setup layout grid information from a graph that contains table structures

Parameters

graph: IGraph

Return Value

LayoutGridData<INode, IEdge, ILabel, ILabel>
A LayoutGridData<TNode, TEdge, TNodeLabel, TEdgeLabel> instance for all tables in the graph, or null if no LayoutGrid is necessary.
Write back all information from the layout grid

Parameters

graph: IGraph