|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.horstmann.violet.framework.AbstractNode
com.horstmann.violet.PointNode
public class PointNode
An inivisible node that is used in the toolbar to draw an edge, and in notes to serve as an end point of the node connector.
Field Summary |
---|
Fields inherited from class com.horstmann.violet.framework.AbstractNode |
---|
SHADOW_GAP |
Constructor Summary | |
---|---|
PointNode()
Constructs a point node with coordinates (0, 0) |
Method Summary | |
---|---|
boolean |
contains(java.awt.geom.Point2D p)
Tests whether the node contains a point. |
void |
draw(java.awt.Graphics2D g2)
Draw the node. |
java.awt.geom.Rectangle2D |
getBounds()
Get the bounding rectangle of the shape of this node |
java.awt.geom.Point2D |
getConnectionPoint(Direction d)
Get the best connection point to connect this node with another node. |
void |
translate(double dx,
double dy)
Translates the node by a given amount |
Methods inherited from class com.horstmann.violet.framework.AbstractNode |
---|
addChild, addChild, addEdge, addNode, clone, getChildren, getParent, getShape, layout, removeChild, removeEdge, removeNode, setParent, setPersistenceDelegate |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PointNode()
Method Detail |
---|
public void draw(java.awt.Graphics2D g2)
Node
draw
in interface Node
draw
in class AbstractNode
g2
- the graphics contextpublic void translate(double dx, double dy)
Node
translate
in interface Node
translate
in class AbstractNode
dx
- the amount to translate in the x-directiondy
- the amount to translate in the y-directionpublic boolean contains(java.awt.geom.Point2D p)
Node
p
- the point to test
public java.awt.geom.Rectangle2D getBounds()
Node
public java.awt.geom.Point2D getConnectionPoint(Direction d)
Node
d
- the direction from the center
of the bounding rectangle towards the boundary
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |