|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ach.SmartScrollPane
SmartScrollPane.java
Copyright (c) 1997-2005 Helge Hackbarth, All Rights Reserved.
Controls horizontal and vertical Scrollbars. Implements a ScrollPane
similar to AWT 1.1 but can already be used with AWT 1.0x.
Scrollbars are automatically shown or hidden depending on the size of its
container and the dimension of the object to be controlled by the scrollbars
THE AUTHOR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY
OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, OR NON-INFRINGEMENT. THE AUTHOR SHALL NOT BE LIABLE FOR ANY
DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
Field Summary | |
boolean |
needStepAdjust
flag if scrollbars need adjustment of page scroll stepsize (depends on Java VM) Your application should compare scrollbar value before and after a page step to determine if an adjustment is required |
int |
oldHvalue
old horizontal scrollbar value (before latest event) can be used to determine if step adjustment is required |
int |
oldVvalue
old vertical scrollbar value (before latest event) can be used to determine if step adjustment is required |
int |
sbHlinc
horizontal line increment |
ScrollComponent |
sbHoriz
The horizontal scrollbar |
ScrollComponent |
sbVert
The vertical scrollbar |
int |
sbVlinc
vertical line increment |
Constructor Summary | |
SmartScrollPane(int hvalue,
int hvisible,
int hminimum,
int hmaximum,
int vvalue,
int vvisible,
int vminimum,
int vmaximum)
Constructor for SmartScrollPane Specify the initial value, the visible amount, the minimum and maximum value horizontally and vertically |
Method Summary | |
void |
disableScrollPane()
disable and hide both scrollbars |
void |
doScrollStep(java.lang.Object target,
java.awt.Container c,
int direction,
boolean pageStep)
adjust step-size and suppress echos of scrollbar events depending on java version and VM supplier |
int |
getHorizValue(java.awt.Container c,
int width)
get java version dependent corrected value of horizontal scrollbar |
int |
getVertValue(java.awt.Container c,
int height)
get java version dependent corrected value of vertical scrollbar |
int |
getVisibleHeight(java.awt.Container c)
calculate height of visible area in current container |
int |
getVisibleWidth(java.awt.Container c)
calculate width of visible area in current container |
boolean |
isSbHenabled()
get enabling status of horizontal scroll bar |
boolean |
isSbVenabled()
get enabling status of vertical scroll bar |
void |
restoreValues()
restore the currently saved values of the scrollbars |
void |
saveValues()
save the current values of the scrollbars temporarily |
void |
setHorizValue(int value,
java.awt.Container c,
int width)
set java version dependent corrected value of horizontal scrollbar |
void |
setVertValue(int value,
java.awt.Container c,
int height)
set java version dependent corrected value of vertical scrollbar |
void |
updateScrollbars(java.awt.Container c,
java.awt.Dimension d)
Check if (and which) Scrollbars are to be displayed and update them |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public ScrollComponent sbHoriz
Scrollbar
public ScrollComponent sbVert
Scrollbar
public boolean needStepAdjust
public int sbHlinc
public int sbVlinc
public int oldHvalue
public int oldVvalue
Constructor Detail |
public SmartScrollPane(int hvalue, int hvisible, int hminimum, int hmaximum, int vvalue, int vvisible, int vminimum, int vmaximum)
Method Detail |
public void updateScrollbars(java.awt.Container c, java.awt.Dimension d)
c
- the container that will contain the scrollbarsd
- the dimension of the object scrolled by the scrollbarspublic boolean isSbHenabled()
public boolean isSbVenabled()
public void disableScrollPane()
public int getVisibleWidth(java.awt.Container c)
public int getVisibleHeight(java.awt.Container c)
public int getHorizValue(java.awt.Container c, int width)
c
- the container that holds the scrollpanewidth
- the horizontal size of the object to be scrolledpublic int getVertValue(java.awt.Container c, int height)
c
- the container that holds the scrollpaneheight
- the vertical size of the object to be scrolledpublic void setHorizValue(int value, java.awt.Container c, int width)
value
- the current position of the objectc
- the container that holds the scrollpanewidth
- the horizontal size of the object to be scrolledpublic void setVertValue(int value, java.awt.Container c, int height)
value
- the current position of the objectc
- the container that holds the scrollpaneheight
- the vertical size of the object to be scrolledpublic void saveValues()
public void restoreValues()
public void doScrollStep(java.lang.Object target, java.awt.Container c, int direction, boolean pageStep)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |