|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.view.NodeRealizer
y.view.ShapeNodeRealizer
y.view.ProxyShapeNodeRealizer
public class ProxyShapeNodeRealizer
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.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
| 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 | |
|---|---|
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 |
addRealizer(NodeRealizer r)
Adds a realizer to the list of realizers maintained by this class. |
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 and its drop shadow. |
void |
calcUnionRect(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,
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. |
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. |
Color |
getFillColor()
Returns the fill color of this realizer. |
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. |
String |
getLabelText()
Returns the text of the first label associated with this realizer. |
byte |
getLayer()
Returns the logical graphical layer for this realizer. |
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. |
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)
Returns true iff the bounding box of this realizer
intersects with the given box. |
boolean |
isInBox(double xb,
double yb,
double wb,
double hb)
Returns true iff the bounding box of this realizer lies
completely within the given box. |
boolean |
isSelected()
Returns the selection state of this realizer. |
boolean |
isTransparent()
Returns the transparancy 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(Graphics2D gfx)
Paints this realizer and its label(s) on the given graphics context. |
void |
paintHotSpots(Graphics2D gfx)
Paints graphical hotspots around this realizer. |
void |
paintLayer(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(Graphics2D gfx,
byte layer)
Paints the realizer in a cheap, uniform and sloppy way on g. |
protected void |
paintNode(Graphics2D gfx)
Paints the node. |
void |
paintSloppy(Graphics2D g)
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. |
int |
realizerCount()
Returns the number of realizers maintained by this class. |
void |
removeLabel(NodeLabel nl)
Remove the given label 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(Color c)
Sets the fill color for this realizer. |
void |
setFillColor2(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(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(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(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(ObjectOutputStream out)
Writes this realizer in a serialized form to the given stream. |
| Methods inherited from class y.view.NodeRealizer |
|---|
boundsChanged, createCopy, getAutoBoundsFeature, getHotSpotColor, getNode, getSizeConstraintProvider, getSloppySelectionColor, labelBoundsChanged, repaint, setHotSpotColor, setSloppySelectionColor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProxyShapeNodeRealizer()
public ProxyShapeNodeRealizer(NodeRealizer argNodeRealizer)
argNodeRealizer - A NodeRealizer| Method Detail |
|---|
public NodeRealizer createCopy(NodeRealizer nr)
ShapeNodeRealizer
createCopy in class ShapeNodeRealizerpublic void addRealizer(NodeRealizer r)
public void removeRealizer(NodeRealizer r)
public int realizerCount()
public NodeRealizer getRealizer(int i)
public void setRealizer(int i,
NodeRealizer nr)
public NodeRealizer getRealizerDelegate()
public void setRealizerDelegate(NodeRealizer r)
public void setFillColor(Color c)
NodeRealizer
setFillColor in class NodeRealizerpublic Color getFillColor()
NodeRealizer
getFillColor in class NodeRealizerpublic void setFillColor2(Color c)
NodeRealizernull.
setFillColor2 in class NodeRealizerpublic Color getFillColor2()
NodeRealizer
getFillColor2 in class NodeRealizerpublic void setLineColor(Color c)
NodeRealizer
setLineColor in class NodeRealizerpublic Color getLineColor()
NodeRealizer
getLineColor in class NodeRealizerpublic void setLineType(LineType lt)
NodeRealizer
setLineType in class NodeRealizerpublic LineType getLineType()
NodeRealizer
getLineType in class NodeRealizerpublic void setTransparent(boolean b)
NodeRealizer
setTransparent in class NodeRealizerpublic boolean isTransparent()
NodeRealizer
isTransparent in class NodeRealizerpublic void setShapeType(byte type)
ShapeNodeRealizerShapeNodeRealizer.RECT, ShapeNodeRealizer.ROUND_RECT, ShapeNodeRealizer.ELLIPSE,
ShapeNodeRealizer.PARALLELOGRAM, ShapeNodeRealizer.HEXAGON, ShapeNodeRealizer.TRIANGLE,
ShapeNodeRealizer.RECT_3D, ShapeNodeRealizer.OCTAGON, ShapeNodeRealizer.DIAMOND,
ShapeNodeRealizer.TRAPEZOID, ShapeNodeRealizer.TRAPEZOID_2.
setShapeType in class ShapeNodeRealizerpublic byte getShapeType()
ShapeNodeRealizer
getShapeType in class ShapeNodeRealizerShapeNodeRealizer.setShapeType(byte)public void setLabelText(String label)
NodeRealizer
setLabelText in class NodeRealizerlabel - the text of the labelpublic String getLabelText()
NodeRealizer
getLabelText in class NodeRealizerpublic NodeLabel createNodeLabel()
NodeRealizer
createNodeLabel in class NodeRealizerpublic void setLabel(NodeLabel nl)
NodeRealizer
setLabel in class NodeRealizerpublic void addLabel(NodeLabel nl)
NodeRealizer
addLabel in class NodeRealizerpublic void removeLabel(NodeLabel nl)
NodeRealizer
removeLabel in class NodeRealizerpublic NodeLabel getLabel()
NodeRealizer
getLabel in class NodeRealizerpublic NodeLabel getLabel(int i)
NodeRealizer
getLabel in class NodeRealizerpublic int labelCount()
NodeRealizer
labelCount in class NodeRealizerpublic double getCenterX()
NodeRealizer
getCenterX in class NodeRealizerpublic double getCenterY()
NodeRealizer
getCenterY in class NodeRealizer
public void setCenter(double x,
double y)
ShapeNodeRealizer
setCenter in class ShapeNodeRealizerpublic void setCenterX(double x)
NodeRealizer
setCenterX in class NodeRealizerpublic void setCenterY(double y)
NodeRealizer
setCenterY in class NodeRealizerpublic double getX()
NodeRealizer
getX in interface NodeLayoutgetX in class NodeRealizerpublic double getY()
NodeRealizer
getY in interface NodeLayoutgetY in class NodeRealizer
public void setLocation(double x,
double y)
ShapeNodeRealizer
setLocation in interface NodeLayoutsetLocation in class ShapeNodeRealizerx - the x-coordinates of the upper left corner.y - the y-coordinates of the upper left corner.public void setX(double xp)
NodeRealizer
setX in class NodeRealizerpublic void setY(double yp)
NodeRealizer
setY in class NodeRealizer
public void moveBy(double dx,
double dy)
ShapeNodeRealizer
moveBy in class ShapeNodeRealizerpublic double getWidth()
NodeRealizer
getWidth in interface NodeLayoutgetWidth in class NodeRealizerpublic double getHeight()
NodeRealizer
getHeight in interface NodeLayoutgetHeight in class NodeRealizer
public void setFrame(double x,
double y,
double width,
double height)
NodeRealizer
setFrame in class NodeRealizerpublic void setFrame(Rectangle2D frame)
NodeRealizer
setFrame in class NodeRealizer
public void setSize(double width,
double height)
ShapeNodeRealizer
setSize in interface NodeLayoutsetSize in class ShapeNodeRealizerwidth - the width of the node.height - the height of the node.public void setWidth(double width)
NodeRealizerNodeRealizer.setSize(double, double).
setWidth in class NodeRealizerpublic void setHeight(double height)
NodeRealizerNodeRealizer.setSize(double,double).
setHeight in class NodeRealizerpublic void setVisible(boolean b)
NodeRealizer
setVisible in class NodeRealizerpublic boolean isVisible()
NodeRealizertrue iff this realizer is marked as visible.
Invisible realizers won't paint themselves on a graphics context.
isVisible in class NodeRealizerpublic void setLayer(byte l)
NodeRealizer
setLayer in class NodeRealizerGraph2DView.FG_LAYER,
Graph2DView.BG_LAYERpublic byte getLayer()
NodeRealizer
getLayer in class NodeRealizerGraph2DView.FG_LAYER,
Graph2DView.BG_LAYER
public void setLayer(byte l,
boolean adjacentEdgesAsWell)