Class DetectorImage
java.lang.Object
org.opentrafficsim.trafficcontrol.trafcod.DetectorImage
- All Implemented Interfaces:
Serializable,Remote,EventListener,org.djutils.event.EventListener,TrafCODObject
Draws a detector.
-
Constructor Summary
ConstructorsConstructorDescriptionDetectorImage(TrafCodDisplay display, Point2D center, String id, String description) Construct a new DetectorImage. -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(Graphics2D g2) Draw yourself at the indicated location.getId()Retrieve the id of this DetectorImage.voidnotify(org.djutils.event.Event event) toolTipHit(int testX, int testY) Check if the given coordinates hit the TrafCODObject.
-
Constructor Details
-
DetectorImage
DetectorImage(TrafCodDisplay display, Point2D center, String id, String description) Construct a new DetectorImage.- Parameters:
display- the TrafCOD display on which this detector image will be renderedcenter- the center location of the detector image on the TrafCOD displayid- id used to match this detector with the TrafCOD detector inputdescription- name of the detector (displayed as tool tip text)
-
-
Method Details
-
draw
Description copied from interface:TrafCODObjectDraw yourself at the indicated location.- Specified by:
drawin interfaceTrafCODObject- Parameters:
g2- the graphics context
-
notify
- Specified by:
notifyin interfaceorg.djutils.event.EventListener- Throws:
RemoteException
-
toolTipHit
Description copied from interface:TrafCODObjectCheck if the given coordinates hit the TrafCODObject. If it does return a String to be used as a tool tip text. If the coordinates do not hit this TrafCODObject return null.- Specified by:
toolTipHitin interfaceTrafCODObject- Parameters:
testX- the x-coordinatetestY- the y-coordinate- Returns:
- the tool tip text or null if the coordinates do not hit the TrafCodObject
-
getId
Retrieve the id of this DetectorImage.- Returns:
- the id of this DetectorImage
-