All Packages Class Hierarchy This Package Previous Next Index
Class jp.kyasu.awt.Scrollbar
java.lang.Object
|
+----java.awt.Component
|
+----jp.kyasu.awt.KComponent
|
+----jp.kyasu.awt.Scrollbar
- public class Scrollbar
- extends KComponent
- implements Adjustable, MouseListener, MouseMotionListener
The Scrollbar
class embodies a scroll bar, a familiar
user-interface object. A scroll bar provides a convenient means for
allowing a user to select from a range of values.
- Version:
- 25 Jul 1998
- Author:
- Kazuki YASUMATSU
-
HORIZONTAL
- A constant that indicates a horizontal scroll bar.
-
SCROLLBAR_THICKNESS
- The default scrollbar thickness.
-
VERTICAL
- A constant that indicates a vertical scroll bar.
-
Scrollbar()
- Constructs a new vertical scroll bar.
-
Scrollbar(int)
- Constructs a new scroll bar with the specified orientation.
-
Scrollbar(int, int, int, int, int)
- Constructs a new scroll bar with the specified orientation,
initial value, page size, and minimum and maximum values.
-
addAdjustmentListener(AdjustmentListener)
- Adds the specified adjustment listener to receive instances of
AdjustmentEvent
from this scroll bar.
-
getBlockIncrement()
- Gets the block increment of this scroll bar.
-
getLineIncrement()
-
Deprecated.
-
getMaximum()
- Gets the maximum value of this scroll bar.
-
getMinimum()
- Gets the minimum value of this scroll bar.
-
getOrientation()
- Returns the orientation of this scroll bar.
-
getPageIncrement()
-
Deprecated.
-
getPreferredSize()
- Returns the preferred size of this scroll bar.
-
getScrollbarThickness()
- Returns the thickness of the scroll bar.
-
getUnitIncrement()
- Gets the unit increment for this scrollbar.
-
getValue()
- Gets the current value of this scroll bar.
-
getVisible()
-
Deprecated.
-
getVisibleAmount()
- Gets the visible amount of this scroll bar.
-
mouseClicked(MouseEvent)
- Invoked when the mouse has been clicked on a component.
-
mouseDragged(MouseEvent)
- Invoked when the mouse button is pressed on a component and then dragged.
-
mouseEntered(MouseEvent)
- Invoked when the mouse enters a component.
-
mouseExited(MouseEvent)
- Invoked when the mouse exits a component.
-
mouseMoved(MouseEvent)
- Invoked when the mouse button has been moved on a component.
-
mousePressed(MouseEvent)
- Invoked when the mouse has been pressed on a component.
-
mouseReleased(MouseEvent)
- Invoked when the mouse has been released on a component.
-
removeAdjustmentListener(AdjustmentListener)
- Removes the specified adjustment listener so that it no longer
receives instances of
AdjustmentEvent
from this scroll bar.
-
setBlockIncrement(int)
- Sets the block increment for this scroll bar.
-
setBounds(int, int, int, int)
- Moves and resizes this scroll bar.
-
setLineIncrement(int)
-
Deprecated.
-
setMaximum(int)
- Sets the maximum value of this scroll bar.
-
setMinimum(int)
- Sets the minimum value of this scroll bar.
-
setOrientation(int)
- Sets the orientation for this scroll bar.
-
setPageIncrement(int)
-
Deprecated.
-
setScrollbarThickness(int)
- Sets the thickness of the scroll bar.
-
setUnitIncrement(int)
- Sets the unit increment for this scroll bar.
-
setValue(int)
- Sets the value of this scroll bar to the specified value.
-
setValues(int, int, int, int)
- Sets the values of four properties for this scroll bar.
-
setVisibleAmount(int)
- Sets the visible amount of this scroll bar.
HORIZONTAL
public static final int HORIZONTAL
- A constant that indicates a horizontal scroll bar.
VERTICAL
public static final int VERTICAL
- A constant that indicates a vertical scroll bar.
SCROLLBAR_THICKNESS
public static final int SCROLLBAR_THICKNESS
- The default scrollbar thickness.
Scrollbar
public Scrollbar()
- Constructs a new vertical scroll bar.
Scrollbar
public Scrollbar(int orientation)
- Constructs a new scroll bar with the specified orientation.
- Parameters:
- orientation - the orientation of the scroll bar.
Scrollbar
public Scrollbar(int orientation,
int value,
int visible,
int minimum,
int maximum)
- Constructs a new scroll bar with the specified orientation,
initial value, page size, and minimum and maximum values.
- Parameters:
- orientation - the orientation of the scroll bar.
- value - the initial value of the scroll bar.
- visible - the size of the scroll bar's bubble, representing
the visible portion; the scroll bar uses this
value when paging up or down by a page.
- minimum - the minimum value of the scroll bar.
- maximum - the maximum value of the scroll bar.
addAdjustmentListener
public synchronized void addAdjustmentListener(AdjustmentListener l)
- Adds the specified adjustment listener to receive instances of
AdjustmentEvent
from this scroll bar.
- Parameters:
- l - the adjustment listener.
removeAdjustmentListener
public synchronized void removeAdjustmentListener(AdjustmentListener l)
- Removes the specified adjustment listener so that it no longer
receives instances of
AdjustmentEvent
from this scroll bar.
- Parameters:
- l - the adjustment listener.
getPreferredSize
public Dimension getPreferredSize()
- Returns the preferred size of this scroll bar.
- Overrides:
- getPreferredSize in class KComponent
setBounds
public void setBounds(int x,
int y,
int width,
int height)
- Moves and resizes this scroll bar.
- Overrides:
- setBounds in class KComponent
getOrientation
public int getOrientation()
- Returns the orientation of this scroll bar.
- Returns:
- the orientation of this scroll bar, either
Scrollbar.HORIZONTAL
or
Scrollbar.VERTICAL
.
- See Also:
- setOrientation
setOrientation
public synchronized void setOrientation(int orientation)
- Sets the orientation for this scroll bar.
- Parameters:
- orientation - the orientation of this scroll bar, either
Scrollbar.HORIZONTAL
or
Scrollbar.VERTICAL
.
- See Also:
- getOrientation
getValue
public int getValue()
- Gets the current value of this scroll bar.
- Returns:
- the current value of this scroll bar.
- See Also:
- getMinimum, getMaximum
setValue
public synchronized void setValue(int newValue)
- Sets the value of this scroll bar to the specified value.
- Parameters:
- newValue - the new value of the scroll bar.
- See Also:
- setValues, getValue, getMinimum, getMaximum
getMinimum
public int getMinimum()
- Gets the minimum value of this scroll bar.
- Returns:
- the minimum value of this scroll bar.
- See Also:
- getValue, getMaximum
setMinimum
public synchronized void setMinimum(int newMinimum)
- Sets the minimum value of this scroll bar.
- Parameters:
- newMinimum - the new minimum value for this scroll bar.
- See Also:
- setValues, setMaximum
getMaximum
public int getMaximum()
- Gets the maximum value of this scroll bar.
- Returns:
- the maximum value of this scroll bar.
- See Also:
- getValue, getMinimum
setMaximum
public synchronized void setMaximum(int newMaximum)
- Sets the maximum value of this scroll bar.
- Parameters:
- newMaximum - the new maximum value for this scroll bar.
- See Also:
- setValues, setMinimum
getVisibleAmount
public int getVisibleAmount()
- Gets the visible amount of this scroll bar.
- Returns:
- the visible amount of this scroll bar.
- See Also:
- setVisibleAmount
getVisible
public int getVisible()
- Note: getVisible() is deprecated.
As of JDK version 1.1,
replaced by
getVisibleAmount()
.
setVisibleAmount
public synchronized void setVisibleAmount(int newAmount)
- Sets the visible amount of this scroll bar.
- Parameters:
- newAmount - the amount visible per page.
- See Also:
- getVisibleAmount, setValues
setUnitIncrement
public synchronized void setUnitIncrement(int v)
- Sets the unit increment for this scroll bar.
- Parameters:
- v - the amount by which to increment or decrement the scroll
bar's value.
- See Also:
- getUnitIncrement
setLineIncrement
public void setLineIncrement(int v)
- Note: setLineIncrement() is deprecated.
As of JDK version 1.1,
replaced by
setUnitIncrement(int)
.
getUnitIncrement
public int getUnitIncrement()
- Gets the unit increment for this scrollbar.
- Returns:
- the unit increment of this scroll bar.
- See Also:
- setUnitIncrement
getLineIncrement
public int getLineIncrement()
- Note: getLineIncrement() is deprecated.
As of JDK version 1.1,
replaced by
getUnitIncrement()
.
setBlockIncrement
public synchronized void setBlockIncrement(int v)
- Sets the block increment for this scroll bar.
- Parameters:
- v - the amount by which to increment or decrement the scroll
bar's value.
- See Also:
- getBlockIncrement
setPageIncrement
public void setPageIncrement(int v)
- Note: setPageIncrement() is deprecated.
As of JDK version 1.1,
replaced by
setBlockIncrement()
.
getBlockIncrement
public int getBlockIncrement()
- Gets the block increment of this scroll bar.
- Returns:
- the block increment of this scroll bar.
- See Also:
- setBlockIncrement
getPageIncrement
public int getPageIncrement()
- Note: getPageIncrement() is deprecated.
As of JDK version 1.1,
replaced by
getBlockIncrement()
.
setValues
public synchronized void setValues(int value,
int visible,
int minimum,
int maximum)
- Sets the values of four properties for this scroll bar.
This method simultaneously and synchronously sets the values
of four scroll bar properties, assuring that the values of
these properties are mutually consistent. It enforces the
constraints that maximum cannot be less than minimum, and that
value cannot be less than the minimum or greater than the maximum.
- Parameters:
- value - the position in the current window.
- visible - the amount visible per page.
- minimum - the minimum value of the scroll bar.
- maximum - the maximum value of the scroll bar.
getScrollbarThickness
public int getScrollbarThickness()
- Returns the thickness of the scroll bar.
- See Also:
- setScrollbarThickness
setScrollbarThickness
public synchronized void setScrollbarThickness(int thickness)
- Sets the thickness of the scroll bar.
- See Also:
- getScrollbarThickness
mouseClicked
public void mouseClicked(MouseEvent e)
- Invoked when the mouse has been clicked on a component.
- See Also:
- MouseListener
mousePressed
public void mousePressed(MouseEvent e)
- Invoked when the mouse has been pressed on a component.
- See Also:
- MouseListener
mouseReleased
public void mouseReleased(MouseEvent e)
- Invoked when the mouse has been released on a component.
- See Also:
- MouseListener
mouseEntered
public void mouseEntered(MouseEvent e)
- Invoked when the mouse enters a component.
- See Also:
- MouseListener
mouseExited
public void mouseExited(MouseEvent e)
- Invoked when the mouse exits a component.
- See Also:
- MouseListener
mouseDragged
public void mouseDragged(MouseEvent e)
- Invoked when the mouse button is pressed on a component and then dragged.
- See Also:
- MouseMotionListener
mouseMoved
public void mouseMoved(MouseEvent e)
- Invoked when the mouse button has been moved on a component.
- See Also:
- MouseMotionListener
All Packages Class Hierarchy This Package Previous Next Index