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.network.LongitudinalDirectionality |
getDirection() |
String |
getFullId() |
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 TrafCODObject
testX
- int; the x-coordinatetestY
- int; the y-coordinatepublic nl.tudelft.simulation.language.d3.DirectedPoint getLocation()
getLocation
in interface nl.tudelft.simulation.dsol.animation.Locatable
getLocation
in interface org.opentrafficsim.road.network.lane.object.LaneBasedObject
public javax.media.j3d.Bounds getBounds()
getBounds
in interface nl.tudelft.simulation.dsol.animation.Locatable
getBounds
in interface org.opentrafficsim.road.network.lane.object.LaneBasedObject
public org.opentrafficsim.road.network.lane.Lane getLane()
getLane
in interface org.opentrafficsim.road.network.lane.object.LaneBasedObject
public org.opentrafficsim.core.network.LongitudinalDirectionality getDirection()
getDirection
in interface org.opentrafficsim.road.network.lane.object.LaneBasedObject
public org.djunits.value.vdouble.scalar.Length getLongitudinalPosition()
getLongitudinalPosition
in interface org.opentrafficsim.road.network.lane.object.LaneBasedObject
public org.opentrafficsim.core.geometry.OTSLine3D getGeometry()
getGeometry
in interface org.opentrafficsim.core.object.ObjectInterface
public org.djunits.value.vdouble.scalar.Length getHeight()
getHeight
in interface org.opentrafficsim.core.object.ObjectInterface
public String getId()
getId
in interface org.opentrafficsim.base.Identifiable
public String getFullId()
getFullId
in interface org.opentrafficsim.core.object.ObjectInterface
public boolean addListener(nl.tudelft.simulation.event.EventListenerInterface listener, nl.tudelft.simulation.event.EventType eventType) throws RemoteException
addListener
in interface nl.tudelft.simulation.event.EventProducerInterface
RemoteException
public 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.EventProducerInterface
RemoteException
public 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.EventProducerInterface
RemoteException
public 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.EventProducerInterface
RemoteException
public boolean removeListener(nl.tudelft.simulation.event.EventListenerInterface listener, nl.tudelft.simulation.event.EventType eventType) throws RemoteException
removeListener
in interface nl.tudelft.simulation.event.EventProducerInterface
RemoteException
public org.opentrafficsim.road.network.lane.object.trafficlight.TrafficLightColor getTrafficLightColor()
getTrafficLightColor
in interface org.opentrafficsim.road.network.lane.object.trafficlight.TrafficLight
public void setTrafficLightColor(org.opentrafficsim.road.network.lane.object.trafficlight.TrafficLightColor trafficLightColor)
setTrafficLightColor
in interface org.opentrafficsim.road.network.lane.object.trafficlight.TrafficLight
public void draw(Graphics2D g2)
draw
in interface TrafCODObject
g2
- Graphics2D; the graphics contextCopyright © 2014–2018 Delft University of Technology. All rights reserved.