java.awt
Class Scrollbar
- Accessible, Adjustable, ImageObserver, MenuContainer, Serializable
This class implements a scrollbar widget.
static int | HORIZONTAL - Constant indicating that a scrollbar is horizontal.
|
static int | VERTICAL - Constant indicating that a scrollbar is vertical.
|
Scrollbar() - Initializes a new instance of
Scrollbar with a
vertical orientation and default values for all other parameters.
|
Scrollbar(int orientation) - Initializes a new instance of
Scrollbar with the
specified orientation and default values for all other parameters.
|
Scrollbar(int orientation, int value, int visibleAmount, int minimum, int maximum) - Initializes a new instance of
Scrollbar with the
specified parameters.
|
void | addAdjustmentListener(AdjustmentListener listener) - Adds a new adjustment listener to the list of registered listeners
for this object.
|
void | addNotify() - Notifies this object to create its native peer.
|
| extends EventListener> T[] getListeners(Class listenerType) - Returns an array of all the objects currently registered as FooListeners
upon this
Scrollbar .
|
AccessibleContext | getAccessibleContext() - Gets the AccessibleContext associated with this
Scrollbar .
|
AdjustmentListener[] | getAdjustmentListeners() - Returns an array of all registered adjustment listeners.
|
int | getBlockIncrement() - Returns the value added or subtracted when the user activates the scrollbar
scroll by a "block" amount.
|
int | getLineIncrement() - This method is deprecated in favor of
getUnitIncrement() .
|
int | getMaximum() - Returns the maximum value for this scrollbar.
|
int | getMinimum() - Returns the minimum value for this scrollbar.
|
int | getOrientation() - Returns the orientation constant for this object.
|
int | getPageIncrement() - This method is deprecated in favor of
getBlockIncrement() .
|
int | getUnitIncrement() - Returns the value added or subtracted when the user activates the scrollbar
scroll by a "unit" amount.
|
int | getValue() - Returns the current value for this scrollbar.
|
boolean | getValueIsAdjusting() - Returns true if the value is in the process of changing.
|
int | getVisible() - This method is deprecated in favor of
getVisibleAmount() .
|
int | getVisibleAmount() - Returns the width of the scrollbar's thumb, in units relative to the
maximum and minimum value of the scrollbar.
|
protected String | paramString() - Returns a debugging string for this object.
|
protected void | processAdjustmentEvent(AdjustmentEvent event) - Processes adjustment events for this object by dispatching them to
any registered listeners.
|
protected void | processEvent(AWTEvent event) - Processes events for this scrollbar.
|
void | removeAdjustmentListener(AdjustmentListener listener) - Removes the specified listener from the list of registered listeners
for this object.
|
void | setBlockIncrement(int blockIncrement) - Sets the value added or subtracted to the scrollbar value when the
user selects the scroll by a "block" amount control.
|
void | setLineIncrement(int lineIncrement) - This method is deprecated in favor of
setUnitIncrement() .
|
void | setMaximum(int maximum) - Sets the maximum value for this scrollbar to the specified value.
|
void | setMinimum(int minimum) - Sets the minimum value for this scrollbar to the specified value.
|
void | setOrientation(int orientation) - Sets the orientation of this scrollbar to the specified value.
|
void | setPageIncrement(int pageIncrement) - This method is deprecated in favor of
setBlockIncrement() .
|
void | setUnitIncrement(int unitIncrement) - Sets the value added or subtracted to the scrollbar value when the
user selects the scroll by a "unit" amount control.
|
void | setValue(int value) - Sets the current value for this scrollbar to the specified value.
|
void | setValueIsAdjusting(boolean valueIsAdjusting) - Sets the value of valueIsAdjusting.
|
void | setValues(int value, int visibleAmount, int minimum, int maximum) - Sets the current value, visible amount, minimum, and maximum for this
scrollbar.
|
void | setVisibleAmount(int visibleAmount) - Sets the width of the scrollbar's thumb, in units relative to the
maximum and minimum value of the scrollbar.
|
action , add , addComponentListener , addFocusListener , addHierarchyBoundsListener , addHierarchyListener , addInputMethodListener , addKeyListener , addMouseListener , addMouseMotionListener , addMouseWheelListener , addNotify , addPropertyChangeListener , addPropertyChangeListener , applyComponentOrientation , areFocusTraversalKeysSet , bounds , checkImage , checkImage , coalesceEvents , contains , contains , createImage , createImage , createVolatileImage , createVolatileImage , deliverEvent , disable , disableEvents , dispatchEvent , doLayout , enable , enable , enableEvents , enableInputMethods , extends EventListener> T[] getListeners , firePropertyChange , firePropertyChange , firePropertyChange , firePropertyChange , firePropertyChange , firePropertyChange , firePropertyChange , firePropertyChange , firePropertyChange , getAccessibleContext , getAlignmentX , getAlignmentY , getBackground , getBounds , getBounds , getColorModel , getComponentAt , getComponentAt , getComponentListeners , getComponentOrientation , getCursor , getDropTarget , getFocusCycleRootAncestor , getFocusListeners , getFocusTraversalKeys , getFocusTraversalKeysEnabled , getFont , getFontMetrics , getForeground , getGraphics , getGraphicsConfiguration , getHeight , getHierarchyBoundsListeners , getHierarchyListeners , getIgnoreRepaint , getInputContext , getInputMethodListeners , getInputMethodRequests , getKeyListeners , getLocale , getLocation , getLocation , getLocationOnScreen , getMaximumSize , getMinimumSize , getMouseListeners , getMouseMotionListeners , getMouseWheelListeners , getName , getParent , getPeer , getPreferredSize , getPropertyChangeListeners , getPropertyChangeListeners , getSize , getSize , getToolkit , getTreeLock , getWidth , getX , getY , gotFocus , handleEvent , hasFocus , hide , imageUpdate , inside , invalidate , isBackgroundSet , isCursorSet , isDisplayable , isDoubleBuffered , isEnabled , isFocusCycleRoot , isFocusOwner , isFocusTraversable , isFocusable , isFontSet , isForegroundSet , isLightweight , isMaximumSizeSet , isMinimumSizeSet , isOpaque , isPreferredSizeSet , isShowing , isValid , isVisible , keyDown , keyUp , layout , list , list , list , list , list , locate , location , lostFocus , minimumSize , mouseDown , mouseDrag , mouseEnter , mouseExit , mouseMove , mouseUp , move , nextFocus , paint , paintAll , paramString , postEvent , preferredSize , prepareImage , prepareImage , print , printAll , processComponentEvent , processEvent , processFocusEvent , processHierarchyBoundsEvent , processHierarchyEvent , processInputMethodEvent , processKeyEvent , processMouseEvent , processMouseMotionEvent , processMouseWheelEvent , remove , removeComponentListener , removeFocusListener , removeHierarchyBoundsListener , removeHierarchyListener , removeInputMethodListener , removeKeyListener , removeMouseListener , removeMouseMotionListener , removeMouseWheelListener , removeNotify , removePropertyChangeListener , removePropertyChangeListener , repaint , repaint , repaint , repaint , requestFocus , requestFocus , requestFocusInWindow , requestFocusInWindow , reshape , resize , resize , setBackground , setBounds , setBounds , setComponentOrientation , setCursor , setDropTarget , setEnabled , setFocusTraversalKeys , setFocusTraversalKeysEnabled , setFocusable , setFont , setForeground , setIgnoreRepaint , setLocale , setLocation , setLocation , setMaximumSize , setMinimumSize , setName , setPreferredSize , setSize , setSize , setVisible , show , show , size , toString , transferFocus , transferFocusBackward , transferFocusUpCycle , update , validate |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
HORIZONTAL
public static final int HORIZONTAL
Constant indicating that a scrollbar is horizontal.
VERTICAL
public static final int VERTICAL
Constant indicating that a scrollbar is vertical.
Scrollbar
public Scrollbar()
Initializes a new instance of Scrollbar
with a
vertical orientation and default values for all other parameters.
Scrollbar
public Scrollbar(int orientation)
throws IllegalArgumentException
Initializes a new instance of Scrollbar
with the
specified orientation and default values for all other parameters.
The orientation must be either the constant HORIZONTAL
or
VERTICAL
from this class. An incorrect value will throw
an exception.
orientation
- The orientation of this scrollbar.
Scrollbar
public Scrollbar(int orientation,
int value,
int visibleAmount,
int minimum,
int maximum)
throws IllegalArgumentException
Initializes a new instance of Scrollbar
with the
specified parameters. The orientation must be either the constant
HORIZONTAL
or VERTICAL
. An incorrect value
will throw an exception. Inconsistent values for other parameters
are silently corrected to valid values.
orientation
- The orientation of this scrollbar.value
- The initial value of the scrollbar.visibleAmount
- The width of the scrollbar thumb.minimum
- The minimum value of the scrollbar.maximum
- The maximum value of the scrollbar.
extends EventListener> T[] getListeners
public extends EventListener> T[] getListeners(Class listenerType)
Returns an array of all the objects currently registered as FooListeners
upon this Scrollbar
. FooListeners are registered using the
addFooListener method.
- extends EventListener> T[] getListeners in interface Component
ClassCastException
- If listenerType doesn't specify a class or
interface that implements java.util.EventListener.
getLineIncrement
public int getLineIncrement()
This method is deprecated in favor of
getUnitIncrement()
.
Returns the value added or subtracted when the user selects the scrollbar
scroll by a "unit" amount control.
- The unit increment value.
getMaximum
public int getMaximum()
Returns the maximum value for this scrollbar.
- getMaximum in interface Adjustable
- The maximum value for this scrollbar.
getMinimum
public int getMinimum()
Returns the minimum value for this scrollbar.
- getMinimum in interface Adjustable
- The minimum value for this scrollbar.
getPageIncrement
public int getPageIncrement()
This method is deprecated in favor of
getBlockIncrement()
.
Returns the value added or subtracted when the user selects the scrollbar
scroll by a "block" amount control.
- The block increment value.
getUnitIncrement
public int getUnitIncrement()
Returns the value added or subtracted when the user activates the scrollbar
scroll by a "unit" amount.
- getUnitIncrement in interface Adjustable
- The unit increment value.
getValue
public int getValue()
Returns the current value for this scrollbar.
- getValue in interface Adjustable
- The current value for this scrollbar.
getValueIsAdjusting
public boolean getValueIsAdjusting()
Returns true if the value is in the process of changing.
getVisible
public int getVisible()
This method is deprecated in favor of
getVisibleAmount()
.
Returns the width of the scrollbar's thumb, in units relative to the
maximum and minimum value of the scrollbar.
- The width of the scrollbar's thumb.
getVisibleAmount
public int getVisibleAmount()
Returns the width of the scrollbar's thumb, in units relative to the
maximum and minimum value of the scrollbar.
- getVisibleAmount in interface Adjustable
- The width of the scrollbar's thumb.
processAdjustmentEvent
protected void processAdjustmentEvent(AdjustmentEvent event)
Processes adjustment events for this object by dispatching them to
any registered listeners. Note that this method will only be called
if adjustment events are enabled. This will happen automatically if
any listeners are registered. Otherwise, it can be enabled by a
call to enableEvents()
.
event
- The event to process.
processEvent
protected void processEvent(AWTEvent event)
Processes events for this scrollbar. It does this by calling
processAdjustmentEvent()
if the event is an instance of
AdjustmentEvent
, otherwise it calls the superclass to
process the event.
- processEvent in interface Component
event
- The event to process.
setBlockIncrement
public void setBlockIncrement(int blockIncrement)
Sets the value added or subtracted to the scrollbar value when the
user selects the scroll by a "block" amount control.
- setBlockIncrement in interface Adjustable
blockIncrement
- The new block increment amount.
setLineIncrement
public void setLineIncrement(int lineIncrement)
This method is deprecated in favor of
setUnitIncrement()
.
Sets the value added or subtracted to the scrollbar value when the
user selects the scroll by a "unit" amount control.
lineIncrement
- The new unit increment amount.
setMaximum
public void setMaximum(int maximum)
Sets the maximum value for this scrollbar to the specified value.
If the value is less than the current minimum value, it is silent
set to equal the minimum value.
- setMaximum in interface Adjustable
maximum
- The new maximum value for this scrollbar.
setMinimum
public void setMinimum(int minimum)
Sets the minimum value for this scrollbar to the specified value. If
this is not consistent with the current value and maximum, it is
silently adjusted to be consistent.
- setMinimum in interface Adjustable
minimum
- The new minimum value for this scrollbar.
setOrientation
public void setOrientation(int orientation)
Sets the orientation of this scrollbar to the specified value. This
value must be either the constant HORIZONTAL
or
VERTICAL
from this class or an exception will be thrown.
orientation
- The new orientation value.
setPageIncrement
public void setPageIncrement(int pageIncrement)
This method is deprecated in favor of
setBlockIncrement()
.
Sets the value added or subtracted to the scrollbar value when the
user selects the scroll by a "block" amount control.
pageIncrement
- The new block increment amount.
setUnitIncrement
public void setUnitIncrement(int unitIncrement)
Sets the value added or subtracted to the scrollbar value when the
user selects the scroll by a "unit" amount control.
- setUnitIncrement in interface Adjustable
unitIncrement
- The new unit increment amount.
setValue
public void setValue(int value)
Sets the current value for this scrollbar to the specified value.
If this is inconsistent with the minimum and maximum values for this
scrollbar, the value is silently adjusted.
- setValue in interface Adjustable
value
- The new value for this scrollbar.
setValueIsAdjusting
public void setValueIsAdjusting(boolean valueIsAdjusting)
Sets the value of valueIsAdjusting.
setValues
public void setValues(int value,
int visibleAmount,
int minimum,
int maximum)
Sets the current value, visible amount, minimum, and maximum for this
scrollbar. These values are adjusted to be internally consistent
if necessary.
value
- The new value for this scrollbar.visibleAmount
- The new visible amount for this scrollbar.minimum
- The new minimum value for this scrollbar.maximum
- The new maximum value for this scrollbar.
setVisibleAmount
public void setVisibleAmount(int visibleAmount)
Sets the width of the scrollbar's thumb, in units relative to the
maximum and minimum value of the scrollbar.
- setVisibleAmount in interface Adjustable
visibleAmount
- The new visible amount value of the scrollbar.
Scrollbar.java -- AWT Scrollbar widget
Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.