Search this API

y.view
Class ProxyShapeNodeRealizer

java.lang.Object
  extended by y.view.NodeRealizer
      extended by y.view.ShapeNodeRealizer
          extended by y.view.ProxyShapeNodeRealizer
All Implemented Interfaces:
NodeLayout
Direct Known Subclasses:
ProxyAutoBoundsNodeRealizer

public class ProxyShapeNodeRealizer
extends ShapeNodeRealizer

A ShapeNodeRealizer that can act as a proxy to another internally used realizer. Also, this class can maintain a list of realizers, that will be copied, saved, and restored when performing these operations on this class. Usually, the held realizers define the set of possible delegation targets of this class.

Almost all inherited methods of this class are overwritten to delegate to the currently set realizer delegate. E.g. the implementation of setSelected is basically

if (rd != null) rd.setSelected(s); else super.setSelected(s);
with rd being the current realizer delegate. Notable exceptions to this rule are read(java.io.ObjectInputStream), write(java.io.ObjectOutputStream), and createCopy(NodeRealizer).

 

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
ProxyShapeNodeRealizer()
          Creates instance of ProxyShapeNodeRealizer.
ProxyShapeNodeRealizer(NodeRealizer argNodeRealizer)
          Create instance of NodeRealizer and initialize it according to a given NodeRealizer.
 
Method Summary
 void addLabel(NodeLabel nl)
          Add the given label to this realizer.
 void addPort(NodePort port)
          Adds and binds the specified node port to this realizer.
 void addRealizer(NodeRealizer r)
          Adds a realizer to the list of realizers maintained by this class.
 void calcUnionRect(java.awt.geom.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 and its drop shadow.
 void calcUnionRect(java.awt.geom.Rectangle2D r, byte layer)
          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 nr)
          Creates a copy of this realizer type that will be initialized with the values found in the given realizer.
 NodeLabel createNodeLabel()
          Creates a new node label that can be added to this realizer.
 boolean findBBIntersection(double ix, double iy, double ox, double oy, java.awt.geom.Point2D result)
          Calculates the intersection point of a line segment and this realizer's rectangular bounding box.
 boolean findIntersection(double ix, double iy, double ox, double oy, java.awt.geom.Point2D result)
          Special Intersection handling for some types of shape.
 java.awt.geom.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.
 java.awt.Color getFillColor()
          Returns the fill color of this realizer.
 java.awt.Color getFillColor2()
          Returns the fill color of this realizer.
 double getHeight()
          Returns the height of this realizer.
 NodeLabel getLabel()
          Returns the first label associated with this realizer.
 NodeLabel getLabel(int i)
          Returns the i-th label associated with this realizer.
 java.lang.String getLabelText()
          Returns the text of the first label associated with this realizer.
 byte getLayer()
          Returns the logical graphical layer for this realizer.
 java.awt.Color getLineColor()
          Returns the outline color of this realizer.
 LineType getLineType()
          Returns the line type of this realizer.
 MouseInputEditorProvider getMouseInputEditorProvider()
          Returns a provider, that can be used to query for a mouse input editor for this realizer.
 NodePort getPort(int index)
          Returns the i-th node port that is associated to this realizer.
 YList getPortCandidates(double gridResolution)
          Returns a list of YPoints that contains absolute(!)
 NodeRealizer getRealizer(int i)
          Returns the i-th realizer from the list of realizers maintained by this class.
 NodeRealizer getRealizerDelegate()
          Returns the delegation target of this proxy realizer.
 byte getShapeType()
          Returns shape type 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.
 byte hotSpotHit(double hx, double hy)
          Adjusted hitSpotHit that takes drop shadows into account.
 boolean intersects(double rx, double ry, double rw, double rh)
          Determines whether or not the bounding box of this realizer intersects the specified rectangle.
