public class Flick extends java.lang.Object implements PenListener, TimerListener
Modifier and Type | Field and Description |
---|---|
static int |
BOTH_DIRECTIONS |
static Flick |
currentFlick
Indicates that a flick animation is running.
|
static double |
defaultFlickAcceleration
Flick acceleration in inches/second^2.
|
static int |
defaultFrameRate
Desired animation frame rate in frames/second.
|
static int |
defaultLongestFlick
Longest flick animation allowed in milliseconds.
|
static int |
defaultShortestFlick
Shortest flick animation allowed to start in milliseconds.
|
boolean |
dontPropagate
When a ScrollContainer is inside another one, by default, both can be scrolled at the same time.
|
double |
flickAcceleration |
int |
forcedFlickDirection |
int |
frameRate |
static int |
HORIZONTAL_DIRECTION_ONLY |
static boolean |
isDragging
True if the user is dragging a control that owns a Flick but the flick didn't started yet
(in that case, currentFlick would not be null).
|
int |
longestFlick |
int |
maximumAccelerationMultiplier
The maximum accelleration that can be applied when the user keep dragging the container.
|
PagePosition |
pagepos |
int |
shortestFlick |
static int |
VERTICAL_DIRECTION_ONLY |
Constructor and Description |
---|
Flick(Scrollable s)
Create a Flick animation object for a FlickableContainer.
|
Modifier and Type | Method and Description |
---|---|
void |
addEventSource(Control c)
Adds an event source to whom this flick will grab pen events.
|
void |
addScrollableListener(Scrollable s)
Adds another listener of Scrollable events.
|
void |
callListeners(boolean started,
boolean atPenDown)
Calls the listeners of this flick.
|
boolean |
isValidDirection(int direction) |
void |
penDown(PenEvent e)
Indicates the start of a simple tap or a drag.
|
void |
penDrag(DragEvent e)
Resets the drag start parameters if the direction changes.
|
void |
penDragEnd(DragEvent e)
Checks whether or not to start a flick animation.
|
void |
penDragStart(DragEvent e)
Indicates the start of a drag.
|
void |
penUp(PenEvent e)
A PEN_UP event was dispatched.
|
void |
removeEventSource(Control c)
Remove a previously added event source.
|
void |
setDistanceToAbortScroll(int v)
The distance used to abort the scroll.
|
void |
setPagePosition(PagePosition pp)
Call this method to set the PagePosition control that will be updated with the current page
as the flick occurs.
|
void |
setScrollDistance(int v)
Used in page scrolls, defines the distance that should be scrolled.
|
void |
timerTriggered(TimerEvent e)
Processes timer ticks to run the animation.
|
public static final int BOTH_DIRECTIONS
public static final int HORIZONTAL_DIRECTION_ONLY
public static final int VERTICAL_DIRECTION_ONLY
public int forcedFlickDirection
public static Flick currentFlick
public static int defaultFrameRate
public int frameRate
public static int defaultShortestFlick
public int shortestFlick
public static int defaultLongestFlick
public int longestFlick
public static double defaultFlickAcceleration
public double flickAcceleration
public PagePosition pagepos
public static boolean isDragging
public int maximumAccelerationMultiplier
public boolean dontPropagate
public Flick(Scrollable s)
public void setPagePosition(PagePosition pp)
public void setScrollDistance(int v)
setDistanceToAbortScroll(int)
public void setDistanceToAbortScroll(int v)
setScrollDistance(int)
public void addScrollableListener(Scrollable s)
public void addEventSource(Control c)
public void removeEventSource(Control c)
public void penDown(PenEvent e)
penDown
in interface PenListener
PenEvent
public boolean isValidDirection(int direction)
public void penDragStart(DragEvent e)
penDragStart
in interface PenListener
PenEvent
public void penDrag(DragEvent e)
penDrag
in interface PenListener
PenEvent
public void penDragEnd(DragEvent e)
penDragEnd
in interface PenListener
PenEvent
public void callListeners(boolean started, boolean atPenDown)
public void penUp(PenEvent e)
PenListener
penUp
in interface PenListener
PenEvent
public void timerTriggered(TimerEvent e)
timerTriggered
in interface TimerListener
TimerEvent