|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.view.hierarchy.GroupNodePainter
public class GroupNodePainter
This class is an implementation of GenericNodeRealizer.Painter for Group/Folder nodes. By default it
internally uses a ShapeNodePainter to draw the Node itself. Furthermore it will paint a state label to
show whether this node is opened or closed. This label can be clicked to toggle the node's state. One can set its own
icon for this label using (javax.swing.Icon) and (javax.swing.Icon) or define its own label by overwriting method
getStateLabel(y.view.NodeRealizer).
An own implementation of GenericNodeRealizer.Painter can be handed over to this class that will be
used to draw the node itself. By default a ShapeNodePainter is being used.
Method setInnerGraphDisplayEnabled(boolean) can be used to determine whether the inner graph of the group
node shall be painted or not.
Method setGroupDepthFillColorEnabled(boolean) can be used to determine whether deeper nested graphs shall
get darker fill colors for deeper nested group nodes to achieve a better outline.
| Constructor Summary | |
|---|---|
GroupNodePainter()
Creates a new instance of GroupNodePainter that uses a ShapeNodePainter to paint the node itself. |
|
GroupNodePainter(GenericNodeRealizer.Painter painterDelagate)
Creates a new instance of GroupNodePainter that uses the given GenericNodeRealizer.Painter implementation
to paint node itself and adds the state label and the ability to open/close this node to it. |
|
| Method Summary | |
|---|---|
boolean |
contains(NodeRealizer context,
double x,
double y)
Used as a callback for the GenericNodeRealizer.contains(double, double) method. |
MouseInputEditor |
findMouseInputEditor(NodeRealizer context,
Graph2DView view,
double x,
double y,
HitInfo hitInfo)
Used as a callback for the GenericNodeRealizer.findMouseInputEditor(Graph2DView, double, double, HitInfo) method. |
Icon |
getClosedGroupIcon()
Returns the icon that is used for the state label when the group is closed. |
protected HierarchyManager |
getHierarchyManager(Graph graph)
Returns the hierarchy manager responsibly for managing the node represented by this realizer. |
Icon |
getOpenGroupIcon()
Returns the icon that is used for the state label when the group is opened. |
protected NodeLabel |
getStateLabel(NodeRealizer context)
Returns the state label of this realizer. |
void |
initialize(NodeRealizer context)
|
boolean |
isGroupDepthFillColorEnabled()
Whether or not the fill color of this node gets adapted to reflect the local group depth of this node within the graph hierarchy. |
boolean |
isInnerGraphDisplayEnabled()
Returns whether or not the inner graph of a folder node should be displayed. |
void |
paint(NodeRealizer context,
Graphics2D graphics)
Used as a callback for the GenericNodeRealizer.paint(Graphics2D) method. |
protected void |
paintInnerGraph(NodeRealizer context,
Graphics2D gfx)
Used to paint the inner graph of a folder node when innerGraphDisplay is enabled. |
void |
paintSloppy(NodeRealizer context,
Graphics2D graphics)
Used as a callback for the GenericNodeRealizer.paintSloppy(Graphics2D) method. |
void |
setClosedGroupIcon(Icon icon)
Sets the icon to be used for the state label when the group is closed. |
void |
setGroupDepthFillColorEnabled(boolean enabled)
Whether or not the fill color of this node should be adapted to reflect the local group depth of this node within the graph hierarchy. |
void |
setInnerGraphDisplayEnabled(boolean innerGraphDisplayEnabled)
Sets whether or not the inner graph of a folder node should be displayed. |
void |
setOpenGroupIcon(Icon icon)
Sets the icon to be used for the state label when the group is open. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GroupNodePainter()
ShapeNodePainter to paint the node itself.
public GroupNodePainter(GenericNodeRealizer.Painter painterDelagate)
GenericNodeRealizer.Painter implementation
to paint node itself and adds the state label and the ability to open/close this node to it.
painterDelagate - an implementation of GenericNodeRealizer.Painter that will be used for painting the
node itself.| Method Detail |
|---|
public void paint(NodeRealizer context,
Graphics2D graphics)
GenericNodeRealizer.PainterGenericNodeRealizer.paint(Graphics2D) method.
paint in interface GenericNodeRealizer.Painter
public void paintSloppy(NodeRealizer context,
Graphics2D graphics)
GenericNodeRealizer.PainterGenericNodeRealizer.paintSloppy(Graphics2D) method.
paintSloppy in interface GenericNodeRealizer.Painter
protected void paintInnerGraph(NodeRealizer context,
Graphics2D gfx)
context - the node realizer that this painter is associated with.gfx - the graphics context to paint to.public Icon getClosedGroupIcon()
public void setClosedGroupIcon(Icon icon)
icon - used to illustrate a closed state.public Icon getOpenGroupIcon()
public void setOpenGroupIcon(Icon icon)
icon - used to illustrate an open state.public void setGroupDepthFillColorEnabled(boolean enabled)
enabled - whether the group depth shall be reflected by the groups fill color. Default is true.public boolean isGroupDepthFillColorEnabled()
setGroupDepthFillColorEnabled(boolean)protected NodeLabel getStateLabel(NodeRealizer context)
context - the node realizer that this painter is associated with.
protected HierarchyManager getHierarchyManager(Graph graph)
graph - the graph for whom the HierarchyManager shall be returned.
public boolean isInnerGraphDisplayEnabled()
public void setInnerGraphDisplayEnabled(boolean innerGraphDisplayEnabled)
innerGraphDisplayEnabled - whether or not the inner graph of a folder node should be displayed.
public MouseInputEditor findMouseInputEditor(NodeRealizer context,
Graph2DView view,
double x,
double y,
HitInfo hitInfo)
GenericNodeRealizer.GenericMouseInputEditorProviderGenericNodeRealizer.findMouseInputEditor(Graph2DView, double, double, HitInfo) method.
findMouseInputEditor in interface GenericNodeRealizer.GenericMouseInputEditorProviderMouseInputEditor,
MouseInputEditorProviderpublic void initialize(NodeRealizer context)
initialize in interface GenericNodeRealizer.Initializer
public boolean contains(NodeRealizer context,
double x,
double y)
GenericNodeRealizer.ContainsTestGenericNodeRealizer.contains(double, double) method.
contains in interface GenericNodeRealizer.ContainsTest
|
© Copyright 2000-2008, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||