mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
[cooja] plugins/Visualizer: Mouse release always terminates previous action
and reses actions state and cursor appearance Also renamed UNKNOWN state to NONE as it is a more adequate name for the new behavior
This commit is contained in:
parent
2465a361e3
commit
39f7ca586f
@ -160,12 +160,16 @@ public class Visualizer extends VisPlugin implements HasQuickHelp {
|
||||
private static final int MOVE_MASK = Event.SHIFT_MASK;
|
||||
|
||||
enum MotesActionState {
|
||||
|
||||
UNKNWON,
|
||||
NONE,
|
||||
// press to select mote
|
||||
SELECT_PRESS,
|
||||
// press
|
||||
DEFAULT_PRESS,
|
||||
// press to start panning
|
||||
PAN_PRESS,
|
||||
// panning the viewport
|
||||
PANNING,
|
||||
// moving a mote
|
||||
MOVING,
|
||||
// rectangular select
|
||||
SELECTING
|
||||
@ -176,7 +180,7 @@ public class Visualizer extends VisPlugin implements HasQuickHelp {
|
||||
/* Mote that was under curser while mouse press */
|
||||
Mote cursorMote;
|
||||
|
||||
MotesActionState mouseActionState = MotesActionState.UNKNWON;
|
||||
MotesActionState mouseActionState = MotesActionState.NONE;
|
||||
/* Position where mouse button was pressed */
|
||||
Position pressedPos;
|
||||
|
||||
@ -1038,6 +1042,9 @@ public class Visualizer extends VisPlugin implements HasQuickHelp {
|
||||
repaint();
|
||||
break;
|
||||
}
|
||||
/* Release always stops previous actions */
|
||||
mouseActionState = MotesActionState.NONE;
|
||||
canvas.setCursor(Cursor.getDefaultCursor());
|
||||
repaint();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user