public interface ScrollClient extends IScroll
A ScrollClient is controled by a ScrollServer - the ScrollServer usually has and takes input from the various user scrolling controls (e.g. like a scroll bar or a track bar) and then translates the user input into scroll commands which are sent to the ScrollClient via the doScroll() method.
GoHigher, GoLower, Horizontal, OPTION_INDICATOR_ONLY, PageHigher, PageLower, ScrollHigher, ScrollLower, TrackTo, Vertical
Modifier and Type | Method and Description |
---|---|
boolean |
canGo(int orientation,
int direction,
int position)
This method should return whether the ScrollClient can actually scroll in a particular
direction, given a starting position in units.
|
void |
doScroll(int which,
int action,
int value)
This is called by the ScrolledServer to indicate that the user has requested
a scroll.
|
int |
getActual(int which)
Get the full number of units either vertically or horizontally that the ScrollClient
contains.
|
int |
getCurrent(int which)
This should return which unit is currently being displayed.
|
ScrollServer |
getServer()
Returns the ScrollServer for the ScrollClient if present.
|
int |
getVisible(int which,
int forVisibleSize)
Given a display size, this method should return the number of units that can be fully
displayed within the display size for the specified dimension.
|
boolean |
needScrollBar(int which,
int forVisibleSize)
This method should return whether a ScrollBar (or some other form of scrolling
user control) is necessary for the specified dimension.
|
void |
setServer(ScrollServer server)
Notifies the ScrollClient of its new ScrollServer.
|
void doScroll(int which, int action, int value)
which
- either Horizontal or Verticalaction
- one of PageHigher, PageLower, ScrollHigher, ScrollLower, TrackTovalue
- this is used for the TrackTo action and indicates the position to
track to.void setServer(ScrollServer server)
server
- the ScrollServer for the ScrollClient.ScrollServer getServer()
int getActual(int which)
which
- either Horizontal or Vertical.int getVisible(int which, int forVisibleSize)
which
- either Horizontal or Vertical.forVisibleSize
- the size (usually in pixels) allowed to be displayed on screen.int getCurrent(int which)
which
- either Horizontal or Vertical.boolean needScrollBar(int which, int forVisibleSize)
However a ScrollClient can return true always if it always wishes a ScrollBar to be present, or false always if it never wishes a ScrollBar to be present.
which
- either Horizontal or Vertical.forVisibleSize
- the size (usually in pixels) allowed to be displayed on screen.boolean canGo(int orientation, int direction, int position)
orientation
- either Horizontal or Vertical.direction
- either GoHigher or GoLower.position
- a starting position in units.