protected  void invalidatePortPositions()
          Invalidates the positions of all associated NodePorts.
 boolean isInBox(double xb, double yb, double wb, double hb)
          Determines whether or not the center of this realizer lies within the specified rectangle.
 boolean isSelected()
          Returns the selection state of this realizer.
 boolean isTransparent()
          Returns the transparency state of this realizer.
 boolean isVisible()
          Returns true iff this realizer is marked as visible.
 int labelCount()
          Returns the number of labels associated with this realizer.
 void moveBy(double dx, double dy)
          Moves this realizer by the vector (dx,dy).
 void paint(java.awt.Graphics2D gfx)
          Paints this realizer and its label(s) on the given graphics context.
 void paintHotSpots(java.awt.Graphics2D gfx)
          Paints graphical hotspots around this realizer.
 void paintLayer(java.awt.Graphics2D gfx, byte layer)
          Requests this realizer to paint itself on the given graphics context under the constraint that the given layer is active.
 void paintLayerSloppy(java.awt.Graphics2D gfx, byte layer)
          Paints the realizer in a cheap, uniform and sloppy way on g.
protected  void paintNode(java.awt.Graphics2D gfx)
          Paints the node.
 void paintSloppy(java.awt.Graphics2D g)
          Paints the realizer in a cheap, uniform and sloppy way on g.
 void paintText(java.awt.Graphics2D gfx)
          Paints the labels that belong to this realizer
 int portCount()
          Returns the number of node ports associated to this realizer.
 java.util.Iterator ports()
          Returns a iterator over all node ports associated to this realizer.
 void read(java.io.ObjectInputStream in)
          Deprecated. Use the GraphML format instead.
 int realizerCount()
          Returns the number of realizers maintained by this class.
 void removeLabel(int i)
          Removes the i-th node label from this realizer.
 void removeLabel(NodeLabel nl)
          Remove the given label from this realizer.
 void removePort(int index)
          Removes the i-th node port from this realizer.
 void removePort(NodePort port)
          Removes the specified node port from this realizer.
 void removeRealizer(NodeRealizer r)
          Removed a realizer from the list of realizers maintained by this class.
 void setCenter(double x, double y)
          Sets the center location of this realizer
 void setCenterX(double x)
          Set the x coordinate of the center of the node.
 void setCenterY(double y)
          Set the y coordinate of the center of the node.
 void setEdgesDirty()
          Marks adjacent edge realizers as dirty.
 void setFillColor(java.awt.Color c)
          Sets the fill color for this realizer.
 void setFillColor2(java.awt.Color c)
          Sets the second fill color for this realizer.
 void setFrame(double x, double y, double width, double height)
          Sets the frame of the realizer, i.e. its size and its location.
 void setFrame(java.awt.geom.Rectangle2D frame)
          Sets the frame of the realizer, i.e. its size and its location.
 void setHeight(double height)
          Sets the height of this realizer.
 void setLabel(NodeLabel nl)
          Sets the first label associated with this realizer.
 void setLabelText(java.lang.String label)
          Sets the text of the first label associated with this realizer.
 void setLayer(byte l)
          Sets the logical graphical layer for this realizer.
 void setLayer(byte l, boolean adjacentEdgesAsWell)
          Sets the layer this realizer should be painted on.
 void setLineColor(java.awt.Color c)
          Sets the outline color for this realizer.
 void setLineType(LineType lt)
          Sets the line type for this realizer.
 void setLocation(double x, double y)
          Sets the upper left corner location of this realizer.
 void setRealizer(int i, NodeRealizer nr)
          Sets the i-th realizer in the list of realizers maintained by this class.
 void setRealizerDelegate(NodeRealizer r)
          Sets the delegation target of this proxy realizer.
 void setSelected(boolean s)
          Sets the selection state of this realizer.
 void setShapeType(byte type)
          Sets the shape type of this realizer.
 void setSize(double width, double height)
          Sets the size of the realizer.
 void setTransparent(boolean b)
          Sets the transparency of the realizer.
 void setVisible(boolean b)
          Sets the visibility state of this realizer.
 void setWidth(double width)
          Sets the width of this realizer.
 void setX(double xp)
          Sets the X-Coordinate of the upper left corner of the node.
 void setY(double yp)
          Sets the Y-Coordinate of the upper left corner of the node.
 void write(java.io.ObjectOutputStream out)
          Deprecated. Use the GraphML format instead.
 
