|
|||||||||
| 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 hite 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(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 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. |
Insets |
getBorderInsets()
|
Rectangle2D.Double |
getBoundingBox()
Return the bounding box of this realizer. |
double |
getClosedHeight()
|
double |
getClosedWidth()
|
Insets |
getMinimalInsets()
|
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()
|
boolean |
isGroupClosed()
Whether the node is closed or not. |
void |
read(ObjectInputStream in)
Reads in the serialized form of this realizer. |
void |
setAutoResize(boolean autoResize)
Whether the realizer will resize its bounds or not. |
void |
setBorderInsets(Insets inset)
Sets the size of the empty border that will be added to the minimal bounds of this realizer. |
void |
setBoundsDirty(boolean boundsDirty)
|
void |
setClosedHeight(double closedHeight)
|
void |
setClosedWidth(double closedWidth)
|
void |
setGroupClosed(boolean closed)
Opens or closes the group node realizer. |
void |
setMinimalInsets(Insets insets)
Sets the insets that define the minimal distance between the border of the group node and its graph content. |
void |
write(ObjectOutputStream out)
Writes this realizer in a serialized form to the given stream. |
| Methods inherited from class y.view.GenericNodeRealizer |
|---|
boundsChanged, contains, findIntersection, findMouseInputEditor, getConfiguration, getFactory, getMouseInputEditorProvider, getPortCandidates, getSizeConstraintProvider, getUserData, hotSpotHit, labelBoundsChanged, paint, paintHotSpots, paintNode, paintSloppy, setConfiguration, setUserData |
| 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 Map createDefaultConfigurationMap()
public void calcUnionRect(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()
public void setBoundsDirty(boolean boundsDirty)
public double getClosedWidth()
public void setClosedWidth(double closedWidth)
public double getClosedHeight()
public void setClosedHeight(double closedHeight)
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 Rectangle2D.Double getBoundingBox()
NodeRealizer
getBoundingBox in class NodeRealizerpublic Insets getBorderInsets()
getBorderInsets in interface GroupFeaturepublic Insets getMinimalInsets()
getMinimalInsets in interface GroupFeatureGroupFeature.setMinimalInsets(Insets)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(Insets insets)
15 for each side.
setMinimalInsets in interface GroupFeatureinsets - the insets that are to be set.public void setBorderInsets(Insets inset)
setBorderInsets in interface GroupFeatureinset - the insets to be set.
public void read(ObjectInputStream in)
throws IOException,
ClassNotFoundException
NodeRealizerNodeRealizer.write(ObjectOutputStream) method.
read in class GenericNodeRealizerIOException
ClassNotFoundException
public void write(ObjectOutputStream out)
throws IOException
NodeRealizer
write in class GenericNodeRealizerIOException
|
© Copyright 2000-2008, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||