Package totalcross.ui
Interface Scrollable
-
- All Known Implementing Classes:
ButtonMenu,ColorList,DBListBox,Document,DynamicScrollContainer,Grid,ImageList,ListBox,ListContainer,MultiEdit,MultiListBox,ScrollContainer,ScrollPosition,TabbedContainer,Tree
public interface ScrollableScrollable is an extension that allows relative motion of the Containers contents using flick animations. Used for scrollable containers that include Flick capability. This interface exposes the methods used to support flick animations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanScrollContent(int direction, java.lang.Object target)Checks if there is room to flick this container in the given direction.voidflickEnded(boolean atPenDown)Called when the flick animation is ended.booleanflickStarted()Called when the flick animation is started.FlickgetFlick()Returns the current flick object.intgetScrollPosition(int direction)Returns the current position given the direction.booleanscrollContent(int xDelta, int yDelta, boolean fromFlick)Performs a relative move.booleanwasScrolled()Returns true if the control was scrolled since last pen down
-
-
-
Method Detail
-
flickStarted
boolean flickStarted()
Called when the flick animation is started.
-
flickEnded
void flickEnded(boolean atPenDown)
Called when the flick animation is ended.- Parameters:
atPenDown- Flag indicating if the animation ended due to a pendown event.
-
canScrollContent
boolean canScrollContent(int direction, java.lang.Object target)Checks if there is room to flick this container in the given direction.- Parameters:
direction- The direction we want to flick given by one of the following constants:target- The target of the series of PEN events that triggered this flick attempt.- Returns:
- true if the container can flick in the indicated direction.
-
scrollContent
boolean scrollContent(int xDelta, int yDelta, boolean fromFlick)Performs a relative move.- Parameters:
xDelta- The relative amount of pixels to move in the X axis.yDelta- The relative amount of pixels to move in the Y axis.
-
getFlick
Flick getFlick()
Returns the current flick object.
-
getScrollPosition
int getScrollPosition(int direction)
Returns the current position given the direction. Used on page scrolls.
-
wasScrolled
boolean wasScrolled()
Returns true if the control was scrolled since last pen down
-
-