class TrafficLightImage extends Object implements org.opentrafficsim.road.network.lane.object.trafficlight.TrafficLight, TrafCODObject
| Constructor and Description |
|---|
TrafficLightImage(TrafCODDisplay display,
Point2D center,
String description)
Create a traffic light image.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addListener(nl.tudelft.simulation.event.EventListenerInterface listener,
nl.tudelft.simulation.event.EventType eventType) |
boolean |
addListener(nl.tudelft.simulation.event.EventListenerInterface listener,
nl.tudelft.simulation.event.EventType eventType,
boolean weak) |
boolean |
addListener(nl.tudelft.simulation.event.EventListenerInterface listener,
nl.tudelft.simulation.event.EventType eventType,
short position) |
boolean |
addListener(nl.tudelft.simulation.event.EventListenerInterface listener,
nl.tudelft.simulation.event.EventType eventType,
short position,
boolean weak) |
void |
draw(Graphics2D g2)
Draw yourself at the indicated location/
|
javax.media.j3d.Bounds |
getBounds() |
org.opentrafficsim.core.geometry.OTSLine3D |
getGeometry() |
org.djunits.value.vdouble.scalar.Length |
getHeight() |
String |
getId() |
org.opentrafficsim.road.network.lane.Lane |
getLane() |
nl.tudelft.simulation.language.d3.DirectedPoint |
getLocation() |
org.djunits.value.vdouble.scalar.Length |
getLongitudinalPosition() |
org.opentrafficsim.road.network.lane.object.trafficlight.TrafficLightColor |
getTrafficLightColor() |
boolean |
removeListener(nl.tudelft.simulation.event.EventListenerInterface listener,
nl.tudelft.simulation.event.EventType eventType) |
void |
setTrafficLightColor(org.opentrafficsim.road.network.lane.object.trafficlight.TrafficLightColor trafficLightColor) |
String |
toolTipHit(int testX,
int testY)
Check if the given coordinates hit the TrafCODObject.
|
public TrafficLightImage(TrafCODDisplay display, Point2D center, String description)
display - TrafCODDisplay; the TrafCOD display on which this traffic light image will be renderedcenter - Point2D; coordinates in the image where this traffic light is centered ondescription - String; tool tip text for the new traffic light imagepublic String toolTipHit(int testX, int testY)
toolTipHit in interface TrafCODObjecttestX - int; the x-coordinatetestY - int; the y-coordinatepublic nl.tudelft.simulation.language.d3.DirectedPoint getLocation()
getLocation in interface nl.tudelft.simulation.dsol.animation.LocatablegetLocation in interface org.opentrafficsim.road.network.lane.object.LaneBasedObjectpublic javax.media.j3d.Bounds getBounds()
getBounds in interface nl.tudelft.simulation.dsol.animation.LocatablegetBounds in interface org.opentrafficsim.road.network.lane.object.LaneBasedObjectpublic org.opentrafficsim.road.network.lane.Lane getLane()
getLane in interface org.opentrafficsim.road.network.lane.object.LaneBasedObjectpublic org.djunits.value.vdouble.scalar.Length getLongitudinalPosition()
getLongitudinalPosition in interface org.opentrafficsim.road.network.lane.object.LaneBasedObjectpublic org.opentrafficsim.core.geometry.OTSLine3D getGeometry()
getGeometry in interface org.opentrafficsim.core.object.ObjectInterfacepublic org.djunits.value.vdouble.scalar.Length getHeight()
getHeight in interface org.opentrafficsim.core.object.ObjectInterfacepublic String getId()
getId in interface org.opentrafficsim.base.Identifyablepublic boolean addListener(nl.tudelft.simulation.event.EventListenerInterface listener,
nl.tudelft.simulation.event.EventType eventType)
throws RemoteException
addListener in interface nl.tudelft.simulation.event.EventProducerInterfaceRemoteExceptionpublic boolean addListener(nl.tudelft.simulation.event.EventListenerInterface listener,
nl.tudelft.simulation.event.EventType eventType,
boolean weak)
throws RemoteException
addListener in interface nl.tudelft.simulation.event.EventProducerInterfaceRemoteExceptionpublic boolean addListener(nl.tudelft.simulation.event.EventListenerInterface listener,
nl.tudelft.simulation.event.EventType eventType,
short position)
throws RemoteException
addListener in interface nl.tudelft.simulation.event.EventProducerInterfaceRemoteExceptionpublic boolean addListener(nl.tudelft.simulation.event.EventListenerInterface listener,
nl.tudelft.simulation.event.EventType eventType,
short position,
boolean weak)
throws RemoteException
addListener in interface nl.tudelft.simulation.event.EventProducerInterfaceRemoteExceptionpublic boolean removeListener(nl.tudelft.simulation.event.EventListenerInterface listener,
nl.tudelft.simulation.event.EventType eventType)
throws RemoteException
removeListener in interface nl.tudelft.simulation.event.EventProducerInterfaceRemoteExceptionpublic org.opentrafficsim.road.network.lane.object.trafficlight.TrafficLightColor getTrafficLightColor()
getTrafficLightColor in interface org.opentrafficsim.road.network.lane.object.trafficlight.TrafficLightpublic void setTrafficLightColor(org.opentrafficsim.road.network.lane.object.trafficlight.TrafficLightColor trafficLightColor)
setTrafficLightColor in interface org.opentrafficsim.road.network.lane.object.trafficlight.TrafficLightpublic void draw(Graphics2D g2)
draw in interface TrafCODObjectg2 - Graphics2D; the graphics contextCopyright © 2014–2016 Delft University of Technology. All rights reserved.