Interface TrafCODObject
- All Known Implementing Classes:
DetectorImage
,TrafficLightImage
interface TrafCODObject
Interface for objects that can draw themselves onto a Graphics2D and may want to show their own tool tip text when the mouse
hits them.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
draw
(Graphics2D g2) Draw yourself at the indicated location.toolTipHit
(int testX, int testY) Check if the given coordinates hit the TrafCODObject.
-
Method Details
-
draw
Draw yourself at the indicated location.- Parameters:
g2
- Graphics2D; the graphics context
-
toolTipHit
Check 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.- Parameters:
testX
- int; the x-coordinatetestY
- int; the y-coordinate- Returns:
- String; the tool tip text or null if the coordinates do not hit the TrafCodObject
-