|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.colorado.cs.ns2.graphics.RectDrawable
public class RectDrawable
This class represents Nodes as drawn on the Screen.
Field Summary | |
---|---|
private int |
HEIGHT
The default shape height. |
private int |
myHeight
The shape's height. |
private int |
myWidth
The shape's width. |
private int |
myX
The shape's X-coordainte. |
private int |
myY
The shape's Y-coordinate. |
private boolean |
selected
True if this node is selected with the mouse. |
private static long |
serialVersionUID
Generated version UID. |
private NsNode |
theNode
A reference to the NS2 node that this shape represents graphically. |
private int |
WIDTH
The default shape width. |
Constructor Summary | |
---|---|
RectDrawable(int x,
int y,
NsNode node)
Default constructor. |
Method Summary | |
---|---|
void |
drawSelf(java.awt.Graphics g,
boolean clear)
Draws a Node on the Screen |
NsNode |
getNsNode()
Get the NsNode Simulation object associated with this Node. |
java.awt.Point |
getPoint()
Get Point Representing the co-ordinates of the location of the Node. |
boolean |
isSelected()
Checks if the current Node is selected. |
void |
move(int dX,
int dY)
Changes the coodinates of the location of Node. |
void |
setSelected()
Sets the selected flag on the Node. |
void |
setUnSelected()
Resets the selected flag on the Node. |
boolean |
within(int X,
int Y)
Checks to see if (X,Y) lies within the shape. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private int myX
private int myY
private int myWidth
private int myHeight
private NsNode theNode
private boolean selected
private final int WIDTH
private final int HEIGHT
Constructor Detail |
---|
public RectDrawable(int x, int y, NsNode node)
x
- The x-coordinate of the shape.y
- The y-coordinate of the shape.node
- The NS2 node that this shape represents graphically.Method Detail |
---|
public void drawSelf(java.awt.Graphics g, boolean clear)
drawSelf
in interface Drawable
g
- Graphics Objectclear
- set it to false to erase the Node.Drawable.drawSelf(java.awt.Graphics, boolean)
public void setSelected()
public void setUnSelected()
public boolean isSelected()
public void move(int dX, int dY)
move
in interface Drawable
dX
- change in x-coordinate.dY
- change in y-coordinate.Drawable.move(int, int)
public boolean within(int X, int Y)
within
in interface Drawable
X
- x-coordinate.Y
- y-coordinate.
Drawable.within(int, int)
public java.awt.Point getPoint()
public NsNode getNsNode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |