Search this API

y.view
Class Graph2DNodeRealizer

java.lang.Object
  extended by y.view.NodeRealizer
      extended by y.view.ShapeNodeRealizer
          extended by y.view.Graph2DNodeRealizer
All Implemented Interfaces:
NodeLayout

public class Graph2DNodeRealizer
extends ShapeNodeRealizer

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

 
Your browser does not support SVG content.

Field Summary
 
Fields inherited from class y.view.ShapeNodeRealizer
DIAMOND, ELLIPSE, FAT_ARROW, FAT_ARROW_2, HEXAGON, KEY_SLOPPY_RECT_PAINTING, OCTAGON, PARALLELOGRAM, PARALLELOGRAM_2, RECT, RECT_3D, ROUND_RECT, shape, STAR5, STAR6, STAR8, TRAPEZOID, TRAPEZOID_2, TRIANGLE, TRIANGLE_2, VALUE_SLOPPY_RECT_PAINTING_OFF
 
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 inner 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 associated to this realizer.
 boolean isExpanded()
          Returns the expansion state of this realizer.
protected  void paintInnerGraph(java.awt.Graphics2D gfx)
          Paints the inner graph.
protected  void paintNode(java.awt.Graphics2D g)
          Paints the node.
 void paintSloppy(java.awt.Graphics2D gfx)
          Paints the realizer in a cheap, uniform and sloppy way on g.
 void read(java.io.ObjectInputStream in)
          Deprecated. Use the GraphML format instead.
 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(java.io.ObjectOutputStream out)
          Deprecated. Use the GraphML format instead.
 
Methods inherited from class y.view.ShapeNodeRealizer
calcUnionRect, contains, createSelectionColor, findIntersection, getDropShadowColor, getDropShadowOffsetX, getDropShadowOffsetY, getShapeType, hotSpotHit, isDropShadowVisible, isRaisedBorderEnabled, moveBy, paint3DBorder, paintFilledShape, paintHotSpots, paintShadow, paintShapeBorder, setCenter, setDropShadowColor, setDropShadowOffsetX, setDropShadowOffsetY, setLocation, setRaisedBorderEnabled, setShapeType, setSize, shapeTypeToStringMap
 
Methods inherited from class y.view.NodeRealizer
addLabel, addPort, boundsChanged, calcUnionRect, calcUnionRectImpl, calcUnionRectLabels, calcUnionRectPorts, createCopy, createNodeLabel, findBBIntersection, getAutoBoundsFeature, getBoundingBox, getCenterX, getCenterY, getFillColor, getFillColor2, getHeight, getHotSpotColor, getLabel, getLabel, getLabelText, getLayer, getLineColor, getLineType, getMouseInputEditorProvider, getNode, getPort, getPortCandidates, getSizeConstraintProvider, getSloppySelectionColor, getWidth, getX, getY, intersects, invalidatePortPositions, isInBox, isSelected, isTransparent, isVisible, labelBoundsChanged, labelCount, paint, paintLayer, paintLayerSloppy, paintPorts, paintText, portCount, removeLabel, removeLabel, removePort, removePort, repaint, 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.

Parameters:
nr - the prototype to be copied.
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.

Parameters:
c - if true the bounding box of this realizer serves as clipping area when rendering the inner graph.
See Also:
getApplyClipping()

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.

Parameters:
t - if true the inner graph will be rendered in such a way that it fits nicely in the bounding box of this realizer.
See Also:
getApplyTransformation()

getApplyTransformation

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

Returns:
true if a best fit transformation is applied to the graph before displaying it; false otherwise.
See Also:
setApplyTransformation(boolean)

getApplyClipping

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

Returns:
true if clipping is used when drawing the inner graph; false otherwise.
See Also:
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.

By default, a Graph2DNodeRealizer instance is expanded.

Parameters:
e - the new expansion state of this realizer.
See Also:
isExpanded()

isExpanded

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

By default, a Graph2DNodeRealizer instance is expanded.

Returns:
the expansion state of this realizer.
See Also:
setExpanded(boolean)

setInnerGraph

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

Parameters:
g - the inner graph for this realizer.
See Also:
getInnerGraph()

getInnerGraph

public Graph2D getInnerGraph()
Returns the inner graph associated to this realizer.

Returns:
the inner graph associated to this realizer.
See Also:
setInnerGraph(Graph2D)

paintNode

protected void paintNode(java.awt.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(java.awt.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(java.awt.Graphics2D gfx)
Paints the inner graph.

Parameters:
gfx - the graphics context to paint upon.

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
Parameters:
nr - the prototype realizer whose attributes will be copied.

write

public void write(java.io.ObjectOutputStream out)
           throws java.io.IOException
Deprecated. Use the GraphML format instead.

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
Throws:
java.io.IOException

read

public void read(java.io.ObjectInputStream in)
          throws java.io.IOException,
                 java.lang.ClassNotFoundException
Deprecated. Use the GraphML format instead.

Reads in the serialized form of this realizer. The realizer must have been written out before by it's write(ObjectOutputStream) method.

Overrides:
read in class ShapeNodeRealizer
Throws:
java.io.IOException
java.lang.ClassNotFoundException

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