Methods inherited from class y.view.ShapeNodeRealizer
createSelectionColor, getDropShadowColor, getDropShadowOffsetX, getDropShadowOffsetY, isDropShadowVisible, isRaisedBorderEnabled, paint3DBorder, paintFilledShape, paintShadow, paintShapeBorder, setDropShadowColor, setDropShadowOffsetX, setDropShadowOffsetY, setRaisedBorderEnabled, shapeTypeToStringMap
 
Methods inherited from class y.view.NodeRealizer
boundsChanged, calcUnionRectImpl, calcUnionRectLabels, calcUnionRectPorts, createCopy, getAutoBoundsFeature, getHotSpotColor, getNode, getSizeConstraintProvider, getSloppySelectionColor, labelBoundsChanged, paintPorts, repaint, setHotSpotColor, setSloppySelectionColor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyShapeNodeRealizer

public ProxyShapeNodeRealizer()
Creates instance of ProxyShapeNodeRealizer.


ProxyShapeNodeRealizer

public ProxyShapeNodeRealizer(NodeRealizer argNodeRealizer)
Create instance of NodeRealizer and initialize it according to a given NodeRealizer.

Parameters:
argNodeRealizer - A NodeRealizer
Method Detail

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.

addRealizer

public void addRealizer(NodeRealizer r)
Adds a realizer to the list of realizers maintained by this class.


removeRealizer

public void removeRealizer(NodeRealizer r)
Removed a realizer from the list of realizers maintained by this class.


realizerCount

public int realizerCount()
Returns the number of realizers maintained by this class.


getRealizer

public NodeRealizer getRealizer(int i)
Returns the i-th realizer from the list of realizers maintained by this class.


setRealizer

public void setRealizer(int i,
                        NodeRealizer nr)
Sets the i-th realizer in the list of realizers maintained by this class.


getRealizerDelegate

public NodeRealizer getRealizerDelegate()
Returns the delegation target of this proxy realizer.


setRealizerDelegate

public void setRealizerDelegate(NodeRealizer r)
Sets the delegation target of this proxy realizer.


setFillColor

public void setFillColor(java.awt.Color c)
Description copied from class: NodeRealizer
Sets the fill color for this realizer.

Overrides:
setFillColor in class NodeRealizer

getFillColor

public java.awt.Color getFillColor()
Description copied from class: NodeRealizer
Returns the fill color of this realizer.

Overrides:
getFillColor in class NodeRealizer

setFillColor2

public void setFillColor2(java.awt.Color c)
Description copied from class: NodeRealizer
Sets the second fill color for this realizer. If a second fill color is set, then the realizer will be filled with a gradient paint from fillColor to fillColor2. By default this color is not set, i.e. it is null.

Overrides:
setFillColor2 in class NodeRealizer

getFillColor2

public java.awt.Color getFillColor2()
Description copied from class: NodeRealizer
Returns the fill color of this realizer.

Overrides:
getFillColor2 in class NodeRealizer

setLineColor

public void setLineColor(java.awt.Color c)
Description copied from class: NodeRealizer
Sets the outline color for this realizer.

Overrides:
setLineColor in class NodeRealizer

getLineColor

public java.awt.Color getLineColor()
Description copied from class: NodeRealizer
Returns the outline color of this realizer.

Overrides:
getLineColor in class NodeRealizer

setLineType

public void setLineType(LineType lt)
Description copied from class: NodeRealizer
Sets the line type for this realizer.

Overrides:
setLineType in class NodeRealizer

getLineType

public LineType getLineType()
Description copied from class: NodeRealizer
Returns the line type of this realizer.

Overrides:
getLineType in class NodeRealizer

setTransparent

public void setTransparent(boolean b)
Description copied from class: NodeRealizer
Sets the transparency of the realizer. Here transparency means that the node is not filled with a color.

Overrides:
setTransparent in class NodeRealizer

isTransparent

