public class MultiStateInterpreter extends BasicInterpreter
Modifier and Type | Field and Description |
---|---|
static int |
CLICK_TIMEOUT
The timeout for single/double/triple/..
|
static int |
HOLD_TIMEOUT
The timeout for the popup hold, in milliseconds.
|
static int |
MIN_DRAG_DISTANCE
The distance beyond which a click becomes a
drag.
|
_controller, _curStroke, _curSymbol, _strokeBuffer
Constructor and Description |
---|
MultiStateInterpreter(SketchController c)
Create a BasicInterpreter which is used by the
specified controller to interpret sketch input.
|
Modifier and Type | Method and Description |
---|---|
void |
addClickListener(Interactor l)
Add a listener of clicks.
|
void |
addHoldListener(Interactor l)
Add a listener of hold invokations.
|
void |
addStrokeListener(Interactor l)
Add a stroke listener that gets mouse-down, mouse-moved, and
mouse-released events for drawing strokes.
|
int |
getClickCount() |
void |
mouseDragged(LayerEvent e)
Consume the event so it doesn't get passed down to the layer
below.
|
void |
mousePressed(LayerEvent e)
Consume the event so it doesn't get passed down to the * layer
below.
|
void |
mouseReleased(LayerEvent e)
Consume the event.
|
void |
removeClickListener(Interactor l)
Removes a click listener that was added with
addClickListener().
|
void |
removeHoldListener(Interactor l)
Removes a hold listener that was added with
addHoldListener().
|
void |
removeStrokeListener(Interactor l)
Removes a stroke listener that was added with
addStrokeListener().
|
void |
timeout()
Respond to the mouse released event.
|
appendStroke, finishStroke, getController, getCurrentStroke, getCurrentSymbol, isMotionEnabled, mouseEntered, mouseExited, mouseMoved, removeCurrentSymbol, startStroke
accept, getMouseFilter, isConsuming, isEnabled, mouseClicked, setConsuming, setEnabled, setMotionEnabled, setMouseFilter
public static final int MIN_DRAG_DISTANCE
public static final int HOLD_TIMEOUT
public static final int CLICK_TIMEOUT
public MultiStateInterpreter(SketchController c)
public void addClickListener(Interactor l)
public void addHoldListener(Interactor l)
public void addStrokeListener(Interactor l)
public int getClickCount()
public void mouseDragged(LayerEvent e)
mouseDragged
in interface LayerListener
mouseDragged
in class BasicInterpreter
public void mousePressed(LayerEvent e)
mousePressed
in interface LayerListener
mousePressed
in class BasicInterpreter
public void mouseReleased(LayerEvent e)
mouseReleased
in interface LayerListener
mouseReleased
in class BasicInterpreter
public void timeout()
public void removeClickListener(Interactor l)
#addClickListener(MouseListener)
public void removeHoldListener(Interactor l)
#addHoldListener(ActionListener)
public void removeStrokeListener(Interactor l)
#addStrokeListener(MouseInputListener)
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.