public class TrafficLightFigure extends StateFigure
BaseFigure.Orientation
_currentState, _stateColors
_lastUpdate, _orientation, _shape, isDebugging, log
Constructor and Description |
---|
TrafficLightFigure(int numberOfLights,
java.awt.geom.RectangularShape shape) |
Modifier and Type | Method and Description |
---|---|
protected void |
_update()
Sets the color for each light according to current state.
|
void |
setOrientation(BaseFigure.Orientation orientation)
Sets the orientation and calls
BaseFigure.update() if the orientation
changes. |
addColorScheme, getColorScheme, setState
getOrientation, update
add, add, contains, figures, figuresFromBack, figuresFromFront, get, getBackgroundFigure, getBounds, getChildren, getFigureCount, getOrigin, getShape, getTransformContext, indexOf, intersects, invalidateCachedBounds, paint, paint, pick, pick, remove, remove, repaint, replaceChild, setBackgroundFigure, setIndex, toString, transform, translate
contains, getInteractor, getLayer, getParent, getToolTipText, getUserObject, hit, isVisible, repaint, setInteractor, setParent, setToolTipText, setUserObject, setVisible
public TrafficLightFigure(int numberOfLights, java.awt.geom.RectangularShape shape)
public void setOrientation(BaseFigure.Orientation orientation)
BaseFigure.update()
if the orientation
changes.setOrientation
in class BaseFigure
orientation
- the orientation.protected void _update()
_update
in class BaseFigure