public boolean isTransparent()
Description copied from class: NodeRealizer
Returns the transparency state of this realizer.

Overrides:
isTransparent in class NodeRealizer

setShapeType

public void setShapeType(byte type)
Description copied from class: ShapeNodeRealizer
Sets the shape type of this realizer.

Overrides:
setShapeType in class ShapeNodeRealizer
Parameters:
type - one of

getShapeType

public byte getShapeType()
Description copied from class: ShapeNodeRealizer
Returns shape type of this realizer

Overrides:
getShapeType in class ShapeNodeRealizer
See Also:
ShapeNodeRealizer.setShapeType(byte)

setLabelText

public void setLabelText(java.lang.String label)
Description copied from class: NodeRealizer
Sets the text of the first label associated with this realizer.

Overrides:
setLabelText in class NodeRealizer
Parameters:
label - the text of the label

getLabelText

public java.lang.String getLabelText()
Description copied from class: NodeRealizer
Returns the text of the first label associated with this realizer.

Overrides:
getLabelText in class NodeRealizer

createNodeLabel

public NodeLabel createNodeLabel()
Description copied from class: NodeRealizer
Creates a new node label that can be added to this realizer.

Overrides:
createNodeLabel in class NodeRealizer

setLabel

public void setLabel(NodeLabel nl)
Description copied from class: NodeRealizer
Sets the first label associated with this realizer.

Overrides:
setLabel in class NodeRealizer

addLabel

public void addLabel(NodeLabel nl)
Description copied from class: NodeRealizer
Add the given label to this realizer. By default a node realizer is associated with one label. By calling this method more labels can be added to the realizer.

Overrides:
addLabel in class NodeRealizer

removeLabel

public void removeLabel(NodeLabel nl)
Description copied from class: NodeRealizer
Remove the given label from this realizer. Removing a label is only permitted if it is not the last label associated with this realizer.

Overrides:
removeLabel in class NodeRealizer
Parameters:
nl - the node label to remove from this realizer,
See Also:
NodeRealizer.removeLabel(int)

removeLabel

public void removeLabel(int i)
Description copied from class: NodeRealizer
Removes the i-th node label from this realizer.

Overrides:
removeLabel in class NodeRealizer
Parameters:
i - the index of the node label to remove.
See Also:
NodeRealizer.removeLabel(NodeLabel)

getLabel

public NodeLabel getLabel()
Description copied from class: NodeRealizer
Returns the first label associated with this realizer. If no label is associated with this realizer, a default label will be created, added to the realizer, and returned.

Overrides:
getLabel in class NodeRealizer
Returns:
the first node label of this realizer

getLabel

public NodeLabel getLabel(int i)
Description copied from class: NodeRealizer
Returns the i-th label associated with this realizer.

Overrides:
getLabel in class NodeRealizer

labelCount

public int labelCount()
Description copied from class: NodeRealizer
Returns the number of labels associated with this realizer.

Overrides:
labelCount in class NodeRealizer

addPort

public void addPort(NodePort port)
Description copied from class: NodeRealizer
Adds and binds the specified node port to this realizer. Calls NodePort.bindRealizer(NodeRealizer).

Overrides:
addPort in class NodeRealizer
Parameters:
port - the node port to add.

removePort

public void removePort(int index)
Description copied from class: NodeRealizer
Removes the i-th node port from this realizer. Use NodePort.remove(NodePort) to remove a node port and the edges connected to as well as the node labels associated with the node port.

Overrides:
removePort in class NodeRealizer
Parameters:
index - the index of the node port to remove.
See Also:
NodePort.remove(NodePort), PortLabelModel.findLabels(NodePort), NodePort.edges()

removePort

public void removePort(NodePort port)
Description copied from class: NodeRealizer
Removes the specified node port from this realizer. Use NodePort.remove(NodePort) to remove a node port and the edges connected to as well as the node labels associated with the node port.

Overrides:
removePort in class NodeRealizer
Parameters:
port - the node port to remove.
See Also:
NodePort.remove(NodePort), PortLabelModel.findLabels(NodePort), NodePort.edges()

getPort

public NodePort getPort(int index)
Description copied from class: NodeRealizer
Returns the i-th node port that is associated to this realizer.

Overrides:
getPort in class NodeRealizer
Parameters:
index - the index of the node port to return.
Returns:
the i-th node port that is associated to this realizer.

portCount

public int portCount()
Description copied from class: NodeRealizer
Returns the number of node ports associated to this realizer.

Overrides:
portCount in class NodeRealizer
Returns:
the number of node ports associated to this realizer.

ports

public java.util.Iterator ports()
Description copied from class: NodeRealizer
Returns a iterator over all node ports associated to this realizer.

Note: The iterator should be used read-only!

Returns:
a iterator over all node ports associated to this realizer.

invalidatePortPositions

protected void invalidatePortPositions()
Description copied from class: NodeRealizer
Invalidates the positions of all associated NodePorts. The position of each associated node port as well as source/target point of all edges connecting to each associated node port have to be recalculated.

Overrides:
invalidatePortPositions in class NodeRealizer

getCenterX

public double getCenterX()
Description copied from class: NodeRealizer
Get X-Coordinate of the center of the node.

Overrides:
getCenterX in class NodeRealizer
See Also:
NodeRealizer.getX()

getCenterY

public double getCenterY()
Description copied from class: NodeRealizer
Get Y-Coordinate of the center of the node.

Overrides:
getCenterY in class NodeRealizer
See Also:
NodeRealizer.getY()

setCenter

public void setCenter(double x,
                      double y)
Description copied from class: ShapeNodeRealizer
Sets the center location of this realizer

Overrides:
setCenter in class ShapeNodeRealizer
See Also:
NodeRealizer.setLocation(double, double)

setCenterX

public void setCenterX(double x)
Description copied from class: NodeRealizer
Set the x coordinate of the center of the node.

Overrides:
setCenterX in class NodeRealizer
See Also:
NodeRealizer.setX(double)

setCenterY

public void setCenterY(double y)
Description copied from class: NodeRealizer
Set the y coordinate of the center of the node.

Overrides:
setCenterY in class NodeRealizer
See Also:
NodeRealizer.setY(double)

getX

public double getX()
Description copied from class: NodeRealizer
Get X-Coordinate of the upper left corner of the node.

Specified by:
getX in interface NodeLayout
Overrides:
getX in class NodeRealizer
Returns:
the x-coordinate of the node
See Also:
NodeRealizer.getCenterX()

getY

public double getY()
Description copied from class: NodeRealizer
Get Y-Coordinate of the upper left corner of the node.

Specified by:
getY in interface NodeLayout
Overrides:
getY in class NodeRealizer
Returns:
the y-coordinate of the node
See Also:
NodeRealizer.getCenterY()

setLocation

public void setLocation(double x,
                        double y)
Description copied from class: ShapeNodeRealizer
Sets the upper left corner location of this realizer.

Specified by:
setLocation in interface NodeLayout
Overrides:
setLocation in class ShapeNodeRealizer
Parameters:
x - the x-coordinates of the upper left corner.
y - the y-coordinates of the upper left corner.
See Also:
NodeRealizer.setCenter(double, double)

setX

public void setX(double xp)
Description copied from class: NodeRealizer
Sets the X-Coordinate of the upper left corner of the node.

Overrides:
setX in class NodeRealizer
See Also:
NodeRealizer.setCenterX(double)

setY

public void setY(double yp)
Description copied from class: NodeRealizer
Sets the Y-Coordinate of the upper left corner of the node.

Overrides:
setY in class NodeRealizer
See Also:
NodeRealizer.setCenterY(double)

moveBy

public void moveBy(double dx,
                   double dy)
Description copied from class: ShapeNodeRealizer
Moves this realizer by the vector (dx,dy).

Overrides:
moveBy in class ShapeNodeRealizer

getWidth

public double getWidth()
Description copied from class: NodeRealizer
Returns the width of this realizer.

Specified by:
getWidth in interface NodeLayout
Overrides:
getWidth in class NodeRealizer
Returns:
the width of the node

getHeight

public double getHeight()
Description copied from class: NodeRealizer
Returns the height of this realizer.

Specified by:
getHeight in interface NodeLayout
Overrides:
getHeight in class NodeRealizer
Returns:
the height of the node

setFrame

public void setFrame(double x,
                     double y,
                     double width,
                     double height)
Description copied from class: NodeRealizer
Sets the frame of the realizer, i.e. its size and its location.

Overrides:
setFrame in class NodeRealizer

setFrame

public void setFrame(java.awt.geom.Rectangle2D frame)
Description copied from class: NodeRealizer
Sets the frame of the realizer, i.e. its size and its location.

Overrides:
setFrame in class NodeRealizer

setSize

public void setSize(double width,
                    double height)
Description copied from class: ShapeNodeRealizer
Sets the size of the realizer. Note that this method resizes the node in a way that the center location of this realizer won't change. The upper left corner of this realizer *will* change though.

Specified by:
setSize in interface NodeLayout
Overrides:
setSize in class ShapeNodeRealizer
Parameters:
width - the new width of the node
height - the new height of the node

setWidth

public void setWidth(double width)
Description copied from class: NodeRealizer
Sets the width of this realizer. This method delegates to NodeRealizer.setSize(double, double).

Overrides:
setWidth in class NodeRealizer

setHeight

public void setHeight(double height)
Description copied from class: NodeRealizer
Sets the height of this realizer. This method delegates to NodeRealizer.setSize(double,double).

Overrides:
setHeight in class NodeRealizer

setVisible

public void setVisible(boolean b)
Description copied from class: NodeRealizer
Sets the visibility state of this realizer. By default a realizer is visible.

Overrides:
setVisible in class NodeRealizer

isVisible

public boolean isVisible()
Description copied from class: NodeRealizer
Returns true iff this realizer is marked as visible. Invisible realizers won't paint themselves on a graphics context.

Overrides:
isVisible in class NodeRealizer

setLayer

public void setLayer(byte l)
Description copied from class: NodeRealizer
Sets the logical graphical layer for this realizer. Layer information can be used by viewers to optimize redraws.

Overrides:
setLayer in class NodeRealizer
See Also:
Graph2DView.FG_LAYER, Graph2DView.BG_LAYER

getLayer

public byte getLayer()
Description copied from class: NodeRealizer
Returns the logical graphical layer for this realizer. Layer information can be used by viewers to optimize redraws.

Overrides:
getLayer in class NodeRealizer
See Also:
Graph2DView.FG_LAYER, Graph2DView.BG_LAYER

setLayer

public void setLayer(byte l,
                     boolean adjacentEdgesAsWell)
Description copied from class: NodeRealizer
Sets the layer this realizer should be painted on. The layer of the adjacent edges will be set as well if the second argument has value true.

Overrides:
setLayer in class NodeRealizer

setSelected

public void setSelected(boolean s)
Description copied from class: NodeRealizer
Sets the selection state of this realizer. Selected realizers will paint themselves in a highlighted fashion on a graphics context.

Overrides:
setSelected in class NodeRealizer

isSelected

public boolean isSelected()
Description copied from class: NodeRealizer
Returns the selection state of this realizer.

Overrides:
isSelected in class NodeRealizer

getBoundingBox

public java.awt.geom.Rectangle2D.Double getBoundingBox()
Description copied from class: NodeRealizer
Return the bounding box of this realizer. The bounding box does not necessarily contain the bounding box of the realizer label.

Overrides:
getBoundingBox in class NodeRealizer

hotSpotHit

public byte hotSpotHit(double hx,
                       double hy)
Description copied from class: ShapeNodeRealizer
Adjusted hitSpotHit that takes drop shadows into account.

Overrides:
hotSpotHit in class ShapeNodeRealizer

findBBIntersection

public boolean findBBIntersection(double ix,
                                  double iy,
                                  double ox,
                                  double oy,
                                  java.awt.geom.Point2D result)
Description copied from class: NodeRealizer
Calculates the intersection point of a line segment and this realizer's rectangular bounding box. This method returns true if and only if the coordinates (ix,iy) are identical to (NodeRealizer.getCenterX(),NodeRealizer.getCenterY()) and the coordinates (ox,oy) lie outside this realizer's rectangular bounding box. In this case, the absolute coordinates of the intersection point of line segment (ix,iy) - (ox,oy) and this realizer's rectangular bounding box are stored in the given Point2D instance.

Overrides:
findBBIntersection in class NodeRealizer
Parameters:
ix - the x-coordinate of a point inside the realizer's rectangular bounding box. Must equal NodeRealizer.getCenterX().
iy - the y-coordinate of a point inside the realizer's rectangular bounding box. Must equal NodeRealizer.getCenterY().
ox - the x-coordinate of a point outside the realizer's rectangular bounding box.
oy - the y-coordinate of a point outside the realizer's rectangular bounding box.
result - output parameter for the absolute world coordinates of the calculated intersection point.
Returns:
true if (ix,iy) is the center of this realizer's rectangular bounding box and (ox,oy) lies outside this realizer's rectangular bounding box; false otherwise.
See Also:
NodeRealizer.findIntersection(double, double, double, double, java.awt.geom.Point2D)

findIntersection

public boolean findIntersection(double ix,
                                double iy,
                                double ox,
                                double oy,
                                java.awt.geom.Point2D result)
Description copied from class: ShapeNodeRealizer
Special Intersection handling for some types of shape. When shape is an ellipse or an rectangle, the intersection point is calculated, not iteratively determined.

Overrides:
findIntersection in class ShapeNodeRealizer
Parameters:
ix - the x-coordinate of a point inside the realizer's visual bounds.
iy - the y-coordinate of a point inside the realizer's visual bounds.
ox - the x-coordinate of a point outside the realizer's visual bounds.
oy - the y-coordinate of a point outside the realizer's visual bounds.
result - output parameter for the absolute world coordinates of the calculated intersection point.
Returns:
true if (ix,iy) lies inside and (ox,oy) lies outside this realizer's visual bounds; false otherwise.
See Also:
NodeRealizer.contains(double, double)

calcUnionRect

public void calcUnionRect(java.awt.geom.Rectangle2D r,
                          byte layer)
Description copied from class: NodeRealizer
Enlarges the given rectangle such that it will contain the bounding box of this realizer and the bounding box of the realizer label. The given layer indicates for which graphics layer clipping information is collected by doing this call.

Overrides:
calcUnionRect in class NodeRealizer

calcUnionRect

public void calcUnionRect(java.awt.geom.Rectangle2D r)
Description copied from class: ShapeNodeRealizer
Enlarges the given rectangle such that it will contain the bounding box of this realizer and the bounding box of the realizer label and its drop shadow.

Overrides:
calcUnionRect in class ShapeNodeRealizer

intersects

public boolean intersects(double rx,
                          double ry,
                          double rw,
                          double rh)
Description copied from class: NodeRealizer
Determines whether or not the bounding box of this realizer intersects the specified rectangle.

Overrides:
intersects in class NodeRealizer
Parameters:
rx - the smallest x-coordinate of the rectangle to check.
ry - the smallest y-coordinate of the rectangle to check.
rw - the width of the rectangle to check.
rh - the height of the rectangle to check.
Returns:
true if the bounding box of this realizer intersects the specified rectangle; false otherwise.

contains

public boolean contains(double x,
                        double y)
Description copied from class: ShapeNodeRealizer
Evaluate hit test on the node realizer. When a node is transparent, only its boundary is evaluated for the hit test.

Overrides:
contains in class ShapeNodeRealizer
Parameters:
x - the x-coordinate of the point to check.
y - the y-coordinate of the point to check.
Returns:
true if the position (x,y) is part of the node false otherwise.

isInBox

public boolean isInBox(double xb,
                       double yb,
                       double wb,
                       double hb)
Description copied from class: NodeRealizer
Determines whether or not the center of this realizer lies within the specified rectangle.

