|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.view.tabular.TableSupport
public class TableSupport
This class is meant to ease working with the table structure of a TableGroupNodeRealizer
.
If offers methods to add rows and column, modify their position in the row or column hierarchy and change their size.
In contrast to the according methods of TableGroupNodeRealizer
these implementations do also
update the sizes of the row's or column's ancestor containers and move content nodes and bends of the table so that
they keep their position relative to the rows and columns they are associated with.
moveSingleBends
Constructor Summary | |
---|---|
TableSupport()
Creates a new instance of this class. |
Method Summary | |
---|---|
TableGroupNodeRealizer.Column |
addColumn(TableGroupNodeRealizer.ColumnContainer container,
int position)
Adds a new column to the container at the specified position and updates the sizes of
it's new ancestors accordingly. |
TableGroupNodeRealizer.Row |
addRow(TableGroupNodeRealizer.RowContainer container,
int position)
Adds a new row to the container at the specified position and updates the sizes of
it's new ancestors accordingly. |
void |
collectBends(Graph2D graph,
java.awt.geom.Rectangle2D bounds,
java.util.Collection contentBends)
Collects all bends of edges of the specified graph whose coordinates lie inside the specified
bounds and stores them in the contentBends container. |
void |
collectContents(Node node,
java.awt.geom.Rectangle2D bounds,
java.util.Collection contentNodes)
Collects the child nodes of the specified group node whose coordinates lie inside the specified bounds and stores them in the contentNodes container. |
boolean |
isMoveSingleBends()
Determines which bends are moved when a column or row changes its location. |
void |
moveContents(Graph2D graph,
NodeList nodes,
BendList bends,
double dx,
double dy)
All nodes and bends in the specified lists are moved by the given distances. |
boolean |
setHeight(TableGroupNodeRealizer.Row row,
double newHeight,
boolean moveContentOfChangedRow)
Sets the newSize for the row and updates the sizes of it's new ancestors accordingly. |
void |
setIndex(TableGroupNodeRealizer.Column column,
int index)
Sets the position of the column in it's parent container to the new index . |
void |
setIndex(TableGroupNodeRealizer.Row row,
int index)
Sets the position of the row in it's parent container to the new index . |
void |
setMoveSingleBends(boolean moveSingleBends)
Specifies which bends are moved when a column or row changes its location. |
void |
setParent(TableGroupNodeRealizer.Column column,
TableGroupNodeRealizer.ColumnContainer container)
The container is set as the parent of the column and the sizes of it's old and new
ancestors is updated accordingly. |
void |
setParent(TableGroupNodeRealizer.Row row,
TableGroupNodeRealizer.RowContainer container)
The container is set as the parent of the row and the sizes of it's old and new
ancestors is updated accordingly. |
boolean |
setWidth(TableGroupNodeRealizer.Column column,
double newWidth,
boolean moveContentOfChangedColumn)
Sets the newSize for the specified column and updates the sizes of it's new ancestors
accordingly. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TableSupport()
Method Detail |
---|
public void moveContents(Graph2D graph, NodeList nodes, BendList bends, double dx, double dy)
graph
- The graph the nodes and bends belong to.nodes
- A list of nodes that shall be moved.bends
- A list of bends that shall be moved.dx
- The horizontal value that shall be added to the nodes' and bends' position.dy
- The vertical value that shall be added to the nodes' and bends' position.public void collectContents(Node node, java.awt.geom.Rectangle2D bounds, java.util.Collection contentNodes)
Collects the child nodes of the specified group node whose coordinates lie inside the specified bounds and
stores them in the contentNodes
container.
node
- The parent group nodes whose child nodes should be collected.bounds
- The bounds content nodes have to lie in to be collected.contentNodes
- The container to which the collected nodes are added.public void collectBends(Graph2D graph, java.awt.geom.Rectangle2D bounds, java.util.Collection contentBends)
graph
whose coordinates lie inside the specified
bounds
and stores them in the contentBends
container.
graph
- The graph to collect the bends from.bounds
- The bounds bends have to lie in to be collected.contentBends
- The container to which the collected bends are added.public void setParent(TableGroupNodeRealizer.Column column, TableGroupNodeRealizer.ColumnContainer container)
The container
is set as the parent of the column
and the sizes of it's old and new
ancestors is updated accordingly.
All child nodes of the TableGroupNodeRealizer
are moved accordingly so that each child node's
position stays the same relative to it's containing column.
All bends that are chosen with respect to the setting of moveSingleBends
are also moved accordingly.
column
- The column to reparent.container
- The new parent container of the column.moveSingleBends
public void setParent(TableGroupNodeRealizer.Row row, TableGroupNodeRealizer.RowContainer container)
The container
is set as the parent of the row
and the sizes of it's old and new
ancestors is updated accordingly.
All child nodes of the TableGroupNodeRealizer
are moved accordingly so that each child node's
position stays the same relative to it's containing row.
All bends that are chosen with respect to the setting of moveSingleBends
are also moved accordingly.
row
- The row to reparent.container
- The new parent container of the row.moveSingleBends
public void setIndex(TableGroupNodeRealizer.Column column, int index)
Sets the position of the column
in it's parent container to the new index
.
All child nodes of the TableGroupNodeRealizer
are moved accordingly so that each child node's
position stays the same relative to it's containing column.
All bends that are chosen with respect to the setting of moveSingleBends
are also moved accordingly.
column
- The column to reposition.index
- The new position of the column in it's parent container.public void setIndex(TableGroupNodeRealizer.Row row, int index)
Sets the position of the row
in it's parent container to the new index
.
All child nodes of the TableGroupNodeRealizer
are moved accordingly so that each child node's
position stays the same relative to it's containing row.
All bends that are chosen with respect to the setting of moveSingleBends
are also moved accordingly.
row
- The row to reposition.index
- The new position of the row in it's parent container.public TableGroupNodeRealizer.Column addColumn(TableGroupNodeRealizer.ColumnContainer container, int position)
Adds a new column to the container
at the specified position
and updates the sizes of
it's new ancestors accordingly.
All child nodes of the TableGroupNodeRealizer
are moved accordingly so that each child node's
position stays the same relative to it's containing column.
All bends that are chosen with respect to the setting of moveSingleBends
are also moved accordingly.
container
- The parent container to add a column to.position
- The position of the new column.isMoveSingleBends()
,
setMoveSingleBends(boolean)
public TableGroupNodeRealizer.Row addRow(TableGroupNodeRealizer.RowContainer container, int position)
Adds a new row to the container
at the specified position
and updates the sizes of
it's new ancestors accordingly.
All child nodes of the TableGroupNodeRealizer
are moved accordingly so that each child node's
position stays the same relative to it's containing row.
All bends that are chosen with respect to the setting of moveSingleBends
are also moved accordingly.
container
- The parent container to add a row to.position
- The position of the new row.moveSingleBends
public boolean setHeight(TableGroupNodeRealizer.Row row, double newHeight, boolean moveContentOfChangedRow)
Sets the newSize
for the row
and updates the sizes of it's new ancestors accordingly.
All child nodes of other rows are moved accordingly so that each child node's position stays the same relative
to it's containing row.
If content nodes associated with the specified row
shall be moved as well can be designated by
moveContentOfChangedRow
. If true
it's content nodes are moved to keep their position
relative to the bottom border of the row
, otherwise they won't be moved so they stay put relative to
the top border of the row
.
All bends that are chosen with respect to the setting of moveSingleBends
are also moved accordingly.
row
- The row to resize.newHeight
- The new height of the row.moveContentOfChangedRow
- If content nodes of the passed row shall be moved as well.isMoveSingleBends()
,
setMoveSingleBends(boolean)
public boolean setWidth(TableGroupNodeRealizer.Column column, double newWidth, boolean moveContentOfChangedColumn)
Sets the newSize
for the specified column
and updates the sizes of it's new ancestors
accordingly.
All child nodes of other columns are moved accordingly so that each child node's position stays the same relative
to it's containing column.
If content nodes associated with the column
shall be moved as well can be designated by
moveContentOfChangedColumn
. If true
it's content nodes are moved to keep their position
relative to the bottom border of the column
, otherwise they won't be moved so they stay put relative
to the top border of the column
.
All bends that are chosen with respect to the setting of moveSingleBends
are also moved accordingly.
column
- The column to resize.newWidth
- The new width of the column.moveContentOfChangedColumn
- If content nodes of the passed column shall be moved as well.moveSingleBends
public boolean isMoveSingleBends()
isMoveSingleBends
:
setIndex(y.view.tabular.TableGroupNodeRealizer.Column, int)
setIndex(y.view.tabular.TableGroupNodeRealizer.Row, int)
setParent(y.view.tabular.TableGroupNodeRealizer.Column, y.view.tabular.TableGroupNodeRealizer.ColumnContainer)
setParent(y.view.tabular.TableGroupNodeRealizer.Row, y.view.tabular.TableGroupNodeRealizer.RowContainer)
addColumn(y.view.tabular.TableGroupNodeRealizer.ColumnContainer, int)
addRow(y.view.tabular.TableGroupNodeRealizer.RowContainer, int)
setWidth(y.view.tabular.TableGroupNodeRealizer.Column, double, boolean)
setHeight(y.view.tabular.TableGroupNodeRealizer.Row, double, boolean)
The default value of this property is true
.
true
if every bend inside a column or row that changes
its location is moved accordingly and false
if only bends of
edges that connect nodes that are moved due to a column or row changing
its location are moved accordingly.setMoveSingleBends(boolean)
public void setMoveSingleBends(boolean moveSingleBends)
The default value of this property is true
.
moveSingleBends
- true
if every bend inside a column or
row that changes its location should be moved accordingly and
false
if only bends of edges that connect nodes that are
moved due to a column or row changing its location should be moved
accordingly.isMoveSingleBends()
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |