public interface ITable extends ILookup
This interface supports a presentation of data where the nodes of a diagram are organized in a tabular way, i.e., where
each node is associated to a specific row and column in the grid-like structure of a table. The ITable
together
with its associated interfaces IColumn
and IRow
represents the model for the tabular presentation (or
table, for short). It also provides means for altering the model, in particular creation (createColumn(IColumn, double, double, InsetsD, IStripeStyle, Object, int)
and createRow(IRow, double, double, InsetsD, IStripeStyle, Object, int)
) and removal
of columns and rows but also changing their size or appearance.
The table structure is backed by a group node. As a consequence, the nodes which should be presented in a tabular fashion need to be set up as children of this group node. Using a group node to hold the content nodes has several advantages: For example, when the group node is moved, the child nodes move accordingly, thus maintaining the visual clue that they are contained in the table group node.
Note that the table structure and its content nodes are only loosely coupled: the node's center coordinates determine the row and column that it belongs to.
Associating an ITable
instance with its backing group node can most conveniently be done by setting a TableNodeStyle
instance as style of the associated group node. This style manages the visualization of the individual rows and columns.
It also associates its Table
with the group node by
decorating its ILookup.lookup(java.lang.Class)
to return the table instance.
User interaction is supported by the TableEditorInputMode
which provides support
for intractively resizing rows and columns, re-parenting them, or editing their labels.
The table model with all relevant types and their relationships is presented in detail in the section Tables.
IStripe
,
IColumn
,
IRow
,
Table
,
TableEditorInputMode
Modifier and Type | Method and Description |
---|---|
default ILabel |
addLabel(IStripe owner,
String text)
Add a label to the given owner using the text as the initial label text and label model parameter and style.
|
default ILabel |
addLabel(IStripe owner,
String text,
ILabelModelParameter layoutParameter)
Add a label to the given owner using the text as the initial label text and label model parameter and style.
|
default ILabel |
addLabel(IStripe owner,
String text,
ILabelModelParameter layoutParameter,
ILabelStyle style)
Add a label to the given owner using the text as the initial label text and label model parameter and style.
|
default ILabel |
addLabel(IStripe owner,
String text,
ILabelModelParameter layoutParameter,
ILabelStyle style,
SizeD preferredSize)
Add a label to the given owner using the text as the initial label text and label model parameter and style.
|
ILabel |
addLabel(IStripe owner,
String text,
ILabelModelParameter layoutParameter,
ILabelStyle style,
SizeD preferredSize,
Object tag)
Add a label to the given owner using the text as the initial label text and label model parameter and style.
|
void |
addLabelAddedListener(IEventHandler<ItemEventArgs<ILabel>> labelAddedEvent)
Adds the given listener for the
LabelAdded event that occurs when a label has been added to this graph
instance. |
void |
addLabelChangedListener(IEventHandler<ItemEventArgs<ILabel>> labelChangedEvent)
Adds the given listener for the
LabelChanged event that occurs when a label has been changed, for instance, if
its style has been replaced. |
void |
addLabelRemovedListener(IEventHandler<LabelEventArgs> labelRemovedEvent)
Adds the given listener for the
LabelRemoved event that occurs when a label has been removed from this graph
instance. |
void |
addStripeChangedListener(IEventHandler<StripeEventArgs> stripeChangedEvent)
Adds the given listener for the
StripeChanged event that occurs when a stripe has been changed, for instance, if
its style has been replaced. |
void |
addStripeCreatedListener(IEventHandler<ItemEventArgs<IStripe>> stripeCreatedEvent)
Adds the given listener for the
StripeCreated event that occurs when a stripe has been added. |
void |
addStripeRemovedListener(IEventHandler<StripeEventArgs> stripeRemovedEvent)
Adds the given listener for the
StripeRemoved event that occurs when a stripe has been removed from its parent. |
default void |
adjustLabelPreferredSize(ILabel label)
Adjusts the
PreferredSize property of a label to fit the suggested size of its
ILabelStyleRenderer . |
default SizeD |
calculateLabelPreferredSize(IStripe stripe,
ILabelStyle style,
ILabelModelParameter layoutParameter,
String text,
Object tag)
Calculates the preferred size of a label with the given properties.
|
default void |
clear()
Convenience method that clears all stripes from a table.
|
default IColumn |
createColumn()
Creates and returns a column as last child of
table . |
default IColumn |
createColumn(double width)
Creates and returns a column as last child of
table . |
default IColumn |
createColumn(double width,
double minWidth)
Creates and returns a column as last child of
table . |
default IColumn |
createColumn(double width,
double minWidth,
InsetsD insets)
Creates and returns a column as last child of
table . |
default IColumn |
createColumn(double width,
double minWidth,
InsetsD insets,
IStripeStyle style)
Creates and returns a column as last child of
table . |
default IColumn |
createColumn(double width,
double minWidth,
InsetsD insets,
IStripeStyle style,
Object tag)
Creates and returns a column as last child of
table . |
default IColumn |
createColumn(double width,
double minWidth,
InsetsD insets,
IStripeStyle style,
Object tag,
int index)
Creates and returns a column as last child of
table . |
default IColumn |
createColumn(IColumn owner)
Create a new column as the
index th child of owner with the given parameters. |
default IColumn |
createColumn(IColumn owner,
double width)
Create a new column as the
index th child of owner with the given parameters. |
default IColumn |
createColumn(IColumn owner,
double width,
double minWidth)
Create a new column as the
index th child of owner with the given parameters. |
default IColumn |
createColumn(IColumn owner,
double width,
double minWidth,
InsetsD insets)
Create a new column as the
index th child of owner with the given parameters. |
default IColumn |
createColumn(IColumn owner,
double width,
double minWidth,
InsetsD insets,
IStripeStyle style)
Create a new column as the
index th child of owner with the given parameters. |
default IColumn |
createColumn(IColumn owner,
double width,
double minWidth,
InsetsD insets,
IStripeStyle style,
Object tag)
Create a new column as the
index th child of owner with the given parameters. |
IColumn |
createColumn(IColumn owner,
double width,
double minWidth,
InsetsD insets,
IStripeStyle style,
Object tag,
int index)
Create a new column as the
index th child of owner with the given parameters. |
default void |
createGrid(int columns,
int rows)
Convenience method that creates a
columns x rows . |
default ILabelModelParameter |
createLabelLayoutParameter(IStripe stripe)
Creates the label model parameter for a given
ILabelOwner . |
default ILabelStyle |
createLabelStyle(IStripe stripe)
Convenience method that delegates to the
ILabelDefaults.getStyleInstance(com.yworks.yfiles.graph.ILabelOwner)
method for the given stripe . |
default IRow |
createRow()
Creates and returns a row as last child of
table . |
default IRow |
createRow(double height)
Creates and returns a row as last child of
table . |
default IRow |
createRow(double height,
double minHeight)
Creates and returns a row as last child of
table . |
default IRow |
createRow(double height,
double minHeight,
InsetsD insets)
Creates and returns a row as last child of
table . |
default IRow |
createRow(double height,
double minHeight,
InsetsD insets,
IStripeStyle style)
Creates and returns a row as last child of
table . |
default IRow |
createRow(double height,
double minHeight,
InsetsD insets,
IStripeStyle style,
Object tag)
Creates and returns a row as last child of
table . |
default IRow |
createRow(double height,
double minHeight,
InsetsD insets,
IStripeStyle style,
Object tag,
int index)
Creates and returns a row as last child of
table . |
default IRow |
createRow(IRow owner)
Create a new row as the
index th child of owner with the given parameters. |
default IRow |
createRow(IRow owner,
double height)
Create a new row as the
index th child of owner with the given parameters. |
default IRow |
createRow(IRow owner,
double height,
double minHeight)
Create a new row as the
index th child of owner with the given parameters. |
default IRow |
createRow(IRow owner,
double height,
double minHeight,
InsetsD insets)
Create a new row as the
index th child of owner with the given parameters. |
default IRow |
createRow(IRow owner,
double height,
double minHeight,
InsetsD insets,
IStripeStyle style)
Create a new row as the
index th child of owner with the given parameters. |
default IRow |
createRow(IRow owner,
double height,
double minHeight,
InsetsD insets,
IStripeStyle style,
Object tag)
Create a new row as the
index th child of owner with the given parameters. |
IRow |
createRow(IRow owner,
double height,
double minHeight,
InsetsD insets,
IStripeStyle style,
Object tag,
int index)
Create a new row as the
index th child of owner with the given parameters. |
default IColumn |
findColumn(INode node,
PointD location,
Predicate<IStripe> filter)
Convenience method to find a column underneath a certain point.
|
default IRow |
findRow(INode node,
PointD location,
Predicate<IStripe> filter)
Convenience method to find a row underneath a certain point.
|
static StripeSubregion |
findStripe(PointD location,
StripeTypes stripeTypes,
StripeSubregionTypes subregionTypes,
CanvasControl canvasControl,
Predicate<StripeSubregion> filter)
Convenience method to find a stripe underneath a certain point.
|
default IEnumerable<IStripe> |
findStripes(INode node,
PointD location,
StripeTypes stripeTypes,
Predicate<IStripe> filter)
Convenience method to find all stripes underneath a certain point.
|
static IEnumerable<StripeSubregion> |
findStripes(PointD location,
StripeTypes stripeTypes,
StripeSubregionTypes subregionTypes,
CanvasControl canvas,
Predicate<StripeSubregion> filter)
Used as a callback to find the items underneath a certain point.
|
default InsetsD |
getAccumulatedInsets()
Return the accumulated insets for the table.
|
default RectD |
getCellBounds(IColumn column,
IRow row)
Calculates the relative bounds of a table cell that is determined by
column and . |
static RectD |
getCellBounds(INode tableNode,
IColumn column,
IRow row)
Calculates the absolute bounds of a table cell that is determined by
column and . |
IStripeDefaults |
getColumnDefaults()
Gets the defaults for Columns.
|
InsetsD |
getInsets()
Gets the insets for this table.
|
IRectangle |
getLayout()
Gets the relative layout of the table.
|
PointD |
getRelativeLocation()
Gets the relative location of the upper left corner of the table.
|
IColumn |
getRootColumn()
Gets the virtual root of the column hierarchy.
|
IRow |
getRootRow()
Gets the virtual root of the row hierarchy.
|
IStripeDefaults |
getRowDefaults()
Gets the defaults for rows.
|
static void |
placeNodeInCell(IGraph graph,
INode node,
INode tableNode,
IColumn column,
IRow row)
Places
node in the center of the table cell determined by column and row . |
static void |
placeNodeInCell(IGraph graph,
INode node,
INode tableNode,
IColumn column,
IRow row,
boolean reparent)
Places
node in the center of the table cell determined by column and row . |
static void |
placeNodeInCell(IGraph graph,
INode node,
INode tableNode,
IColumn column,
IRow row,
boolean reparent,
boolean alwaysMove)
Places
node in the center of the table cell determined by column and row . |
void |
remove(ILabel label)
Removes the given label from its owner.
|
void |
remove(IStripe stripe)
Removes
stripe from its parent container. |
void |
removeLabelAddedListener(IEventHandler<ItemEventArgs<ILabel>> labelAddedEvent)
Removes the given listener for the
LabelAdded event that occurs when a label has been added to this graph
instance. |
void |
removeLabelChangedListener(IEventHandler<ItemEventArgs<ILabel>> labelChangedEvent)
Removes the given listener for the
LabelChanged event that occurs when a label has been changed, for instance,
if its style has been replaced. |
void |
removeLabelRemovedListener(IEventHandler<LabelEventArgs> labelRemovedEvent)
Removes the given listener for the
LabelRemoved event that occurs when a label has been removed from this graph
instance. |
default void |
removeRecursively(IStripe stripe)
|
default void |
removeRecursivelyWithResize(IStripe stripe)
Removes the given stripe and all of its descendants from table and
resizes all affected stripes so that the table size does not change if possible. |
void |
removeStripeChangedListener(IEventHandler<StripeEventArgs> stripeChangedEvent)
Removes the given listener for the
StripeChanged event that occurs when a stripe has been changed, for instance,
if its style has been replaced. |
void |
removeStripeCreatedListener(IEventHandler<ItemEventArgs<IStripe>> stripeCreatedEvent)
Removes the given listener for the
StripeCreated event that occurs when a stripe has been added. |
void |
removeStripeRemovedListener(IEventHandler<StripeEventArgs> stripeRemovedEvent)
Removes the given listener for the
StripeRemoved event that occurs when a stripe has been removed from its
parent. |
default void |
removeWithResize(IStripe stripe)
Removes stripe from table and resizes all affected stripes so that the table
size does not change if possible. |
void |
setColumnDefaults(IStripeDefaults value)
Sets the defaults for Columns.
|
void |
setInsets(InsetsD value)
Sets the insets for this table.
|
void |
setLabelLayoutParameter(ILabel label,
ILabelModelParameter layoutParameter)
Sets the label model parameter for the given label.
|
void |
setLabelPreferredSize(ILabel label,
SizeD preferredSize)
Sets the preferred size of the label.
|
void |
setLabelText(ILabel label,
String text)
Sets the label text of the given label.
|
void |
setMinimumSize(IStripe stripe,
double minimumSize)
Sets the minimum size of
stripe . |
default void |
setParent(IColumn owner,
IColumn column)
Sets
owner as new parent of column , inserting column at the given index . |
void |
setParent(IColumn owner,
IColumn column,
int index)
Sets
owner as new parent of column , inserting column at the given index . |
default void |
setParent(IRow owner,
IRow row)
Sets
owner as new parent of row , inserting row at the given index . |
void |
setParent(IRow owner,
IRow row,
int index)
Sets
owner as new parent of row , inserting row at the given index . |
void |
setRelativeLocation(PointD value)
Sets the relative location of the upper left corner of the table.
|
void |
setRowDefaults(IStripeDefaults value)
Sets the defaults for rows.
|
void |
setSize(IStripe stripe,
double size)
Sets the actual size of
stripe . |
void |
setStripeInsets(IStripe stripe,
InsetsD insets)
Sets the insets of
stripe . |
void |
setStyle(ILabel label,
ILabelStyle style)
Assigns the given style instance by reference to the label.
|
void |
setStyle(IStripe stripe,
IStripeStyle style)
Sets the style of
stripe . |
createDictionaryLookup, createDynamic, createSingle, createSingle, createWrapped, lookup, lookup, lookup, safeLookup
default ILabel addLabel(IStripe owner, String text)
owner
- the owner to add the label to.text
- the initial text of the labelsetLabelText(ILabel, String)
,
setLabelLayoutParameter(ILabel, ILabelModelParameter)
,
setStyle(ILabel, ILabelStyle)
default ILabel addLabel(IStripe owner, String text, ILabelModelParameter layoutParameter)
owner
- the owner to add the label to.text
- the initial text of the labellayoutParameter
- The label model parameter instance to use.setLabelText(ILabel, String)
,
setLabelLayoutParameter(ILabel, ILabelModelParameter)
,
setStyle(ILabel, ILabelStyle)
default ILabel addLabel(IStripe owner, String text, ILabelModelParameter layoutParameter, ILabelStyle style)
owner
- the owner to add the label to.text
- the initial text of the labellayoutParameter
- The label model parameter instance to use.style
- The style to use for the labelsetLabelText(ILabel, String)
,
setLabelLayoutParameter(ILabel, ILabelModelParameter)
,
setStyle(ILabel, ILabelStyle)
default ILabel addLabel(IStripe owner, String text, ILabelModelParameter layoutParameter, ILabelStyle style, SizeD preferredSize)
owner
- the owner to add the label to.text
- the initial text of the labellayoutParameter
- The label model parameter instance to use.style
- The style to use for the labelpreferredSize
- The initial values to use for the PreferredSize
.setLabelText(ILabel, String)
,
setLabelLayoutParameter(ILabel, ILabelModelParameter)
,
setStyle(ILabel, ILabelStyle)
ILabel addLabel(IStripe owner, String text, ILabelModelParameter layoutParameter, ILabelStyle style, SizeD preferredSize, Object tag)
owner
- the owner to add the label to.text
- the initial text of the labellayoutParameter
- The label model parameter instance to use.style
- The style to use for the labelpreferredSize
- The initial values to use for the PreferredSize
.tag
- the initial Tag
to assign.setLabelText(ILabel, String)
,
setLabelLayoutParameter(ILabel, ILabelModelParameter)
,
setStyle(ILabel, ILabelStyle)
void addLabelAddedListener(IEventHandler<ItemEventArgs<ILabel>> labelAddedEvent)
LabelAdded
event that occurs when a label has been added to this graph
instance.labelAddedEvent
- The listener to add.addLabel(IStripe, String, ILabelModelParameter, ILabelStyle, SizeD, Object)
,
removeLabelAddedListener(IEventHandler)
void addLabelChangedListener(IEventHandler<ItemEventArgs<ILabel>> labelChangedEvent)
LabelChanged
event that occurs when a label has been changed, for instance, if
its style has been replaced.labelChangedEvent
- The listener to add.setStyle(ILabel, ILabelStyle)
,
removeLabelChangedListener(IEventHandler)
void addLabelRemovedListener(IEventHandler<LabelEventArgs> labelRemovedEvent)
LabelRemoved
event that occurs when a label has been removed from this graph
instance.
This event will also be triggered, prior to the removal of the owner
of the label.
Implementations may choose to use the LabelEventArgs
to carry additional label owner information. The Owner
property will be set to the the owner of the label that owned it before the removal.
labelRemovedEvent
- The listener to add.remove(ILabel)
,
removeLabelRemovedListener(IEventHandler)
void addStripeChangedListener(IEventHandler<StripeEventArgs> stripeChangedEvent)
StripeChanged
event that occurs when a stripe has been changed, for instance, if
its style has been replaced.stripeChangedEvent
- The listener to add.setStyle(IStripe, IStripeStyle)
,
setStripeInsets(IStripe, InsetsD)
,
setSize(IStripe, double)
,
setMinimumSize(IStripe, double)
,
removeStripeChangedListener(IEventHandler)
void addStripeCreatedListener(IEventHandler<ItemEventArgs<IStripe>> stripeCreatedEvent)
StripeCreated
event that occurs when a stripe has been added.stripeCreatedEvent
- The listener to add.createRow(IRow, double, double, InsetsD, IStripeStyle, Object, int)
,
createColumn(IColumn, double, double, InsetsD, IStripeStyle, Object, int)
,
removeStripeCreatedListener(IEventHandler)
void addStripeRemovedListener(IEventHandler<StripeEventArgs> stripeRemovedEvent)
StripeRemoved
event that occurs when a stripe has been removed from its parent.stripeRemovedEvent
- The listener to add.remove(IStripe)
,
removeStripeRemovedListener(IEventHandler)
default void adjustLabelPreferredSize(ILabel label)
PreferredSize
property of a label to fit the suggested size of its
ILabelStyleRenderer
.
This implementation uses the style's
renderer for the label to determine the preferred
rendering size. This is useful after the label's content or style have been changed.
label
- The label to adjust the size for.ILabelDefaults.isAutoAdjustingPreferredSizeEnabled()
default SizeD calculateLabelPreferredSize(IStripe stripe, ILabelStyle style, ILabelModelParameter layoutParameter, String text, Object tag)
stripe
- The item that will own the label.style
- The label style.layoutParameter
- The label model parameter.text
- The text.tag
- The tag for the label.ILabelStyleRenderer
.default void clear()
All existing rows and columns are cleared from table
default IColumn createColumn()
table
.
The column will be a part of this table after the method returns. This will trigger the corresponding events.
addStripeCreatedListener(IEventHandler)
default IColumn createColumn(double width)
table
.
The column will be a part of this table after the method returns. This will trigger the corresponding events.
width
- The actual width of the column.addStripeCreatedListener(IEventHandler)
default IColumn createColumn(double width, double minWidth)
table
.
The column will be a part of this table after the method returns. This will trigger the corresponding events.
width
- The actual width of the column.minWidth
- The minimal width of the column.addStripeCreatedListener(IEventHandler)
default IColumn createColumn(double width, double minWidth, InsetsD insets)
table
.
The column will be a part of this table after the method returns. This will trigger the corresponding events.
width
- The actual width of the column.minWidth
- The minimal width of the column.insets
- The insets of the column.addStripeCreatedListener(IEventHandler)
default IColumn createColumn(double width, double minWidth, InsetsD insets, IStripeStyle style)
table
.
The column will be a part of this table after the method returns. This will trigger the corresponding events.
width
- The actual width of the column.minWidth
- The minimal width of the column.insets
- The insets of the column.style
- The style of the column.addStripeCreatedListener(IEventHandler)
default IColumn createColumn(double width, double minWidth, InsetsD insets, IStripeStyle style, Object tag)
table
.
The column will be a part of this table after the method returns. This will trigger the corresponding events.
width
- The actual width of the column.minWidth
- The minimal width of the column.insets
- The insets of the column.style
- The style of the column.tag
- The tag of the columnaddStripeCreatedListener(IEventHandler)
default IColumn createColumn(double width, double minWidth, InsetsD insets, IStripeStyle style, Object tag, int index)
table
.
The column will be a part of this table after the method returns. This will trigger the corresponding events.
width
- The actual width of the column.minWidth
- The minimal width of the column.insets
- The insets of the column.style
- The style of the column.tag
- The tag of the columnindex
- The position in the child list.addStripeCreatedListener(IEventHandler)
default IColumn createColumn(IColumn owner)
index
th child of owner
with the given parameters.owner
- The owner of the new column.default IColumn createColumn(IColumn owner, double width)
index
th child of owner
with the given parameters.owner
- The owner of the new column.width
- The actual width of the column.default IColumn createColumn(IColumn owner, double width, double minWidth)
index
th child of owner
with the given parameters.owner
- The owner of the new column.width
- The actual width of the column.minWidth
- The minimal width of the column.default IColumn createColumn(IColumn owner, double width, double minWidth, InsetsD insets)
index
th child of owner
with the given parameters.owner
- The owner of the new column.width
- The actual width of the column.minWidth
- The minimal width of the column.insets
- The insets of the column.default IColumn createColumn(IColumn owner, double width, double minWidth, InsetsD insets, IStripeStyle style)
index
th child of owner
with the given parameters.owner
- The owner of the new column.width
- The actual width of the column.minWidth
- The minimal width of the column.insets
- The insets of the column.style
- The style of the column.default IColumn createColumn(IColumn owner, double width, double minWidth, InsetsD insets, IStripeStyle style, Object tag)
index
th child of owner
with the given parameters.owner
- The owner of the new column.width
- The actual width of the column.minWidth
- The minimal width of the column.insets
- The insets of the column.style
- The style of the column.tag
- The tag of the columnIColumn createColumn(IColumn owner, double width, double minWidth, InsetsD insets, IStripeStyle style, Object tag, int index)
index
th child of owner
with the given parameters.owner
- The owner of the new column.index
- The position in the child list.width
- The actual width of the column.minWidth
- The minimal width of the column.insets
- The insets of the column.style
- The style of the column.tag
- The tag of the columndefault void createGrid(int columns, int rows)
columns
x rows
.
All existing rows and columns are cleared from table
columns
- The number of columns to test.rows
- The number of rows to test.default ILabelModelParameter createLabelLayoutParameter(IStripe stripe)
ILabelOwner
.
This implementation uses the label defaults for the table
to
obtain the parameter instance
.
stripe
- The item that is the Owner
of the label in question.ILabelDefaults.getLayoutParameterInstance(com.yworks.yfiles.graph.ILabelOwner)
default ILabelStyle createLabelStyle(IStripe stripe)
ILabelDefaults.getStyleInstance(com.yworks.yfiles.graph.ILabelOwner)
method for the given stripe
.stripe
- The item the newly created label will belong to.default IRow createRow()
table
.
The row will be a part of this table after the method returns. This will trigger the corresponding events.
addStripeCreatedListener(IEventHandler)
default IRow createRow(double height)
table
.
The row will be a part of this table after the method returns. This will trigger the corresponding events.
height
- The actual height of the row.addStripeCreatedListener(IEventHandler)
default IRow createRow(double height, double minHeight)
table
.
The row will be a part of this table after the method returns. This will trigger the corresponding events.
height
- The actual height of the row.minHeight
- The minimal height of the row.addStripeCreatedListener(IEventHandler)
default IRow createRow(double height, double minHeight, InsetsD insets)
table
.
The row will be a part of this table after the method returns. This will trigger the corresponding events.
height
- The actual height of the row.minHeight
- The minimal height of the row.insets
- The insets of the row.addStripeCreatedListener(IEventHandler)
default IRow createRow(double height, double minHeight, InsetsD insets, IStripeStyle style)
table
.
The row will be a part of this table after the method returns. This will trigger the corresponding events.
height
- The actual height of the row.minHeight
- The minimal height of the row.insets
- The insets of the row.style
- The style of the row.addStripeCreatedListener(IEventHandler)
default IRow createRow(double height, double minHeight, InsetsD insets, IStripeStyle style, Object tag)
table
.
The row will be a part of this table after the method returns. This will trigger the corresponding events.
height
- The actual height of the row.minHeight
- The minimal height of the row.insets
- The insets of the row.style
- The style of the row.tag
- The tag of the rowaddStripeCreatedListener(IEventHandler)
default IRow createRow(double height, double minHeight, InsetsD insets, IStripeStyle style, Object tag, int index)
table
.
The row will be a part of this table after the method returns. This will trigger the corresponding events.
height
- The actual height of the row.minHeight
- The minimal height of the row.insets
- The insets of the row.style
- The style of the row.tag
- The tag of the rowindex
- The position in the child list.addStripeCreatedListener(IEventHandler)
default IRow createRow(IRow owner)
index
th child of owner
with the given parameters.owner
- The owner of the new row.default IRow createRow(IRow owner, double height)
index
th child of owner
with the given parameters.owner
- The owner of the new row.height
- The actual height of the row.default IRow createRow(IRow owner, double height, double minHeight)
index
th child of owner
with the given parameters.owner
- The owner of the new row.height
- The actual height of the row.minHeight
- The minimal height of the row.default IRow createRow(IRow owner, double height, double minHeight, InsetsD insets)
index
th child of owner
with the given parameters.owner
- The owner of the new row.height
- The actual height of the row.minHeight
- The minimal height of the row.insets
- The insets of the row.default IRow createRow(IRow owner, double height, double minHeight, InsetsD insets, IStripeStyle style)
index
th child of owner
with the given parameters.owner
- The owner of the new row.height
- The actual height of the row.minHeight
- The minimal height of the row.insets
- The insets of the row.style
- The style of the row.default IRow createRow(IRow owner, double height, double minHeight, InsetsD insets, IStripeStyle style, Object tag)
index
th child of owner
with the given parameters.owner
- The owner of the new row.height
- The actual height of the row.minHeight
- The minimal height of the row.insets
- The insets of the row.style
- The style of the row.tag
- The tag of the rowIRow createRow(IRow owner, double height, double minHeight, InsetsD insets, IStripeStyle style, Object tag, int index)
index
th child of owner
with the given parameters.owner
- The owner of the new row.index
- The position in the child list.height
- The actual height of the row.minHeight
- The minimal height of the row.insets
- The insets of the row.style
- The style of the row.tag
- The tag of the rowdefault IColumn findColumn(INode node, PointD location, Predicate<IStripe> filter)
The column are tested in bottom up order.
node
- The node this table is currently bound tolocation
- The location to test.filter
- Additional predicate to further restrict the results.null
.default IRow findRow(INode node, PointD location, Predicate<IStripe> filter)
The rows are tested in bottom up order.
node
- The node this table is currently bound tolocation
- The location to test.filter
- Additional predicate to further restrict the results.null
.static StripeSubregion findStripe(PointD location, StripeTypes stripeTypes, StripeSubregionTypes subregionTypes, CanvasControl canvasControl, Predicate<StripeSubregion> filter)
location
- The location to test.stripeTypes
- An enumeration value of StripeTypes
to specify the stripe type.subregionTypes
- An enumeration value of StripeSubregionTypes
to further restrict the stripe region.canvasControl
- The canvas that provides necessary context for hit determination, such as
HitTestRadius
.filter
- Additional predicate to further restrict the hit test results.null
.default IEnumerable<IStripe> findStripes(INode node, PointD location, StripeTypes stripeTypes, Predicate<IStripe> filter)
The stripes are always returned in bottom up, rows first order. Note that this method does not take any HitTestRadius
into account.
node
- The node this table is currently bound tolocation
- The location to test.stripeTypes
- An enumeration value of StripeTypes
to specify the stripe type.filter
- Additional predicate to further restrict the hit test results.null
.static IEnumerable<StripeSubregion> findStripes(PointD location, StripeTypes stripeTypes, StripeSubregionTypes subregionTypes, CanvasControl canvas, Predicate<StripeSubregion> filter)
location
- The location to test.stripeTypes
- An enumeration value of StripeTypes
to specify the stripe type.subregionTypes
- An enumeration value of StripeSubregionTypes
to further restrict the stripe region.canvas
- The canvas that provides necessary context for hit determination, such as
HitTestRadius
.filter
- Additional predicate to further restrict the hit test results.default InsetsD getAccumulatedInsets()
default RectD getCellBounds(IColumn column, IRow row)
column
and .row
Both column
and row
must live in the provided table
instance. Otherwise, an IllegalArgumentException
is thrown.
IllegalArgumentException
- If column
and row
are part of a different table instance.column
- The column that determines the cellrow
- The row that determines the cellcolumn
and row
static RectD getCellBounds(INode tableNode, IColumn column, IRow row)
column
and .row
Both column
and row
must live in the same ITable
instance that is also present in the
tableNode
s ILookup
. Otherwise, an IllegalArgumentException
is thrown.
IllegalArgumentException
- If no table is present in the ILookup
of tableNode
, or if column
and row
are part of a
different table instance.tableNode
- The node where a table is bound to via the node's lookupcolumn
- The column that determines the cellrow
- The row that determines the cellcolumn
and row
IStripeDefaults getColumnDefaults()
The settings that are obtained from the instance influence newly created elements only. Setting different defaults later does not influence existing elements.
setColumnDefaults(IStripeDefaults)
InsetsD getInsets()
These insets are applied in addition to any implicit insets provided by the child stripes.
setInsets(InsetsD)
IRectangle getLayout()
The upper left corner of the layout always coincides with RelativeLocation
.
getRelativeLocation()
PointD getRelativeLocation()
The actual interpretation of this value depends on the context. If the table is bound to a node, this location is usually interpreted relative to the upper left corner of the node layout.
getLayout()
,
setRelativeLocation(PointD)
IColumn getRootColumn()
This column should not be queried except for the ParentColumn
and the associated
Table
setParent(IColumn, IColumn, int)
,
createColumn(IColumn, double, double, InsetsD, IStripeStyle, Object, int)
IRow getRootRow()
This row should not be queried except for the ParentRow
and the associated
Table
setParent(IRow, IRow, int)
,
createRow(IRow, double, double, InsetsD, IStripeStyle, Object, int)
IStripeDefaults getRowDefaults()
The settings that are obtained from the instance influence newly created elements only. Setting different defaults later does not influence existing elements.
setRowDefaults(IStripeDefaults)
static void placeNodeInCell(IGraph graph, INode node, INode tableNode, IColumn column, IRow row)
node
in the center of the table cell determined by column
and row
.
Both column
and row
must live in the same ITable
instance that is also present in the
tableNode
s ILookup
. Otherwise, an IllegalArgumentException
is thrown. The cell
bounds are determined by getCellBounds(INode, IColumn, IRow)
.
If reparent
is true
, the node is made a child node of tableNode
if it is no descendant of the
table node hierarchy yet. Otherwise, the grouping hierarchy is not changed.
If alwaysMove
is
true
, the node is moved even if its center is already contained in the cell, otherwise only when the node
layout center is currently outside of the cell bounds.
This method does not change the size of the target stripes if they would be too small to contain the whole node layout. Callers must increase the stripe size before or after calling this method, if necessary.
IllegalArgumentException
- If no table is present in the ILookup
of tableNode
, or if column
and row
are part of a
different table instance.graph
- The graph instance where the move should be performednode
- The node that should be moved into the given cell.tableNode
- The node where a table is bound to via the node's lookupcolumn
- The column that determines the cellrow
- The row that determines the cellstatic void placeNodeInCell(IGraph graph, INode node, INode tableNode, IColumn column, IRow row, boolean reparent)
node
in the center of the table cell determined by column
and row
.
Both column
and row
must live in the same ITable
instance that is also present in the
tableNode
s ILookup
. Otherwise, an IllegalArgumentException
is thrown. The cell
bounds are determined by getCellBounds(INode, IColumn, IRow)
.
If reparent
is true
, the node is made a child node of tableNode
if it is no descendant of the
table node hierarchy yet. Otherwise, the grouping hierarchy is not changed.
If alwaysMove
is
true
, the node is moved even if its center is already contained in the cell, otherwise only when the node
layout center is currently outside of the cell bounds.
This method does not change the size of the target stripes if they would be too small to contain the whole node layout. Callers must increase the stripe size before or after calling this method, if necessary.
IllegalArgumentException
- If no table is present in the ILookup
of tableNode
, or if column
and row
are part of a
different table instance.graph
- The graph instance where the move should be performednode
- The node that should be moved into the given cell.tableNode
- The node where a table is bound to via the node's lookupcolumn
- The column that determines the cellrow
- The row that determines the cellreparent
- Whether node
should also be made part of
tableNode
's grouping hierarchy if it is not yet contained in it.static void placeNodeInCell(IGraph graph, INode node, INode tableNode, IColumn column, IRow row, boolean reparent, boolean alwaysMove)
node
in the center of the table cell determined by column
and row
.
Both column
and row
must live in the same ITable
instance that is also present in the
tableNode
s ILookup
. Otherwise, an IllegalArgumentException
is thrown. The cell
bounds are determined by getCellBounds(INode, IColumn, IRow)
.
If reparent
is true
, the node is made a child node of tableNode
if it is no descendant of the
table node hierarchy yet. Otherwise, the grouping hierarchy is not changed.
If alwaysMove
is
true
, the node is moved even if its center is already contained in the cell, otherwise only when the node
layout center is currently outside of the cell bounds.
This method does not change the size of the target stripes if they would be too small to contain the whole node layout. Callers must increase the stripe size before or after calling this method, if necessary.
IllegalArgumentException
- If no table is present in the ILookup
of tableNode
, or if column
and row
are part of a
different table instance.graph
- The graph instance where the move should be performednode
- The node that should be moved into the given cell.tableNode
- The node where a table is bound to via the node's lookupcolumn
- The column that determines the cellrow
- The row that determines the cellreparent
- Whether node
should also be made part of
tableNode
's grouping hierarchy if it is not yet contained in it.alwaysMove
- Whether node
should be moved even if it is already placed in the cell.void remove(ILabel label)
This will trigger the corresponding event.
label
- the label to removevoid remove(IStripe stripe)
stripe
from its parent container.
This method reparents all children of stripe
to the parent of the stripe.
stripe
- The stripe to removevoid removeLabelAddedListener(IEventHandler<ItemEventArgs<ILabel>> labelAddedEvent)
LabelAdded
event that occurs when a label has been added to this graph
instance.labelAddedEvent
- The listener to remove.addLabel(IStripe, String, ILabelModelParameter, ILabelStyle, SizeD, Object)
,
addLabelAddedListener(IEventHandler)
void removeLabelChangedListener(IEventHandler<ItemEventArgs<ILabel>> labelChangedEvent)
LabelChanged
event that occurs when a label has been changed, for instance,
if its style has been replaced.labelChangedEvent
- The listener to remove.setStyle(ILabel, ILabelStyle)
,
addLabelChangedListener(IEventHandler)
void removeLabelRemovedListener(IEventHandler<LabelEventArgs> labelRemovedEvent)
LabelRemoved
event that occurs when a label has been removed from this graph
instance.
This event will also be triggered, prior to the removal of the owner
of the label.
Implementations may choose to use the LabelEventArgs
to carry additional label owner information. The Owner
property will be set to the the owner of the label that owned it before the removal.
labelRemovedEvent
- The listener to remove.remove(ILabel)
,
addLabelRemovedListener(IEventHandler)
default void removeRecursively(IStripe stripe)
Removes
stripe
and all of its descendants from table
.
This method does not resize any stripes, use removeRecursivelyWithResize(IStripe)
instead.
stripe
- The stripe to removedefault void removeRecursivelyWithResize(IStripe stripe)
Removes
the given stripe
and all of its descendants from table
and
resizes all affected stripes so that the table size does not change if possible.stripe
- The stripe to removevoid removeStripeChangedListener(IEventHandler<StripeEventArgs> stripeChangedEvent)
StripeChanged
event that occurs when a stripe has been changed, for instance,
if its style has been replaced.stripeChangedEvent
- The listener to remove.setStyle(IStripe, IStripeStyle)
,
setStripeInsets(IStripe, InsetsD)
,
setSize(IStripe, double)
,
setMinimumSize(IStripe, double)
,
addStripeChangedListener(IEventHandler)
void removeStripeCreatedListener(IEventHandler<ItemEventArgs<IStripe>> stripeCreatedEvent)
StripeCreated
event that occurs when a stripe has been added.stripeCreatedEvent
- The listener to remove.createRow(IRow, double, double, InsetsD, IStripeStyle, Object, int)
,
createColumn(IColumn, double, double, InsetsD, IStripeStyle, Object, int)
,
addStripeCreatedListener(IEventHandler)
void removeStripeRemovedListener(IEventHandler<StripeEventArgs> stripeRemovedEvent)
StripeRemoved
event that occurs when a stripe has been removed from its
parent.stripeRemovedEvent
- The listener to remove.remove(IStripe)
,
addStripeRemovedListener(IEventHandler)
default void removeWithResize(IStripe stripe)
Removes
stripe
from table
and resizes all affected stripes so that the table
size does not change if possible.stripe
- The stripe to removevoid setColumnDefaults(IStripeDefaults value)
The settings that are obtained from the instance influence newly created elements only. Setting different defaults later does not influence existing elements.
value
- The ColumnDefaults to set.getColumnDefaults()
void setInsets(InsetsD value)
These insets are applied in addition to any implicit insets provided by the child stripes.
value
- The Insets to set.getInsets()
void setLabelLayoutParameter(ILabel label, ILabelModelParameter layoutParameter)
IllegalArgumentException
- If the parameter cannot be used for this label.label
- The label.layoutParameter
- The new parameter.void setLabelPreferredSize(ILabel label, SizeD preferredSize)
label
- The label.preferredSize
- The new preferred size.ILabel.getPreferredSize()
void setLabelText(ILabel label, String text)
label
- the label to modifytext
- the new text of the labelILabel.getText()
void setMinimumSize(IStripe stripe, double minimumSize)
stripe
.
This method sets the MinimumSize
of stripe
.
stripe
- The stripe to changeminimumSize
- The new minimum size of the stripedefault void setParent(IColumn owner, IColumn column)
owner
as new parent of column
, inserting column
at the given index
.
The column will be inserted at position index
in the child list of the new parent.
void setParent(IColumn owner, IColumn column, int index)
owner
as new parent of column
, inserting column
at the given index
.
The column will be inserted at position index
in the child list of the new parent.
default void setParent(IRow owner, IRow row)
owner
as new parent of row
, inserting row
at the given index
.
The row will be inserted at position index
in the child list of the new parent.
void setParent(IRow owner, IRow row, int index)
owner
as new parent of row
, inserting row
at the given index
.
The row will be inserted at position index
in the child list of the new parent.
void setRelativeLocation(PointD value)
The actual interpretation of this value depends on the context. If the table is bound to a node, this location is usually interpreted relative to the upper left corner of the node layout.
value
- The RelativeLocation to set.getLayout()
,
getRelativeLocation()
void setRowDefaults(IStripeDefaults value)
The settings that are obtained from the instance influence newly created elements only. Setting different defaults later does not influence existing elements.
value
- The RowDefaults to set.getRowDefaults()
void setSize(IStripe stripe, double size)
stripe
.
This method sets the Size
of stripe
.
stripe
- The stripe to changesize
- The new size of the stripevoid setStripeInsets(IStripe stripe, InsetsD insets)
stripe
.stripe
- The stripe to changeinsets
- The new insets of the stripevoid setStyle(ILabel label, ILabelStyle style)
Style instances can be shared.
label
- The label that will be assigned the new stylestyle
- The style instance that will be assigned to the label.ILabel.getStyle()
void setStyle(IStripe stripe, IStripeStyle style)
stripe
.stripe
- The stripe to changestyle
- The new style of the stripe