|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object becker.robots.icons.Icon becker.robots.icons.CompositeIcon becker.robots.icons.IntersectionIcon
public class IntersectionIcon
An icon to display an intersection.
Nested Class Summary | |
---|---|
static class |
IntersectionIcon.Area
An enumeration to specify the different areas of an IntersectionIcon. |
Field Summary |
---|
Fields inherited from class becker.robots.icons.Icon |
---|
transparent |
Constructor Summary | |
---|---|
IntersectionIcon(Color roadColor,
Color backgroundColor)
Construct a new icon. |
Method Summary | |
---|---|
void |
colorArea(IntersectionIcon.Area area,
Color color)
Change the color of one area of the intersection. |
void |
colorNonRoads(Color c)
Color the areas of this intersection that are not roads. |
void |
colorRoads(Color c)
Color the roads on this intersection. |
Icon |
componentIcon(IntersectionIcon.Area area)
Return a reference to an icon representing one component of the intersection: the center of the intersection, the street entering from the east, or the southwest corner, for instance. |
Color |
getColor()
Returns the color of the central road area. |
void |
setColor(Color newColor)
Same as colorRoads. |
void |
setSimCount(int numSims)
Display the number of Sims on this intersection. |
Methods inherited from class becker.robots.icons.CompositeIcon |
---|
applyTransforms, componentIcon, hasChanged, markChanged, numComponents, renderImage |
Methods inherited from class becker.robots.icons.Icon |
---|
getImage, getLabel, getRotation, getSize, getTransparency, paintIcon, setLabel, setSize, setTransparency |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IntersectionIcon(Color roadColor, Color backgroundColor)
roadColor
- The color used for the avenues and streets.backgroundColor
- The color used for the areas between avenues
and streets.Method Detail |
---|
public void setSimCount(int numSims)
numSims
- The number of sims on this icon's intersection.public Icon componentIcon(IntersectionIcon.Area area)
area
- One of {IntersectionIcon.Area
.NORTH, SOUTH, EAST, WEST} for
an avenue or street, one of {IntersectionIcon.Area
.NORTHEAST, NORTHWEST,
SOUTHEAST, SOUTHWEST} for an area between the avenues and streets, or
IntersectionIcon.Area
.CENTER for the actual intersection of
the avenue and street.
public void setColor(Color newColor)
setColor
in class CompositeIcon
newColor
- The new color.public Color getColor()
getColor
in class CompositeIcon
public void colorArea(IntersectionIcon.Area area, Color color)
area
- One of {IntersectionIcon.Area
.NORTH, SOUTH, EAST, WEST} for
an avenue or street, one of {IntersectionIcon.Area
.NORTHEAST, NORTHWEST,
SOUTHEAST, SOUTHWEST} for an area between the avenues and streets, or
IntersectionIcon.Area
.CENTER for the actual intersection of
the avenue and street.color
- The new color for the specified area.public void colorRoads(Color c)
c
- the new colorpublic void colorNonRoads(Color c)
c
- the new color
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |