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

Variable Index

 o HORIZONTAL
A constant that indicates a horizontal scroll bar.
 o SCROLLBAR_THICKNESS
The default scrollbar thickness.
 o VERTICAL
A constant that indicates a vertical scroll bar.

Constructor Index

 o Scrollbar()
Constructs a new vertical scroll bar.
 o Scrollbar(int)
Constructs a new scroll bar with the specified orientation.
 o Scrollbar(int, int, int, int, int)
Constructs a new scroll bar with the specified orientation, initial value, page size, and minimum and maximum values.

Method Index

 o addAdjustmentListener(AdjustmentListener)
Adds the specified adjustment listener to receive instances of AdjustmentEvent from this scroll bar.
 o getBlockIncrement()
Gets the block increment of this scroll bar.
 o getLineIncrement()
Deprecated.
 o getMaximum()
Gets the maximum value of this scroll bar.
 o getMinimum()
Gets the minimum value of this scroll bar.
 o getOrientation()
Returns the orientation of this scroll bar.
 o getPageIncrement()
Deprecated.
 o getPreferredSize()
Returns the preferred size of this scroll bar.
 o getScrollbarThickness()
Returns the thickness of the scroll bar.
 o getUnitIncrement()
Gets the unit increment for this scrollbar.
 o getValue()
Gets the current value of this scroll bar.
 o getVisible()
Deprecated.
 o getVisibleAmount()
Gets the visible amount of this scroll bar.
 o mouseClicked(MouseEvent)
Invoked when the mouse has been clicked on a component.
 o mouseDragged(MouseEvent)
Invoked when the mouse button is pressed on a component and then dragged.
 o mouseEntered(MouseEvent)
Invoked when the mouse enters a component.
 o mouseExited(MouseEvent)
Invoked when the mouse exits a component.
 o mouseMoved(MouseEvent)
Invoked when the mouse button has been moved on a component.
 o mousePressed(MouseEvent)
Invoked when the mouse has been pressed on a component.
 o mouseReleased(MouseEvent)
Invoked when the mouse has been released on a component.
 o removeAdjustmentListener(AdjustmentListener)
Removes the specified adjustment listener so that it no longer receives instances of AdjustmentEvent from this scroll bar.
 o setBlockIncrement(int)
Sets the block increment for this scroll bar.
 o setBounds(int, int, int, int)
Moves and resizes this scroll bar.
 o setLineIncrement(int)
Deprecated.
 o setMaximum(int)
Sets the maximum value of this scroll bar.
 o setMinimum(int)
Sets the minimum value of this scroll bar.
 o setOrientation(int)
Sets the orientation for this scroll bar.
 o setPageIncrement(int)
Deprecated.
 o setScrollbarThickness(int)
Sets the thickness of the scroll bar.
 o setUnitIncrement(int)
Sets the unit increment for this scroll bar.
 o setValue(int)
Sets the value of this scroll bar to the specified value.
 o setValues(int, int, int, int)
Sets the values of four properties for this scroll bar.
 o setVisibleAmount(int)
Sets the visible amount of this scroll bar.

Variables

 o HORIZONTAL
 public static final int HORIZONTAL
A constant that indicates a horizontal scroll bar.

 o VERTICAL
 public static final int VERTICAL
A constant that indicates a vertical scroll bar.

 o SCROLLBAR_THICKNESS
 public static final int SCROLLBAR_THICKNESS
The default scrollbar thickness.

Constructors

 o Scrollbar
 public Scrollbar()
Constructs a new vertical scroll bar.

 o Scrollbar
 public Scrollbar(int orientation)
Constructs a new scroll bar with the specified orientation.

Parameters:
orientation - the orientation of the scroll bar.
 o 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.

Methods

 o 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.
 o 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.
 o getPreferredSize
 public Dimension getPreferredSize()
Returns the preferred size of this scroll bar.

Overrides:
getPreferredSize in class KComponent
 o setBounds
 public void setBounds(int x,
                       int y,
                       int width,
                       int height)
Moves and resizes this scroll bar.

Overrides:
setBounds in class KComponent
 o 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
 o 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
 o getValue
 public int getValue()
Gets the current value of this scroll bar.

Returns:
the current value of this scroll bar.
See Also:
getMinimum, getMaximum
 o 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
 o getMinimum
 public int getMinimum()
Gets the minimum value of this scroll bar.

Returns:
the minimum value of this scroll bar.
See Also:
getValue, getMaximum
 o 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
 o getMaximum
 public int getMaximum()
Gets the maximum value of this scroll bar.

Returns:
the maximum value of this scroll bar.
See Also:
getValue, getMinimum
 o 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
 o getVisibleAmount
 public int getVisibleAmount()
Gets the visible amount of this scroll bar.

Returns:
the visible amount of this scroll bar.
See Also:
setVisibleAmount
 o getVisible
 public int getVisible()
Note: getVisible() is deprecated. As of JDK version 1.1, replaced by getVisibleAmount().

 o 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
 o 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
 o setLineIncrement
 public void setLineIncrement(int v)
Note: setLineIncrement() is deprecated. As of JDK version 1.1, replaced by setUnitIncrement(int).

 o getUnitIncrement
 public int getUnitIncrement()
Gets the unit increment for this scrollbar.

Returns:
the unit increment of this scroll bar.
See Also:
setUnitIncrement
 o getLineIncrement
 public int getLineIncrement()
Note: getLineIncrement() is deprecated. As of JDK version 1.1, replaced by getUnitIncrement().

 o 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
 o setPageIncrement
 public void setPageIncrement(int v)
Note: setPageIncrement() is deprecated. As of JDK version 1.1, replaced by setBlockIncrement().

 o getBlockIncrement
 public int getBlockIncrement()
Gets the block increment of this scroll bar.

Returns:
the block increment of this scroll bar.
See Also:
setBlockIncrement
 o getPageIncrement
 public int getPageIncrement()
Note: getPageIncrement() is deprecated. As of JDK version 1.1, replaced by getBlockIncrement().

 o 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.
 o getScrollbarThickness
 public int getScrollbarThickness()
Returns the thickness of the scroll bar.

See Also:
setScrollbarThickness
 o setScrollbarThickness
 public synchronized void setScrollbarThickness(int thickness)
Sets the thickness of the scroll bar.

See Also:
getScrollbarThickness
 o mouseClicked
 public void mouseClicked(MouseEvent e)
Invoked when the mouse has been clicked on a component.

See Also:
MouseListener
 o mousePressed
 public void mousePressed(MouseEvent e)
Invoked when the mouse has been pressed on a component.

See Also:
MouseListener
 o mouseReleased
 public void mouseReleased(MouseEvent e)
Invoked when the mouse has been released on a component.

See Also:
MouseListener
 o mouseEntered
 public void mouseEntered(MouseEvent e)
Invoked when the mouse enters a component.

See Also:
MouseListener
 o mouseExited
 public void mouseExited(MouseEvent e)
Invoked when the mouse exits a component.

See Also:
MouseListener
 o mouseDragged
 public void mouseDragged(MouseEvent e)
Invoked when the mouse button is pressed on a component and then dragged.

See Also:
MouseMotionListener
 o 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