|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
Object
Component
Scrollable
public class Scrollable
This class contains exactly one child component and provides an ability to scroll it automatically when focus changes or programmatically.
Setting scroll step to zero using setScrollStep(int) will disable
automatic viewport focusing and scrolling. In this case the viewport must be
adjusted manually using setCurrentPosition(int, int).
| Constructor Summary | |
|---|---|
Scrollable(Style style,
Component child)
Constructs a new scrollable region. |
|
| Method Summary | |
|---|---|
int, int |
getCurrentPosition()
Returns a a current position of view port. |
int, int |
getPosition()
Returns a a target position of view port. |
int, int |
getTotalSize()
Returns a dimension of contained component. |
int, int |
getViewSize()
Returns a dimension of view port. |
void |
setCurrentPosition(int x,
int y)
Sets the current position of view port. |
void |
setPosition(int x,
int y)
Sets a current position of view port. |
void |
setScrollStep(int step)
Sets scroll step size. |
| Methods inherited from class Component |
|---|
add, appendText, clear, find, first, get, getAction, getData, getElement, getFlags, getImage, getLocation, getParent, getShell, getSize, getStyle, getText, getViewPort, hasLinefeed, indexOf, insert, isFocusable, isShown, isVisible, isWrapping, last, operator_get, operator_set, remove, remove, repaint, set, setAction, setData, setElement, setFlags, setImage, setLocation, setPreferredHeight, setPreferredSize, setPreferredWidth, setStyle, setText, size |
| Methods inherited from class Object |
|---|
toString, equals, hashCode |
| Methods inherited from |
|---|
equals, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Scrollable(Style style,
Component child)
style - Style to usechild - Child component| Method Detail |
|---|
public int, int getViewSize()
(int viewWidth, int viewHeight)public int, int getTotalSize()
(int childWidth, int childHeight)public int, int getCurrentPosition()
(int xpos, int ypos)getPosition(),
setPosition(int, int),
setCurrentPosition(int, int)public int, int getPosition()
(int xpos, int ypos)getCurrentPosition(),
setPosition(int, int),
setCurrentPosition(int, int)
public void setPosition(int x,
int y)
x - X coordinate of visible view porty - Y coordinate of visible view portgetPosition(),
getCurrentPosition(),
setCurrentPosition(int, int)
public void setCurrentPosition(int x,
int y)
setPosition(int, int) this method does not perform any animation.
x - X coordinate of visible view porty - Y coordinate of visible view portgetPosition(),
getCurrentPosition(),
setPosition(int, int)public void setScrollStep(int step)
Sets scroll step size. The scale of step varies from 0 to 100, where 100 is a full height of this component, and 1 being 1% from height of this component. This step is used by automatic scrolling triggered by focus changes. Default scoll step is 50.
If the step is zero the scrollable will not attempt to maintain focused component visible, in which case it needs to be update to manually.
step - Step size, in percents
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||