|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread vanetsim.gui.helpers.MouseClickManager
public final class MouseClickManager
A class to correctly handle mouseclicks and drags on the DrawingArea. Furthermore, this class also handles the display in the information text area.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
boolean |
active_
true if this manager currently is active,false if it's inactive. |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Method Summary | |
---|---|
void |
cleanMarkings()
Cleans markings so that objects can be deleted through garbage collector. |
static MouseClickManager |
getInstance()
Gets the single instance of this manager. |
void |
run()
The thread which handles mouse drags and information display. |
void |
setActive(boolean active)
Sets the value for the isActive variable. |
void |
setDrawArea(DrawingArea drawArea)
Sets the DrawingArea this MouseClickManager is associated with. |
void |
signalPressed(int x,
int y)
Signals this manager that the mouse was pressed. |
void |
signalReleased(int x,
int y)
Signals this manager that the mouse was released (used for dragging). |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public boolean active_
true
if this manager currently is active,false
if it's inactive.
Method Detail |
---|
public static MouseClickManager getInstance()
public void setActive(boolean active)
isActive
variable.
active
- true
to signal this thread that the DrawingArea has been entered,false
to signal that the area was leftpublic void setDrawArea(DrawingArea drawArea)
DrawingArea
this MouseClickManager is associated with.
drawArea
- the area on which this MouseClickManager operatespublic void signalPressed(int x, int y)
x
- the x coordinate where mouse was pressedy
- the y coordinate where mouse was pressedpublic void signalReleased(int x, int y)
x
- the x coordinate where mouse was releasedy
- the y coordinate where mouse was releasedpublic void cleanMarkings()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
Thread.run()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |