|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.view.NodeRealizer y.view.GenericNodeRealizer y.view.hierarchy.GenericGroupNodeRealizer y.view.tabular.TableGroupNodeRealizer
public class TableGroupNodeRealizer
A node realizer for group nodes that may be used to organize its content
nodes into columns and/or rows. The realizer's columns and rows are
stored in a hierarchical fashion (i.e. each column may contain child columns,
each row may contain child rows) with the top-level columns and rows being
stored in a table structure that is accessible via getTable()
.
A node is considered to belong to a column or row, if the realizer's
associated group node is the node's parent according to
HierarchyManager.getParentNode(y.base.Node)
and
the node's center is contained in the bounding box of the column or row.
IncrementalHierarchicLayouter
provides layout
support for table nodes. However, the tabular data represented by table nodes
has to be explicitly prepared for layout calculation.
Using Graph2DLayoutExecutor
this can be done in the following
way:
IncrementalHierarchicLayouter ihl = ... Graph2DLayoutExecutor g2dle = ... // the important line g2dle.setConfiguringTableNodeRealizers(true); g2dle.doLayout(graph, ihl);
Nested Class Summary | |
---|---|
static interface |
TableGroupNodeRealizer.Column
A Column is a vertical stripe of a given
width within a node represented by a
TableGroupNodeRealizer . |
static interface |
TableGroupNodeRealizer.ColumnContainer
A container for columns . |
static class |
TableGroupNodeRealizer.ColumnNodeLabelModel
NodeLabelModel that positions a node label relative to a
column in a TableGroupNodeRealizer 's table model. |
static interface |
TableGroupNodeRealizer.Row
A Row is a horizontal stripe of a given
height within a node represented by a
TableGroupNodeRealizer . |
static interface |
TableGroupNodeRealizer.RowContainer
A container for rows . |
static class |
TableGroupNodeRealizer.RowNodeLabelModel
NodeLabelModel that positions a node label relative to a row
in a TableGroupNodeRealizer 's table model. |
static interface |
TableGroupNodeRealizer.Table
Stores the top-level columns and rows of a TableGroupNodeRealizer and provides methods for finding
columns and rows according to contained nodes or coordinates as well
as methods to move a node into a column or row. |
Nested classes/interfaces inherited from class y.view.hierarchy.GenericGroupNodeRealizer |
---|
GenericGroupNodeRealizer.GenericAutoBoundsFeature |
Field Summary |
---|
Fields inherited from class y.view.NodeRealizer |
---|
height, HOTSPOT_E, HOTSPOT_N, HOTSPOT_NE, HOTSPOT_NONE, HOTSPOT_NW, HOTSPOT_S, HOTSPOT_SE, HOTSPOT_SW, HOTSPOT_W, width, x, y |
Constructor Summary | |
---|---|
TableGroupNodeRealizer()
Creates a new TableGroupNodeRealizer that uses the default
configuration. |
|
TableGroupNodeRealizer(NodeRealizer nr)
Creates a new TableGroupNodeRealizer that adopts as much of
the specified prototype realizer's settings as possible. |
Method Summary | |
---|---|
protected void |
adoptValues(GenericNodeRealizer nr)
Tries to copy all the values from the given instance to this instance. |
void |
configureColumnLabel(NodeLabel nl,
TableGroupNodeRealizer.Column c,
boolean inside,
double topBottomRatio)
Configures the specified label as a column label for the specified column. |
void |
configureRowLabel(NodeLabel nl,
TableGroupNodeRealizer.Row r,
boolean inside,
double leftRightRatio)
Configures the specified label as a row label for the specified row. |
NodeRealizer |
createCopy(NodeRealizer nr)
Creates a copy of the given Realizer, using as much information as possible from the given instance to create a new GenericNodeRealizer instance. |
static java.util.Map |
createDefaultConfigurationMap()
Returns a map containing the default configuration for this realizer. |
YInsets |
getDefaultColumnInsets()
Returns the default column insets. |
double |
getDefaultColumnWidth()
Returns the default width of columns. |
double |
getDefaultMinimumColumnWidth()
Returns the default minimum width of columns. |
double |
getDefaultMinimumRowHeight()
Returns the default minimum height of rows. |
double |
getDefaultRowHeight()
Returns the default height of rows. |
YInsets |
getDefaultRowInsets()
Returns the default row insets. |
TableGroupNodeRealizer.Table |
getTable()
Returns the table model associated to this realizer. |
boolean |
isAutoResizeTable()
Determines whether resizing this realizer should automatically resize columns and rows of the associated table model accordingly. |
void |
read(java.io.ObjectInputStream in)
Deprecated. Use the GraphML format instead. |
void |
setAutoResizeTable(boolean autoResizeTable)
Specifies whether resizing this realizer should automatically resize columns and rows of the associated table model accordingly. |
void |
setDefaultColumnInsets(YInsets defaultColumnInsets)
Specifies the default column insets. |
void |
setDefaultColumnWidth(double defaultColumnWidth)
Specifies the default width of columns. |
void |
setDefaultMinimumColumnWidth(double defaultMinimumColumnWidth)
Specifies the default minimum width of column. |
void |
setDefaultMinimumRowHeight(double defaultMinimumRowHeight)
Specifies the default minimum height of rows. |
void |
setDefaultRowHeight(double defaultRowHeight)
Specifies the default height of rows. |
void |
setDefaultRowInsets(YInsets defaultRowInsets)
Specifies the default row insets. |
void |
setFrame(double x,
double y,
double width,
double height)
Sets the size and location of the realizer. |
void |
setFrame(java.awt.geom.Rectangle2D frame)
Sets the size and location of the realizer. |
void |
setSize(double width,
double height)
Sets the size of the realizer. |
protected void |
sizeChanged(java.awt.geom.Rectangle2D oldBounds)
Callback method invoked from setFrame and setSize . |
void |
updateTableBounds()
Ensures that the bounds of the realizer encompass the bounds of all columns and rows in its table model as well as that the bounds of any given column (row) encompasses the bounds of all of its child columns (rows). |
void |
write(java.io.ObjectOutputStream out)
Deprecated. Use the GraphML format instead. |
Methods inherited from class y.view.hierarchy.GenericGroupNodeRealizer |
---|
calcUnionRect, getAutoBoundsFeature, getBorderInsets, getBoundingBox, getClosedHeight, getClosedWidth, getMinimalInsets, getStateChangeListener, isAutoResize, isBoundsDirty, isGroupClosed, setAutoResize, setBorderInsets, setBorderInsets, setBoundsDirty, setClosedHeight, setClosedWidth, setGroupClosed, setMinimalInsets, setMinimalInsets |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TableGroupNodeRealizer()
TableGroupNodeRealizer
that uses the default
configuration.
createDefaultConfigurationMap()
public TableGroupNodeRealizer(NodeRealizer nr)
TableGroupNodeRealizer
that adopts as much of
the specified prototype realizer's settings as possible.
nr
- a prototype realizer.Method Detail |
---|
public boolean isAutoResizeTable()
true
if resizing the realizer will automatically
resize columns and rows of the associated table model accordingly;
false
otherwise.setAutoResizeTable(boolean)
,
setSize(double, double)
,
setFrame(double, double, double, double)
public void setAutoResizeTable(boolean autoResizeTable)
autoResizeTable
- if true
, resizing the realizer
will automatically resize columns and rows of the associated table model
accordingly.isAutoResizeTable()
,
setSize(double, double)
,
setFrame(double, double, double, double)
public void updateTableBounds()
protected void adoptValues(GenericNodeRealizer nr)
GenericNodeRealizer
GenericNodeRealizer.UserDataHandler
implementation or by
reference if no such handler is registered with the argument's instance.
adoptValues
in class GenericGroupNodeRealizer
nr
- the realizer to obtain the configuration frompublic NodeRealizer createCopy(NodeRealizer nr)
GenericNodeRealizer
createCopy
in class GenericGroupNodeRealizer
nr
- the realizer to create the copy of
GenericNodeRealizer
public TableGroupNodeRealizer.Table getTable()
public double getDefaultColumnWidth()
The default value for this property is 30
.
setDefaultColumnWidth(double)
public void setDefaultColumnWidth(double defaultColumnWidth)
The default value for this property is 30
.
defaultColumnWidth
- the new default width of columns.getDefaultColumnWidth()
public double getDefaultMinimumColumnWidth()
The default value for this property is 30
.
setDefaultMinimumColumnWidth(double)
public void setDefaultMinimumColumnWidth(double defaultMinimumColumnWidth)
The default value for this property is 30
.
defaultMinimumColumnWidth
- the new default minimum width of columns.getDefaultMinimumColumnWidth()
public YInsets getDefaultColumnInsets()
The default value for this property is null
.
setDefaultColumnInsets(y.geom.YInsets)
public void setDefaultColumnInsets(YInsets defaultColumnInsets)
The default value for this property is null
.
defaultColumnInsets
- the new default insets for columns.getDefaultColumnInsets()
public double getDefaultRowHeight()
The default value for this property is 30
.
setDefaultRowHeight(double)
public void setDefaultRowHeight(double defaultRowHeight)
The default value for this property is 30
.
defaultRowHeight
- the new default height of rows.getDefaultRowHeight()
public double getDefaultMinimumRowHeight()
The default value for this property is 30
.
setDefaultMinimumRowHeight(double)
public void setDefaultMinimumRowHeight(double defaultMinimumRowHeight)
The default value for this property is 30
.
defaultMinimumRowHeight
- the new default minimum height of rows.getDefaultMinimumRowHeight()
public YInsets getDefaultRowInsets()
The default value for this property is null
.
setDefaultRowInsets(y.geom.YInsets)
public void setDefaultRowInsets(YInsets defaultRowInsets)
The default value for this property is null
.
defaultRowInsets
- the new default insets for rows.getDefaultRowInsets()
public static java.util.Map createDefaultConfigurationMap()
Interface | Implementation |
Painter |
default table painter |
ContainsTest |
no implementation, i.e. delegates to
NodeRealizer.contains(double, double)
|
Initializer |
no implementation, i.e. does nothing |
HotSpotHitTest |
specialized implementation that rejects any and all hotspot hits |
HotSpotPainter |
specialized implementation that does not paint any hotspots at all |
GenericMouseInputEditorProvider |
MultiplexingNodeEditor that uses subordinate editors
|
GenericAutoBoundsFeature |
specialized implementation that takes column top and bottom as well as row left and right insets into account |
GenericSizeConstraintProvider |
specialized implementation that calculates the minimum size according to the accumulated minimum sizes (and insets) of the table model's columns and rows |
LabelBoundsChangedHandler |
DefaultGenericAutoBoundsFeature |
public void configureColumnLabel(NodeLabel nl, TableGroupNodeRealizer.Column c, boolean inside, double topBottomRatio)
TableGroupNodeRealizer.ColumnNodeLabelModel
(if
it does not already use one) and a suitable model parameter corresponding
to the specified column and position.
nl
- the label to configure.c
- the column to which associate the label to.inside
- if true
the label is positioned within the
bounds of the specified column; if false
the label is
positioned right above or right below the specified column according to
the specified top to bottom ratio.topBottomRatio
- a value in [0,1]
specifying the
vertical position of the label. If the label is placed within the column
bounds, 0
means at the top, 1
means at the
bottom. If the label is placed outside the column, values less than
0.5
result in a "right above" placement while values equal to
or greater than 0.5
result in a "right below" placement.public void configureRowLabel(NodeLabel nl, TableGroupNodeRealizer.Row r, boolean inside, double leftRightRatio)
TableGroupNodeRealizer.RowNodeLabelModel
(if
it does not already use one) and a suitable model parameter corresponding
to the specified row and position. Additionally, "left aligned" labels
will be rotated to 270
degrees clockwise while "right aligned"
labels will be rotated to 90
degrees clockwise.
nl
- the label to configure.r
- the row to which associate the label to.inside
- if true
the label is positioned within the
bounds of the specified row; if false
the label is
positioned to the left or to the right of the specified row according to
the specified left to right ratio.leftRightRatio
- a value in [0,1]
specifying the
horizontal position of the label. If the label is placed within the row
bounds, 0
means to the left, 1
means to the
right. If the label is placed outside the row, values less than
0.5
result in a "to the left" placement while values equal to
or greater than 0.5
result in a "to the right" placement.
Additionally, the rotation angle of "left aligned" labels is set to
270
degrees while the rotation angle of "right aligned"
labels is set to 90
degrees.public void read(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
GraphML format
instead.
NodeRealizer
NodeRealizer.write(ObjectOutputStream)
method.
read
in class GenericGroupNodeRealizer
java.io.IOException
java.lang.ClassNotFoundException
public void write(java.io.ObjectOutputStream out) throws java.io.IOException
GraphML format
instead.
NodeRealizer
write
in class GenericGroupNodeRealizer
java.io.IOException
public void setSize(double width, double height)
sizeChanged(java.awt.geom.Rectangle2D)
.
setSize
in interface NodeLayout
setSize
in class NodeRealizer
width
- the new width.height
- the new height.public void setFrame(double x, double y, double width, double height)
sizeChanged(java.awt.geom.Rectangle2D)
.
Note: This method does not call this realizer's version of
setSize
and setLocation
but rather the super
class implementations.
setFrame
in class NodeRealizer
x
- the new x-coordinate of the upper left corner of the realizer.y
- the new y-coordinate of the upper left corner of the realizer.width
- the new width of the realizer.height
- the new height of the realizer.public void setFrame(java.awt.geom.Rectangle2D frame)
setFrame(frame.getX(), frame.getY(), frame.getWidth(), frame.getHeight());
setFrame
in class NodeRealizer
frame
- the new size and location of the realizer.protected void sizeChanged(java.awt.geom.Rectangle2D oldBounds)
setFrame
and setSize
.
If autoResizeTable
is set to true
,
size changes are propagated to columns and rows.
oldBounds
- the old location and size of the realizer.isAutoResizeTable()
,
setFrame(java.awt.geom.Rectangle2D)
,
setFrame(double, double, double, double)
,
setSize(double, double)
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |