|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuchicago.src.sim.gui.DrawableItem
public abstract class DrawableItem
Abstract class for objects inhabiting non-discrete spaces and that wish to be drawn by a Display. This is particularly useful for nodes. Provides methods for setting the color, label, border size and label, and font of the item. All size variables are in screen coordinates.
OvalNode,
RectNode| Field Summary | |
|---|---|
protected boolean |
allowResizing
|
protected java.awt.Color |
borderColor
|
protected int |
borderWidth
|
protected java.awt.Color |
color
|
protected java.awt.Font |
font
|
protected int |
height
|
protected boolean |
hollow
|
protected java.lang.String |
label
|
protected java.awt.Color |
labelColor
|
protected boolean |
recalc
|
protected java.awt.BasicStroke |
stroke
|
protected int |
width
|
| Constructor Summary | |
|---|---|
DrawableItem()
|
|
| Method Summary | |
|---|---|
void |
allowResizing(boolean val)
Should this DrawableItem be resized to so that entire label is visible. |
void |
calcSize(SimGraphics g)
Calculates and sets the size of this DrawableItem insuring that the entire label can be seen, if allowResizing is true. |
java.awt.Color |
getBorderColor()
Returns the current border color. |
int |
getBorderWidth()
Returns the current border width. |
java.awt.Color |
getColor()
Returns the current color. |
java.awt.Font |
getFont()
Returns the current label font. |
int |
getHeight()
Gets the height of this DrawableItem. |
java.awt.Color |
getLabelColor()
Returns the current label color. |
int |
getWidth()
Gets the width of this DrawableItem. |
boolean |
isHollow()
|
void |
setBorderColor(java.awt.Color c)
Sets the border color for this DrawableItem. |
void |
setBorderWidth(int width)
Sets the border width for this DrawableItem. |
void |
setColor(java.awt.Color c)
Sets the color for this DrawableItem. |
void |
setFont(java.awt.Font font)
Sets the font for the label |
void |
setHeight(int h)
Sets the height of this DrawableItem in screen coordinates. |
void |
setHollow(boolean hollow)
|
void |
setLabel(java.lang.String l)
Sets the label. |
void |
setLabelColor(java.awt.Color c)
Sets the label color. |
void |
setSize(java.awt.Dimension size)
Sets the size of this DrawableItem in screen coordinates. |
void |
setSize(int w,
int h)
Sets the size of this DrawableItem in screen coordinates. |
void |
setWidth(int w)
Sets the width of this DrawableItem in screen coordinates. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface uchicago.src.sim.gui.NonGridDrawable |
|---|
contains, draw, getX, getY |
| Field Detail |
|---|
protected java.lang.String label
protected java.awt.Font font
protected java.awt.Color labelColor
protected java.awt.Color color
protected java.awt.Color borderColor
protected int borderWidth
protected int width
protected int height
protected boolean recalc
protected boolean allowResizing
protected boolean hollow
protected java.awt.BasicStroke stroke
| Constructor Detail |
|---|
public DrawableItem()
| Method Detail |
|---|
public void allowResizing(boolean val)
val - true if this should allow resizing for label fit, otherwise
falsepublic void setLabel(java.lang.String l)
l - the new labelpublic void setLabelColor(java.awt.Color c)
c - the new label colorpublic java.awt.Color getLabelColor()
public void setFont(java.awt.Font font)
font - the new label fontpublic java.awt.Font getFont()
public void setColor(java.awt.Color c)
c - the new colorpublic java.awt.Color getColor()
public void setBorderColor(java.awt.Color c)
c - the new border colorpublic java.awt.Color getBorderColor()
public void setBorderWidth(int width)
width - the new border widthpublic int getBorderWidth()
public void setWidth(int w)
w - the new widthpublic void setHeight(int h)
h - the new height
public void setSize(int w,
int h)
w - the new widthh - the new heightpublic void setSize(java.awt.Dimension size)
size - the new sizepublic int getWidth()
getWidth in interface NonGridDrawablepublic int getHeight()
getHeight in interface NonGridDrawablepublic boolean isHollow()
public void setHollow(boolean hollow)
public void calcSize(SimGraphics g)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||