|
||||||||||
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.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. |
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 assiciated 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. |
YList |
getPortCandidates(double gridResolution)
Returns a list of YPoint 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 realizier |
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)
Returns one of the predefined hotspot type constants to signal which hotspot is hit by the given coords. |
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 transparancy 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.ShapeNodeRealizer |
shapeTypeToStringMap |
Methods inherited from class y.view.NodeRealizer |
createCopy, getHotSpotColor, getNode, getSloppySelectionColor, 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 NodeRealizerMethod Detail |
public NodeRealizer createCopy(NodeRealizer nr)
ShapeNodeRealizer
createCopy
in class ShapeNodeRealizer
public 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 NodeRealizer
public Color getFillColor()
NodeRealizer
getFillColor
in class NodeRealizer
public void setFillColor2(Color c)
NodeRealizer
null
.
setFillColor2
in class NodeRealizer
public Color getFillColor2()
NodeRealizer
getFillColor2
in class NodeRealizer
public void setLineColor(Color c)
NodeRealizer
setLineColor
in class NodeRealizer
public Color getLineColor()
NodeRealizer
getLineColor
in class NodeRealizer
public void setLineType(LineType lt)
NodeRealizer
setLineType
in class NodeRealizer
public LineType getLineType()
NodeRealizer
getLineType
in class NodeRealizer
public void setTransparent(boolean b)
NodeRealizer
setTransparent
in class NodeRealizer
public boolean isTransparent()
NodeRealizer
isTransparent
in class NodeRealizer
public void setShapeType(byte type)
ShapeNodeRealizer
ShapeNodeRealizer.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 ShapeNodeRealizer
public byte getShapeType()
ShapeNodeRealizer
getShapeType
in class ShapeNodeRealizer
ShapeNodeRealizer.setShapeType(byte)
public void setLabelText(String label)
NodeRealizer
setLabelText
in class NodeRealizer
label
- the text of the labelpublic String getLabelText()
NodeRealizer
getLabelText
in class NodeRealizer
public NodeLabel createNodeLabel()
NodeRealizer
createNodeLabel
in class NodeRealizer
public void setLabel(NodeLabel nl)
NodeRealizer
setLabel
in class NodeRealizer
public void addLabel(NodeLabel nl)
NodeRealizer
addLabel
in class NodeRealizer
public void removeLabel(NodeLabel nl)
NodeRealizer
removeLabel
in class NodeRealizer
public NodeLabel getLabel()
NodeRealizer
getLabel
in class NodeRealizer
public NodeLabel getLabel(int i)
NodeRealizer
getLabel
in class NodeRealizer
public int labelCount()
NodeRealizer
labelCount
in class NodeRealizer
public double getCenterX()
NodeRealizer
getCenterX
in class NodeRealizer
public double getCenterY()
NodeRealizer
getCenterY
in class NodeRealizer
public void setCenter(double x, double y)
ShapeNodeRealizer
setCenter
in class ShapeNodeRealizer
public void setCenterX(double x)
NodeRealizer
setCenterX
in class NodeRealizer
public void setCenterY(double y)
NodeRealizer
setCenterY
in class NodeRealizer
public double getX()
NodeRealizer
getX
in interface NodeLayout
getX
in class NodeRealizer
public double getY()
NodeRealizer
getY
in interface NodeLayout
getY
in class NodeRealizer
public void setLocation(double x, double y)
ShapeNodeRealizer
setLocation
in interface NodeLayout
setLocation
in class ShapeNodeRealizer
x
- 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 NodeRealizer
public void setY(double yp)
NodeRealizer
setY
in class NodeRealizer
public void moveBy(double dx, double dy)
ShapeNodeRealizer
moveBy
in class ShapeNodeRealizer
public double getWidth()
NodeRealizer
getWidth
in interface NodeLayout
getWidth
in class NodeRealizer
public double getHeight()
NodeRealizer
getHeight
in interface NodeLayout
getHeight
in class NodeRealizer
public void setFrame(double x, double y, double width, double height)
NodeRealizer
setFrame
in class NodeRealizer
public void setFrame(Rectangle2D frame)
NodeRealizer
setFrame
in class NodeRealizer
public void setSize(double width, double height)
ShapeNodeRealizer
setSize
in interface NodeLayout
setSize
in class ShapeNodeRealizer
width
- the width of the node.height
- the heigth of the node.public void setWidth(double width)
NodeRealizer
NodeRealizer.setSize(double, double)
.
setWidth
in class NodeRealizer
public void setHeight(double height)
NodeRealizer
NodeRealizer.setSize(double,double)
.
setHeight
in class NodeRealizer
public void setVisible(boolean b)
NodeRealizer
setVisible
in class NodeRealizer
public boolean isVisible()
NodeRealizer
true
iff this realizer is marked as visible.
Invisible realizers won't paint themselves on a graphics context.
isVisible
in class NodeRealizer
public void setLayer(byte l)
NodeRealizer
setLayer
in class NodeRealizer
Graph2DView.FG_LAYER
,
Graph2DView.BG_LAYER
public byte getLayer()
NodeRealizer
getLayer
in class NodeRealizer
Graph2DView.FG_LAYER
,
Graph2DView.BG_LAYER
public void setLayer(byte l, boolean adjacentEdgesAsWell)
NodeRealizer
true
.
setLayer
in class NodeRealizer
public void setSelected(boolean s)
NodeRealizer
setSelected
in class NodeRealizer
public boolean isSelected()
NodeRealizer
isSelected
in class NodeRealizer
public Rectangle2D.Double getBoundingBox()
NodeRealizer
getBoundingBox
in class NodeRealizer
public byte hotSpotHit(double hx, double hy)
NodeRealizer
hotSpotHit
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 boolean findIntersection(double ix, double iy, double ox, double oy, Point2D result)
ShapeNodeRealizer
findIntersection
in class ShapeNodeRealizer
public void calcUnionRect(Rectangle2D r, byte layer)
NodeRealizer
calcUnionRect
in class NodeRealizer
public void calcUnionRect(Rectangle2D r)
NodeRealizer
calcUnionRect
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 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 boolean isInBox(double xb, double yb, double wb, double hb)
NodeRealizer
true
iff the bounding box of this realizer lies
completely within the given box.
isInBox
in class NodeRealizer
public YList getPortCandidates(double gridResolution)
NodeRealizer
getPortCandidates
in class NodeRealizer
protected void paintNode(Graphics2D gfx)
ShapeNodeRealizer
paintNode
in class ShapeNodeRealizer
public void paintHotSpots(Graphics2D gfx)
NodeRealizer
paintHotSpots
in class NodeRealizer
public void paintLayer(Graphics2D gfx, byte layer)
NodeRealizer
paint
method will be invoked.
paintLayer
in class NodeRealizer
public void paintLayerSloppy(Graphics2D gfx, byte layer)
NodeRealizer
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.
paintLayerSloppy
in class NodeRealizer
public void paintSloppy(Graphics2D g)
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
public void paint(Graphics2D gfx)
NodeRealizer
paint
in class NodeRealizer
public void paintText(Graphics2D gfx)
NodeRealizer
paintText
in class NodeRealizer
public void setEdgesDirty()
NodeRealizer
setEdgesDirty
in class NodeRealizer
public void write(ObjectOutputStream out) throws IOException
write
in class ShapeNodeRealizer
IOException
public void read(ObjectInputStream in) throws IOException, ClassNotFoundException
ProxyShapeNodeRealizer.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 |