|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.view.NodeRealizer | +--y.view.ShapeNodeRealizer | +--y.view.hierarchy.GroupNodeRealizer
A node realizer that is crafted to represent group and folder nodes within a graph hierarchy.
A GroupNodeRealizer has two main states: it can be either open or closed (GroupNodeRealizer.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)
).
Nested Class Summary | |
static class |
GroupNodeRealizer.StateChangeListener
This static inner class can be used to automatically adjust the groupClosed property of GroupNodeRealizer instances.
|
Field Summary | |
static Icon |
defaultClosedGroupIcon
The default icon used by the state label, if the group realizer is closed. |
static Icon |
defaultOpenGroupIcon
The default icon used by the state label, if the group realizer is open. |
Fields inherited from class y.view.ShapeNodeRealizer |
DIAMOND, ELLIPSE, HEXAGON, OCTAGON, PARALLELOGRAM, RECT, RECT_3D, ROUND_RECT, shape, TRAPEZOID, TRAPEZOID_2, TRIANGLE |
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 | |
GroupNodeRealizer()
|
|
GroupNodeRealizer(NodeRealizer arg)
|
Method Summary | |
void |
calcUnionRect(Rectangle2D r)
Enlarges the given rectangle such that it will contain the bounding box of this realizer and the bounding box of the realizer label. |
boolean |
contains(double x,
double y)
Evaluate hit test on the node realizer. |
NodeRealizer |
createCopy(NodeRealizer arg)
Creates a copy of this realizer type that will be initialized with the values found in the given realizer. |
boolean |
findBBIntersection(double ix,
double iy,
double ox,
double oy,
Point2D result)
Returns true iff the coord (ix,iy)
is identical with (getCenterX(),getCenterY()) and
the coord (ox,oy), lies outside the bounding box
of this realizer. |
boolean |
findIntersection(double ix,
double iy,
double ox,
double oy,
Point2D result)
Special Intersection handling for some types of shape. |
Insets |
getAutoBoundsInsets()
Returns the currently set auto bounds insets. |
Insets |
getBorderInsets()
Returns the size of the empty border that will be added to the minimal bounds of this realizer. |
Rectangle2D.Double |
getBoundingBox()
Return the bounding box of this realizer. |
double |
getCenterX()
Get X-Coordinate of the center of the node. |
double |
getCenterY()
Get Y-Coordinate of the center of the node. |
double |
getHeight()
Returns the height of this realizer. |
protected HierarchyManager |
getHierarchyManager()
Returns the heirarchy manager responsibly for managing the node represented by this realizer. |
Rectangle2D |
getMinimalAutoBounds()
Returns the minimal auto bounds of this object. |
Insets |
getMinimalInsets()
Returns the minimal insets defined for this realizer. |
NodeLabel |
getStateLabel()
Returns the state label of this realizer. |
double |
getWidth()
Returns the width of this realizer. |
double |
getX()
Get X-Coordinate of the upper left corner of the node. |
double |
getY()
Get Y-Coordinate of the upper left corner of the node. |
boolean |
intersects(double rx,
double ry,
double rw,
double rh)
Returns true iff the bounding box of this realizer
intersects with the given box. |
boolean |
isAutoBoundsEnabled()
Returns true if autobounds have been disabled and the realizer is not closed. |
boolean |
isGroupClosed()
Returns true if this group node realizer is closed and false
otherwise. |
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. |
protected void |
paintNode(Graphics2D gfx)
Paints the node. |
void |
paintSloppy(Graphics2D gfx)
Paints the realizer in a cheap, uniform and sloppy way on g . |
void |
paintText(Graphics2D gfx)
Paints the labels that belong to this realizer |
void |
read(ObjectInputStream in)
Reads in the serialized form of this realizer. |
void |
setAutoBoundsEnabled(boolean auto)
Enabled or disables the autobounds feature of this realizer. |
void |
setAutoBoundsInsets(Insets insets)
The same as GroupNodeRealizer.setBorderInsets(Insets) . |
void |
setBorderInsets(Insets inset)
Sets the size of the empty border that will be added to the minimal bounds of this realizer. |
void |
setClosedGroupIcon(Icon icon)
Sets the icon to be used for the state label when the group is closed. |
void |
setGroupClosed(boolean closed)
Opens or closes the group node realizer. |
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 enabled)
Sets whether or not the inner graph of a folder node should be displayed. |
void |
setMinimalInsets(Insets insets)
Sets the insets that define the minimal distance between the border of the group node and its graph content. |
void |
setOpenGroupIcon(Icon icon)
Sets the icon to be used for the state label when the group is open. |
void |
setStateLabel(NodeLabel stateLabel)
Sets the state label of this realizer. |
void |
updateAutoSizeBounds()
Forces recalculation of the autosize bounds. |
void |
write(ObjectOutputStream out)
Writes this realizer in a serialized form to the given stream. |
Methods inherited from class y.view.ShapeNodeRealizer |
getShapeType, moveBy, setCenter, setLocation, setShapeType, setSize, shapeTypeToStringMap |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final Icon defaultClosedGroupIcon
public static final Icon defaultOpenGroupIcon
Constructor Detail |
public GroupNodeRealizer()
public GroupNodeRealizer(NodeRealizer arg)
Method Detail |
public NodeRealizer createCopy(NodeRealizer arg)
ShapeNodeRealizer
createCopy
in class ShapeNodeRealizer
public Insets getAutoBoundsInsets()
AutoBoundsFeature
getAutoBoundsInsets
in interface AutoBoundsFeature
public void setAutoBoundsInsets(Insets insets)
GroupNodeRealizer.setBorderInsets(Insets)
.
setAutoBoundsInsets
in interface AutoBoundsFeature
public boolean isAutoBoundsEnabled()
isAutoBoundsEnabled
in interface AutoBoundsFeature
GroupNodeRealizer.isGroupClosed()
public void setAutoBoundsEnabled(boolean auto)
If this feature is enabled and the realizer represents a group node in a graph hierarchy, then bounds of this realizer will be mainly determined by the bounds of the children of the underlying group node.
When turning this feature on, the bounds and the border of this node will change. The new bounds will be the union of the currently set bounds and the minimal bounds dictated by the children of the underlying group node. The new border will be set to represent the part of the new bounds that surmounts the previously set bounds.
setAutoBoundsEnabled
in interface AutoBoundsFeature
public Rectangle2D getMinimalAutoBounds()
AutoBoundsFeature
getMinimalAutoBounds
in interface AutoBoundsFeature
public void updateAutoSizeBounds()
public void setMinimalInsets(Insets insets)
By default the insets are set to 15
for each side.
public Insets getMinimalInsets()
GroupNodeRealizer.setMinimalInsets(Insets)
public void setBorderInsets(Insets inset)
public Insets getBorderInsets()
public void setClosedGroupIcon(Icon icon)
GroupNodeRealizer.getStateLabel()
,
GroupNodeRealizer.isGroupClosed()
public void setOpenGroupIcon(Icon icon)
GroupNodeRealizer.getStateLabel()
,
GroupNodeRealizer.isGroupClosed()
public void setGroupClosed(boolean closed)
HierarchyManager.isGroupNode(Node)
,
HierarchyManager.isFolderNode(Node)
public boolean isGroupClosed()
true
if this group node realizer is closed and false
otherwise.
public void setInnerGraphDisplayEnabled(boolean enabled)
HierarchyManager.isFolderNode(Node)
,
GroupNodeRealizer.isGroupClosed()
public boolean isInnerGraphDisplayEnabled()
public void paintSloppy(Graphics2D gfx)
NodeRealizer
g
. By default this call draws a
rectangle with this realizer's bounds and colors.
No label will be painted.
paintSloppy
in class NodeRealizer
protected void paintNode(Graphics2D gfx)
ShapeNodeRealizer
paintNode
in class ShapeNodeRealizer
public void paintText(Graphics2D gfx)
NodeRealizer
paintText
in class NodeRealizer
public void setGroupDepthFillColorEnabled(boolean enabled)
public boolean isGroupDepthFillColorEnabled()
GroupNodeRealizer.setGroupDepthFillColorEnabled(boolean)
public void setStateLabel(NodeLabel stateLabel)
public NodeLabel getStateLabel()
public Rectangle2D.Double getBoundingBox()
NodeRealizer
getBoundingBox
in class NodeRealizer
protected HierarchyManager getHierarchyManager()
public double getY()
NodeRealizer
getY
in interface NodeLayout
getY
in class NodeRealizer
public double getCenterX()
NodeRealizer
getCenterX
in class NodeRealizer
public boolean contains(double x, double y)
ShapeNodeRealizer
contains
in class ShapeNodeRealizer
true
if the position (x,y) is part of the node
false
otherwise.public double getHeight()
NodeRealizer
getHeight
in interface NodeLayout
getHeight
in class NodeRealizer
public double getX()
NodeRealizer
getX
in interface NodeLayout
getX
in class NodeRealizer
public boolean findIntersection(double ix, double iy, double ox, double oy, Point2D result)
ShapeNodeRealizer
findIntersection
in class ShapeNodeRealizer
public double getWidth()
NodeRealizer
getWidth
in interface NodeLayout
getWidth
in class NodeRealizer
public double getCenterY()
NodeRealizer
getCenterY
in class NodeRealizer
public boolean intersects(double rx, double ry, double rw, double rh)
NodeRealizer
true
iff the bounding box of this realizer
intersects with the given box.
intersects
in class NodeRealizer
public void calcUnionRect(Rectangle2D r)
NodeRealizer
calcUnionRect
in class NodeRealizer
public boolean findBBIntersection(double ix, double iy, double ox, double oy, Point2D result)
NodeRealizer
true
iff the coord (ix,iy)
is identical with (getCenterX(),getCenterY())
and
the coord (ox,oy),
lies outside the bounding box
of this realizer. In that case the intersection point of the
line (ix,iy) - (ox,oy)
with the bounding box
of this realizer will be stored in the given point.
findBBIntersection
in class NodeRealizer
public void write(ObjectOutputStream out) throws IOException
ShapeNodeRealizer
write
in class ShapeNodeRealizer
IOException
public void read(ObjectInputStream in) throws IOException, ClassNotFoundException
ShapeNodeRealizer
ShapeNodeRealizer.write(ObjectOutputStream)
method.
read
in class ShapeNodeRealizer
IOException
ClassNotFoundException
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |