y.view
Class Graph2DNodeRealizer

java.lang.Object
  |
  +--y.view.NodeRealizer
        |
        +--y.view.ShapeNodeRealizer
              |
              +--y.view.Graph2DNodeRealizer
All Implemented Interfaces:
NodeLayout

public class Graph2DNodeRealizer
extends ShapeNodeRealizer

A node realizer that can display a graph as its contents.


Field Summary
 
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
Graph2DNodeRealizer()
          Creates a new instance Graph2DNodeRealizer.
Graph2DNodeRealizer(NodeRealizer nr)
          Creates a new instance of Graph2DNodeRealizer as a copy of the given realizer.
 
Method Summary
 NodeRealizer createCopy(NodeRealizer nr)
          Creates a copy of this realizer type that will be initialized with the values found in the given realizer.
 boolean getApplyClipping()
          Returns whether or not to use clipping when drawing the inenr graph.
 boolean getApplyTransformation()
          Returns whether or not to apply a best fit transformation to the graph before displaying it.
 Graph2D getInnerGraph()
          returns the inner graph associatd with this realizer.
 boolean isExpanded()
          Returns the expansion state of this realizer.
protected  void paintInnerGraph(Graphics2D gfx)
          Paints the inner graph.
protected  void paintNode(Graphics2D g)
          Paints the node.
 void paintSloppy(Graphics2D gfx)
          Paints the realizer in a cheap, uniform and sloppy way on g.
 void read(ObjectInputStream in)
          Reads in the serialized form of this realizer.
 void setApplyClipping(boolean c)
          Sets the clipping policy used when displaying the inner graph.
 void setApplyTransformation(boolean t)
          Sets the transformation policy used when displaying the inner graph.
 void setExpanded(boolean e)
          Sets the expansion state of this realizer.
 void setInnerGraph(Graph2D g)
          Sets the inner graph that this realizer should display as its contents.
 void write(ObjectOutputStream out)
          Writes this realizer in a serialized form to the given stream.
 
Methods inherited from class y.view.ShapeNodeRealizer
contains, findIntersection, getShapeType, moveBy, setCenter, setLocation, setShapeType, setSize, shapeTypeToStringMap
 
Methods inherited from class y.view.NodeRealizer
addLabel, calcUnionRect, calcUnionRect, createCopy, createNodeLabel, findBBIntersection, getBoundingBox, getCenterX, getCenterY, getFillColor, getFillColor2, getHeight, getHotSpotColor, getLabel, getLabel, getLabelText, getLayer, getLineColor, getLineType, getNode, getPortCandidates, getSloppySelectionColor, getWidth, getX, getY, hotSpotHit, intersects, isInBox, isSelected, isTransparent, isVisible, labelCount, paint, paintHotSpots, paintLayer, paintLayerSloppy, paintText, removeLabel, setCenterX, setCenterY, setEdgesDirty, setFillColor, setFillColor2, setFrame, setFrame, setHeight, setHotSpotColor, setLabel, setLabelText, setLayer, setLayer, setLineColor, setLineType, setSelected, setSloppySelectionColor, setTransparent, setVisible, setWidth, setX, setY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Graph2DNodeRealizer

public Graph2DNodeRealizer()
Creates a new instance Graph2DNodeRealizer.


Graph2DNodeRealizer

public Graph2DNodeRealizer(NodeRealizer nr)
Creates a new instance of Graph2DNodeRealizer as a copy of the given realizer.

Method Detail

setApplyClipping

public void setApplyClipping(boolean c)
Sets the clipping policy used when displaying the inner graph. If clipping is turned on then the bounding box of this realizer serves as clipping area when rendering the inner graph.

By default this feature is turned off.


setApplyTransformation

public void setApplyTransformation(boolean t)
Sets the transformation policy used when displaying the inner graph. If transformation is turned on then the inner graph will not be rendered at its original size and location but in such a way that it fits nicely in the bounding box of this realizer.

By default this feature is turned on.


getApplyTransformation

public boolean getApplyTransformation()
Returns whether or not to apply a best fit transformation to the graph before displaying it.

See Also:
Graph2DNodeRealizer.setApplyTransformation(boolean)

getApplyClipping

public boolean getApplyClipping()
Returns whether or not to use clipping when drawing the inenr graph.

See Also:
Graph2DNodeRealizer.setApplyClipping(boolean)

setExpanded

public void setExpanded(boolean e)
Sets the expansion state of this realizer. If expanded the inner graph - if present - will be displayed. If not expanded then the inner graph will not displayed.


isExpanded

public boolean isExpanded()
Returns the expansion state of this realizer.


setInnerGraph

public void setInnerGraph(Graph2D g)
Sets the inner graph that this realizer should display as its contents.


getInnerGraph

public Graph2D getInnerGraph()
returns the inner graph associatd with this realizer.


paintNode

protected void paintNode(Graphics2D g)
Paints the node. First paints the node itself and then the associated inner graph.

Overrides:
paintNode in class ShapeNodeRealizer

paintSloppy

public void paintSloppy(Graphics2D gfx)
Description copied from class: NodeRealizer
Paints the realizer in a cheap, uniform and sloppy way on g. By default this call draws a rectangle with this realizer's bounds and colors. No label will be painted.

Overrides:
paintSloppy in class NodeRealizer

paintInnerGraph

protected void paintInnerGraph(Graphics2D gfx)
Paints the inner graph.


createCopy

public NodeRealizer createCopy(NodeRealizer nr)
Description copied from class: ShapeNodeRealizer
Creates a copy of this realizer type that will be initialized with the values found in the given realizer.

Overrides:
createCopy in class ShapeNodeRealizer

write

public void write(ObjectOutputStream out)
           throws IOException
Writes this realizer in a serialized form to the given stream. Note that the inner graph will not be serialized to the stream.

Overrides:
write in class ShapeNodeRealizer
IOException

read

public void read(ObjectInputStream in)
          throws IOException,
                 ClassNotFoundException
Reads in the serialized form of this realizer. The realizer must have been written out before by it's Graph2DNodeRealizer.write(ObjectOutputStream) method.

Overrides:
read in class ShapeNodeRealizer
IOException
ClassNotFoundException

© Copyright 2000-2003,
yWorks GmbH.
All rights reserved.

2003