|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.view.NodeRealizer
y.view.GenericNodeRealizer
y.view.hierarchy.GenericGroupNodeRealizer
public class GenericGroupNodeRealizer
This class is a specialization of GenericNodeRealizer for group and folder nodes. It is a node
realizer that is crafted to represent group and folder nodes within a graph hierarchy. A GenericGroupNodeRealizer has
two main states: it can be either open or closed (isGroupClosed()). When being closed, the realizer usually
represents a folder node (HierarchyManager.isFolderNode(Node)). When being open, the realizer usually
represents a group node (HierarchyManager.isGroupNode(Node)). The size and location of an open realizer will
be determined by the bounds of its child nodes within the hierarchy (HierarchyManager.getChildren(Node)).
The main appearance can easily be customized by setting an own GenericNodeRealizer.Painter
implementation.
Note: If you are using the default implementation createDefaultConfigurationMap() please make sure to
enable node hits on your MouseInputMode:
EditMode editMode = new EditMode();
editMode.getMouseInputMode().setNodeSearchingEnabled(true);
This is necessary to handle mouse clicks on the state label to open/close the group.
![]() |
![]() |
| Nested Class Summary | |
|---|---|
static interface |
GenericGroupNodeRealizer.GenericAutoBoundsFeature
Additional interface for node realizers whose bounds may be determined by other factors then explicit bound assignment. |
| 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 | |
|---|---|
GenericGroupNodeRealizer()
|
|
GenericGroupNodeRealizer(NodeRealizer nr)
|
|
| Method Summary | |
|---|---|
protected void |
adoptValues(GenericNodeRealizer cnr)
Tries to copy all the values from the given instance to this instance. |
void |
calcUnionRect(java.awt.geom.Rectangle2D r)
Uses the registered GenericNodeRealizer.UnionRectCalculator implementation to
delegate the actual work to. |
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 holding the default configuration for GenericGroupNodeRealizer. |
AutoBoundsFeature |
getAutoBoundsFeature()
Returns a feature, that can be used to automatically adjust the NodeRealizers bounds. |
YInsets |
getBorderInsets()
Returns the size of the empty border that will be added to the minimal bounds of this realizer. |
java.awt.geom.Rectangle2D.Double |
getBoundingBox()
Return the bounding box of this realizer. |
double |
getClosedHeight()
Returns the height for the realizer's closed state. |
double |
getClosedWidth()
Returns the width for the realizer's closed state. |
YInsets |
getMinimalInsets()
Returns the minimal insets defined for this realizer. |
static HierarchyListener |
getStateChangeListener()
returns a hierarchy listener for adjusting the groupClosed property of
GroupFeature instances. |
boolean |
isAutoResize()
Whether the realizer will resize its bounds or not. |
boolean |
isBoundsDirty()
Returns whether or not the bounds of this realizer are considered to be dirty. |
boolean |
isGroupClosed()
Whether the node is closed or not. |
void |
read(java.io.ObjectInputStream in)
Deprecated. Use the GraphML format instead. |
void |
setAutoResize(boolean autoResize)
Whether the realizer will resize its bounds or not. |
void |
setBorderInsets(java.awt.Insets insets)
Deprecated. Use setBorderInsets(y.geom.YInsets) instead. |
void |
setBorderInsets(YInsets insets)
Sets the size of the empty border that will be added to the minimal bounds of this realizer. |
void |
setBoundsDirty(boolean boundsDirty)
Sets this realizer's boundsDirty property to the specified
value. |
void |
setClosedHeight(double closedHeight)
Sets the height for of this realizer in its closed
state. |
void |
setClosedWidth(double closedWidth)
Sets the width for of this realizer in its closed
state. |
void |
setGroupClosed(boolean closed)
Opens or closes the group node realizer. |
void |
setMinimalInsets(java.awt.Insets insets)
Deprecated. Use setMinimalInsets(y.geom.YInsets) instead. |
void |
setMinimalInsets(YInsets insets)
Sets the insets that define the minimal distance between the border of the group node and its graph content. |
void |
write(java.io.ObjectOutputStream out)
Deprecated. Use the GraphML format instead. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GenericGroupNodeRealizer()
public GenericGroupNodeRealizer(NodeRealizer nr)
| Method Detail |
|---|
protected void adoptValues(GenericNodeRealizer cnr)
GenericNodeRealizerGenericNodeRealizer.UserDataHandler implementation or by
reference if no such handler is registered with the argument's instance.
adoptValues in class GenericNodeRealizercnr - the realizer to obtain the configuration frompublic static java.util.Map createDefaultConfigurationMap()
public void calcUnionRect(java.awt.geom.Rectangle2D r)
GenericNodeRealizerGenericNodeRealizer.UnionRectCalculator implementation to
delegate the actual work to. If no such instance is registered with this
instance super.calcUnionRect(r); is called.
calcUnionRect in class GenericNodeRealizerpublic boolean isAutoResize()
public void setAutoResize(boolean autoResize)
autoResize - whether this realizer will adjust its size automatically. Default is true.public boolean isGroupClosed()
isGroupClosed in interface GroupFeaturepublic boolean isBoundsDirty()
GenericGroupNodeRealizer.GenericAutoBoundsFeature associated to this realizer (via its
configuration) needs to recalculate the realizer's bounds when the realizer
is queried for its bounding box.
public void setBoundsDirty(boolean boundsDirty)
boundsDirty property to the specified
value. A value of true means that the bounds of this realizer
are considered to be dirty. In this context, dirty means
that the GenericGroupNodeRealizer.GenericAutoBoundsFeature associated to this realizer (via
its configuration) needs to recalculate the realizer's bounds when the
realizer is queried for its bounding box.
Note: It is the responsibility of the
GenericAutoBoundsFeature implementation to mark a realizer's
bounds as not dirty (anymore), i.e. setting the
boundsDirty property to false.
boundsDirty - the new value for the boundsDirty
property.public double getClosedWidth()
setClosedWidth(double)public void setClosedWidth(double closedWidth)
closed
state.
Note: Changing from closed to open state will
set closedWidth to the width of the realizer right before
changing state.
Changing from open to closed state will possibly update
closedWidth to respect minimum width constraints of
an associated SizeConstraintProvider.
closedWidth - the width for the closed state of the realizer.isGroupClosed(),
setGroupClosed(boolean)public double getClosedHeight()
setClosedHeight(double)public void setClosedHeight(double closedHeight)
closed
state.
Note: Changing from closed to open state will
set closedHeight to the height of the realizer right before
changing state.
Changing from open to closed state will possibly update
closedHeight to respect minimum height constraints of
an associated SizeConstraintProvider.
closedHeight - the height for the closed state of the realizer.isGroupClosed(),
setGroupClosed(boolean)public NodeRealizer createCopy(NodeRealizer nr)
GenericNodeRealizer
createCopy in class GenericNodeRealizernr - the realizer to create the copy of
GenericNodeRealizerpublic void setGroupClosed(boolean closed)
setGroupClosed in interface GroupFeatureclosed - whether to set the realizer state to open or close.HierarchyManager.isGroupNode(Node),
HierarchyManager.isFolderNode(Node)public java.awt.geom.Rectangle2D.Double getBoundingBox()
NodeRealizer
getBoundingBox in class NodeRealizerpublic YInsets getBorderInsets()
getBorderInsets in interface GroupFeaturesetBorderInsets(y.geom.YInsets)public YInsets getMinimalInsets()
By default the insets are set to 15 for each side.
getMinimalInsets in interface GroupFeaturesetMinimalInsets(y.geom.YInsets)public static HierarchyListener getStateChangeListener()
groupClosed property of
GroupFeature instances. Add this HierarchyListener implementation to the respective HierarchyManager
instances and changes of the group nodes' states will be automatically reflected by the
groupClosed property.
public AutoBoundsFeature getAutoBoundsFeature()
NodeRealizer
getAutoBoundsFeature in class NodeRealizerAutoBoundsFeature or null,
if no feature is bound to this realizer.public void setMinimalInsets(java.awt.Insets insets)
setMinimalInsets(y.geom.YInsets) instead.
By default the insets are set to 15 for each side.
insets - the insets that are to be set.public void setMinimalInsets(YInsets insets)
By default the insets are set to 15 for each side.
setMinimalInsets in interface GroupFeatureinsets - the insets that are to be set.getMinimalInsets()public void setBorderInsets(java.awt.Insets insets)
setBorderInsets(y.geom.YInsets) instead.
insets - the insets to be set.public void setBorderInsets(YInsets insets)
setBorderInsets in interface GroupFeatureinsets - the insets to be set.getBorderInsets()
public void read(java.io.ObjectInputStream in)
throws java.io.IOException,
java.lang.ClassNotFoundException
GraphML format instead.
NodeRealizerNodeRealizer.write(ObjectOutputStream) method.
read in class GenericNodeRealizerjava.io.IOException
java.lang.ClassNotFoundException
public void write(java.io.ObjectOutputStream out)
throws java.io.IOException
GraphML format instead.
NodeRealizer
write in class GenericNodeRealizerjava.io.IOException
|
© Copyright 2000-2025, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||