Overrides:
isInBox in class NodeRealizer
Parameters:
xb - the smallest x-coordinate of the rectangle to check.
yb - the smallest y-coordinate of the rectangle to check.
wb - the width of the rectangle to check.
hb - the height of the rectangle to check.
Returns:
true if the center of this realizer lies within the specified rectangle; false otherwise.

getPortCandidates

public YList getPortCandidates(double gridResolution)
Description copied from class: NodeRealizer
Returns a list of YPoints that contains absolute(!) coordinates of port candidate locations that are suitable for the given grid resolution.

Overrides:
getPortCandidates in class NodeRealizer
Parameters:
gridResolution - the distance between two grid points, the origin of the grid is at (0,0) in world coordinates
Returns:
a YList of YPoint instances, each specifying an absolute port position

getMouseInputEditorProvider

public MouseInputEditorProvider getMouseInputEditorProvider()
Returns a provider, that can be used to query for a mouse input editor for this realizer. This implementation delegates this call to its current realizer delegate, if there is one. Otherwise null is returned.

Overrides:
getMouseInputEditorProvider in class NodeRealizer
Returns:
an implementation of interface MouseInputEditorProvider or null, if no such provider is bound to this realizer.

paintNode

protected void paintNode(java.awt.Graphics2D gfx)
Description copied from class: ShapeNodeRealizer
Paints the node. Internally, painting is performed by calling the following protected methods in the given order:
  1. ShapeNodeRealizer.paintHotSpots(Graphics2D) (only when selected)
  2. ShapeNodeRealizer.paintShadow(Graphics2D)
  3. ShapeNodeRealizer.paintFilledShape(Graphics2D)
  4. NodeRealizer.paintPorts(Graphics2D)
  5. NodeRealizer.paintText(Graphics2D)
  6. ShapeNodeRealizer.paintShapeBorder(Graphics2D)
If raised border painting is disabled, ShapeNodeRealizer.paintShapeBorder(Graphics2D) is called before NodeRealizer.paintPorts(Graphics2D) instead of after NodeRealizer.paintText(Graphics2D).

Overrides:
paintNode in class ShapeNodeRealizer

paintHotSpots

public void paintHotSpots(java.awt.Graphics2D gfx)
Description copied from class: NodeRealizer
Paints graphical hotspots around this realizer. The hotspots mark regions on which hit tests can be performed.

Overrides:
paintHotSpots in class ShapeNodeRealizer

paintLayer

public void paintLayer(java.awt.Graphics2D gfx,
                       byte layer)
Description copied from class: NodeRealizer
Requests this realizer to paint itself on the given graphics context under the constraint that the given layer is active. By default this method will do nothing if the given layer does not match the layer of this realizer. Otherwise the regular paint method will be invoked.

Overrides:
paintLayer in class NodeRealizer

paintLayerSloppy

public void paintLayerSloppy(java.awt.Graphics2D gfx,
                             byte layer)
Description copied from class: NodeRealizer
Paints the realizer in a cheap, uniform and sloppy way on g. The given layer indicates what kind of layer objects should be painted. By default this method does nothing if layer != this.getLayer(). Otherwise paintSloppy gets called.

Overrides:
paintLayerSloppy in class NodeRealizer

paintSloppy

public void paintSloppy(java.awt.Graphics2D g)
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

paint

public void paint(java.awt.Graphics2D gfx)
Description copied from class: NodeRealizer
Paints this realizer and its label(s) on the given graphics context. this method will do nothing if the realizer is marked as invisible.

Overrides:
paint in class NodeRealizer

paintText

public void paintText(java.awt.Graphics2D gfx)
Description copied from class: NodeRealizer
Paints the labels that belong to this realizer

Overrides:
paintText in class NodeRealizer

setEdgesDirty

public void setEdgesDirty()
Description copied from class: NodeRealizer
Marks adjacent edge realizers as dirty. Dirty realizers will definitely recalculate their features before painting themselves.

Overrides:
setEdgesDirty in class NodeRealizer

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.

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-2019,
yWorks GmbH.
All rights reserved.