|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.pzgui.AbstractDrawable
org.pzgui.layout.AbstractLayoutable
org.openflow.gui.drawables.Node
public abstract class Node
Information about a node in the topology.
| Field Summary | |
|---|---|
static double |
OUTLINE_RATIO
ratio to use when outlining the shape |
static boolean |
SHOW_NAMES
whether to draw names on nodes |
| Constructor Summary | |
|---|---|
Node(java.lang.String name,
int x,
int y,
Icon icon)
|
|
| Method Summary | |
|---|---|
boolean |
contains(int x,
int y)
returns true if the area described by getIcon() contains x, y |
protected void |
drawFailed(java.awt.Graphics2D gfx)
draw an "X" over the node to indicate failure |
protected void |
drawName(java.awt.Graphics2D gfx,
int x,
int y)
draws the name of the object centered at the specified x coordinate |
void |
drawObject(java.awt.Graphics2D gfx)
Draws this object using the Icon specified by getIcon() at its current location as specified by getX() and getY(). |
void |
drawOutline(java.awt.Graphics2D gfx,
java.awt.Paint outlineColor,
double ratio)
Draw an outline around the object. |
abstract java.lang.String |
getDebugName()
gets a debug version of the node's name |
int |
getHeight()
The height of this node |
Icon |
getIcon()
get how this node is visually represented |
java.lang.String |
getName()
gets the name of the node |
int |
getWidth()
The width of this node |
boolean |
isFailed()
|
boolean |
isOff()
|
protected boolean |
isWithin(int x,
int y,
java.awt.Dimension sz)
Returns true if the object of size sz contains the location x, y |
void |
setFailed(boolean b)
|
void |
setIcon(Icon icon)
set how this node is visually represented |
void |
setName(java.lang.String name)
sets the node's name |
void |
setOff(boolean b)
|
java.lang.String |
toString()
returns the name of the node |
| Methods inherited from class org.pzgui.layout.AbstractLayoutable |
|---|
canPositionChange, drag, getPos, getX, getY, hasPositionChanged, setCanPositionChange, setPos, setXPos, setYPos, unsetPositionChanged |
| Methods inherited from class org.pzgui.AbstractDrawable |
|---|
drawBeforeObject, isDrawn, isHovered, isSelected, setHovered, setSelected, unsetDrawn |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.pzgui.layout.Vertex |
|---|
getEdges |
| Methods inherited from interface org.pzgui.Drawable |
|---|
drag, drawBeforeObject, isDrawn, isHovered, isSelected, setHovered, setSelected, unsetDrawn |
| Methods inherited from interface org.pzgui.layout.Layoutable |
|---|
canPositionChange, getID, getPos, getX, getY, hasPositionChanged, setCanPositionChange, setPos, setXPos, setYPos, unsetPositionChanged |
| Field Detail |
|---|
public static boolean SHOW_NAMES
public static final double OUTLINE_RATIO
| Constructor Detail |
|---|
public Node(java.lang.String name,
int x,
int y,
Icon icon)
| Method Detail |
|---|
public java.lang.String getName()
public abstract java.lang.String getDebugName()
public void setName(java.lang.String name)
protected final void drawName(java.awt.Graphics2D gfx,
int x,
int y)
public void drawObject(java.awt.Graphics2D gfx)
drawObject in interface DrawabledrawObject in class AbstractDrawableprotected void drawFailed(java.awt.Graphics2D gfx)
public void drawOutline(java.awt.Graphics2D gfx,
java.awt.Paint outlineColor,
double ratio)
gfx - where to drawoutlineColor - color of the outlineratio - how big to make the outlinepublic Icon getIcon()
public void setIcon(Icon icon)
public boolean isOff()
public void setOff(boolean b)
public boolean isFailed()
public void setFailed(boolean b)
public int getHeight()
getHeight in interface Layoutablepublic int getWidth()
getWidth in interface Layoutable
protected boolean isWithin(int x,
int y,
java.awt.Dimension sz)
public boolean contains(int x,
int y)
contains in interface Drawablecontains in class AbstractLayoutablepublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||