|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Scrollbar
Unsafe:
| Field Summary | |
(package private) AdjustmentListener |
adjustmentListener
|
private static String |
base
|
static int |
HORIZONTAL
Enabled: A constant that indicates a horizontal scroll bar. |
(package private) boolean |
isAdjusting
The adjusting status of the Scrollbar. |
(package private) int |
lineIncrement
The amount by which the scrollbar value will change when going up or down by a line. |
(package private) int |
maximum
The maximum value of the Scrollbar. |
(package private) int |
minimum
The minimum value of the Scrollbar. |
private static int |
nameCounter
|
(package private) int |
orientation
The Scrollbar's orientation--being either horizontal
or vertical. |
(package private) int |
pageIncrement
The amount by which the scrollbar value will change when going up or down by a page. |
private int |
scrollbarSerializedDataVersion
The scrollbars serialized Data Version. |
private static long |
serialVersionUID
|
(package private) int |
value
The value of the Scrollbar. |
static int |
VERTICAL
Enabled: A constant that indicates a vertical scroll bar. |
(package private) int |
visibleAmount
The size of the visible portion of the Scrollbar. |
| Fields inherited from interface java.awt.Adjustable |
NO_ORIENTATION |
| Constructor Summary | |
Scrollbar()
Suppressed: Constructs a new vertical scroll bar. |
|
Scrollbar(int orientation)
Suppressed: Constructs a new scroll bar with the specified orientation. |
|
Scrollbar(int orientation,
int value,
int visible,
int minimum,
int maximum)
Suppressed: Constructs a new scroll bar with the specified orientation, initial value, visible amount, and minimum and maximum values. |
|
| Method Summary | |
void |
addAdjustmentListener(AdjustmentListener l)
Suppressed: Adds the specified adjustment listener to receive instances of AdjustmentEvent from this scroll bar. |
void |
addNotify()
Suppressed: Creates the Scrollbar's peer. |
(package private) String |
constructComponentName()
Constructs a name for this component. |
(package private) boolean |
eventEnabled(AWTEvent e)
|
AccessibleContext |
getAccessibleContext()
Suppressed: Gets the AccessibleContext associated with this
Scrollbar. |
AdjustmentListener[] |
getAdjustmentListeners()
Suppressed: Returns an array of all the adjustment listeners registered on this scrollbar. |
int |
getBlockIncrement()
Suppressed: Gets the block increment of this scroll bar. |
int |
getLineIncrement()
Suppressed: @deprecated As of JDK version 1.1, replaced by getUnitIncrement(). |
EventListener[] |
getListeners(Class listenerType)
Suppressed: Returns an array of all the objects currently registered as FooListeners
upon this Scrollbar. |
int |
getMaximum()
Suppressed: Gets the maximum value of this scroll bar. |
int |
getMinimum()
Suppressed: Gets the minimum value of this scroll bar. |
int |
getOrientation()
Suppressed: Returns the orientation of this scroll bar. |
int |
getPageIncrement()
Suppressed: @deprecated As of JDK version 1.1, replaced by getBlockIncrement(). |
int |
getUnitIncrement()
Suppressed: Gets the unit increment for this scrollbar. |
int |
getValue()
Suppressed: Gets the current value of this scroll bar. |
boolean |
getValueIsAdjusting()
Suppressed: Returns true if the value is in the process of changing as a result of actions being taken by the user. |
int |
getVisible()
Suppressed: @deprecated As of JDK version 1.1, replaced by getVisibleAmount(). |
int |
getVisibleAmount()
Suppressed: Gets the visible amount of this scroll bar. |
private static void |
initIDs()
Initialize JNI field and method IDs. |
protected String |
paramString()
Returns a string representing the state of this Scrollbar. |
protected void |
processAdjustmentEvent(AdjustmentEvent e)
Processes adjustment events occurring on this scrollbar by dispatching them to any registered AdjustmentListener objects. |
protected void |
processEvent(AWTEvent e)
Processes events on this scroll bar. |
private void |
readObject(ObjectInputStream s)
Reads the ObjectInputStream and if
it isn't null adds a listener to
receive adjustment events fired by the
Scrollbar. |
void |
removeAdjustmentListener(AdjustmentListener l)
Suppressed: Removes the specified adjustment listener so that it no longer receives instances of AdjustmentEvent from this scroll bar. |
void |
setBlockIncrement(int v)
Suppressed: Sets the block increment for this scroll bar. |
void |
setLineIncrement(int v)
Suppressed: @deprecated As of JDK version 1.1, replaced by setUnitIncrement(int). |
void |
setMaximum(int newMaximum)
Suppressed: Sets the maximum value of this scroll bar. |
void |
setMinimum(int newMinimum)
Suppressed: Sets the minimum value of this scroll bar. |
void |
setOrientation(int orientation)
Suppressed: Sets the orientation for this scroll bar. |
void |
setPageIncrement(int v)
Suppressed: @deprecated As of JDK version 1.1, replaced by setBlockIncrement(). |
void |
setUnitIncrement(int v)
Suppressed: Sets the unit increment for this scroll bar. |
void |
setValue(int newValue)
Suppressed: Sets the value of this scroll bar to the specified value. |
void |
setValueIsAdjusting(boolean b)
Suppressed: Sets the valueIsAdjusting property. |
void |
setValues(int value,
int visible,
int minimum,
int maximum)
Suppressed: Sets the values of four properties for this scroll bar: value, visibleAmount,
minimum, and maximum. |
void |
setVisibleAmount(int newAmount)
Suppressed: Sets the visible amount of this scroll bar. |
private void |
writeObject(ObjectOutputStream s)
Writes default serializable fields to stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int HORIZONTAL
public static final int VERTICAL
int value
Scrollbar.
This property must be greater than or equal to minimum
and less than or equal to
maximum - visibleAmount
getValue(),
setValue(int)int maximum
Scrollbar.
This value must be greater than the minimum
value.
getMaximum(),
setMaximum(int)int minimum
Scrollbar.
This value must be less than the maximum
value.
getMinimum(),
setMinimum(int)int visibleAmount
Scrollbar.
This parameter is normally used to indicate the range of
values that are currently visible.
getVisibleAmount(),
setVisibleAmount(int)int orientation
Scrollbar's orientation--being either horizontal
or vertical.
This value should be specified when the scrollbar is created.VERTICAL or
HORIZONTAL only.
getOrientation(),
setOrientation(int)int lineIncrement
getLineIncrement(),
setLineIncrement(int)int pageIncrement
getPageIncrement(),
setPageIncrement(int)transient boolean isAdjusting
Scrollbar.
True if the value is in the process of changing as a result of
actions being taken by the user.
getValueIsAdjusting(),
setValueIsAdjusting(boolean)transient AdjustmentListener adjustmentListener
private static final String base
private static int nameCounter
private static final long serialVersionUID
private int scrollbarSerializedDataVersion
| Constructor Detail |
public Scrollbar()
throws HeadlessException
| Property | Description | Default Value |
|---|---|---|
| orientation | indicates if the scroll bar is vertical or horizontal | Scrollbar.VERTICAL |
| value | value which controls the location
of the scroll bar bubble |
0 |
| minimum | minimum value of the scroll bar | 0 |
| maximum | maximum value of the scroll bar | 100 |
| unit increment | amount the value changes when the
Line Up or Line Down key is pressed, or when the end arrows of the scrollbar are clicked |
1 |
| block increment | amount the value changes when the
Page Up or Page Down key is pressed, or when the scrollbar track is clicked on either side of the bubble |
10 |
java.awt.GraphicsEnvironment#isHeadless
public Scrollbar(int orientation)
throws HeadlessException
The orientation argument must take one of the two
values Scrollbar.HORIZONTAL,
or Scrollbar.VERTICAL,
indicating a horizontal or vertical scroll bar, respectively.
orientation - indicates the orientation of the scroll barjava.awt.GraphicsEnvironment#isHeadless
public Scrollbar(int orientation,
int value,
int visible,
int minimum,
int maximum)
throws HeadlessException
The orientation argument must take one of the two
values Scrollbar.HORIZONTAL,
or Scrollbar.VERTICAL,
indicating a horizontal or vertical scroll bar, respectively.
The parameters supplied to this constructor are subject to the
constraints described in setValues(int, int, int, int).
orientation - indicates the orientation of the scroll bar.value - the initial value of the scroll barvisible - the size of the scroll bar's bubble, representing
the visible portion.minimum - the minimum value of the scroll barmaximum - the maximum value of the scroll barsetValues(int, int, int, int),
java.awt.GraphicsEnvironment#isHeadless| Method Detail |
private static void initIDs()
String constructComponentName()
getName
when the name is null.
constructComponentName in class Componentpublic void addNotify()
Scrollbar's peer. The peer allows you to modify
the appearance of the Scrollbar without changing any of its
functionality.
addNotify in class ComponentComponent.isDisplayable(),
Component.removeNotify()public int getOrientation()
getOrientation in interface AdjustableScrollbar.HORIZONTAL or
Scrollbar.VERTICALjava.awt.Scrollbar#setOrientationpublic void setOrientation(int orientation)
java.awt.Scrollbar#getOrientationpublic int getValue()
getValue in interface Adjustablejava.awt.Scrollbar#getMinimum,
java.awt.Scrollbar#getMaximumpublic void setValue(int newValue)
If the value supplied is less than the current minimum
or greater than the current
maximum - visibleAmount, then one of
those values is substituted, as appropriate.
Normally, a program should change a scroll bar's
value only by calling setValues.
The setValues method simultaneously
and synchronously sets the minimum, maximum, visible amount,
and value properties of a scroll bar, so that they are
mutually consistent.
setValue in interface AdjustablenewValue - the new value of the scroll barjava.awt.Scrollbar#setValues,
java.awt.Scrollbar#getValue,
java.awt.Scrollbar#getMinimum,
java.awt.Scrollbar#getMaximumpublic int getMinimum()
getMinimum in interface Adjustablejava.awt.Scrollbar#getValue,
java.awt.Scrollbar#getMaximumpublic void setMinimum(int newMinimum)
When setMinimum is called, the limiting argument takes
precedence over the existing scrollbar value.
Normally, a program should change a scroll bar's minimum
value only by calling setValues.
The setValues method simultaneously
and synchronously sets the minimum, maximum, visible amount,
and value properties of a scroll bar, so that they are
mutually consistent.
Note that setting the minimum value to Integer.MIN_VALUE
will result in the new minimum value to be set to
Integer.MIN_VALUE - 1.
setMinimum in interface AdjustablenewMinimum - the new minimum value for this scroll barjava.awt.Scrollbar#setValues,
java.awt.Scrollbar#setMaximumpublic int getMaximum()
getMaximum in interface Adjustablejava.awt.Scrollbar#getValue,
java.awt.Scrollbar#getMinimumpublic void setMaximum(int newMaximum)
When setMaximum is called, the limiting
argument takes precedence over the existing scrollbar
value.
Normally, a program should change a scroll bar's maximum
value only by calling setValues.
The setValues method simultaneously
and synchronously sets the minimum, maximum, visible amount,
and value properties of a scroll bar, so that they are
mutually consistent.
setMaximum in interface AdjustablenewMaximum - the new maximum value
for this scroll barjava.awt.Scrollbar#setValues,
java.awt.Scrollbar#setMinimumpublic int getVisibleAmount()
The visible amount of a scroll bar is the range of values represented by the width of the scroll bar's bubble.
getVisibleAmount in interface Adjustablejava.awt.Scrollbar#setVisibleAmountpublic int getVisible()
getVisibleAmount().
public void setVisibleAmount(int newAmount)
The visible amount of a scroll bar is the range of values represented by the width of the scroll bar's bubble.
Normally, a program should change a scroll bar's
value only by calling setValues.
The setValues method simultaneously
and synchronously sets the minimum, maximum, visible amount,
and value properties of a scroll bar, so that they are
mutually consistent.
setVisibleAmount in interface AdjustablenewAmount - the amount visible per pagejava.awt.Scrollbar#getVisibleAmount,
java.awt.Scrollbar#setValuespublic void setUnitIncrement(int v)
The unit increment is the value that is added (subtracted) when the user activates the unit increment area of the scroll bar, generally through a mouse or keyboard gesture that the scroll bar receives as an adjustment event.
setUnitIncrement in interface Adjustablev - the amount by which to increment or decrement
the scroll bar's valuejava.awt.Scrollbar#getUnitIncrementpublic void setLineIncrement(int v)
setUnitIncrement(int).
public int getUnitIncrement()
The unit increment is the value that is added (subtracted) when the user activates the unit increment area of the scroll bar, generally through a mouse or keyboard gesture that the scroll bar receives as an adjustment event.
getUnitIncrement in interface Adjustablejava.awt.Scrollbar#setUnitIncrementpublic int getLineIncrement()
getUnitIncrement().
public void setBlockIncrement(int v)
The block increment is the value that is added (subtracted) when the user activates the block increment area of the scroll bar, generally through a mouse or keyboard gesture that the scroll bar receives as an adjustment event.
setBlockIncrement in interface Adjustablev - the amount by which to increment or decrement
the scroll bar's valuejava.awt.Scrollbar#getBlockIncrementpublic void setPageIncrement(int v)
setBlockIncrement().
public int getBlockIncrement()
The block increment is the value that is added (subtracted) when the user activates the block increment area of the scroll bar, generally through a mouse or keyboard gesture that the scroll bar receives as an adjustment event.
getBlockIncrement in interface Adjustablejava.awt.Scrollbar#setBlockIncrementpublic int getPageIncrement()
getBlockIncrement().
public void setValues(int value,
int visible,
int minimum,
int maximum)
value, visibleAmount,
minimum, and maximum.
If the values supplied for these properties are inconsistent
or incorrect, they will be changed to ensure consistency.
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
following constraints:
maximum must be greater than minimum,
visibleAmount must be positive,
visibleAmount must not be greater than
maximum - minimum,
value must not be less than minimum,
and value must not be greater than
maximum - visibleAmount
value - is the position in the current windowvisible - is the amount visible per pageminimum - is the minimum value of the scroll barmaximum - is the maximum value of the scroll barsetMinimum(int),
setMaximum(int),
setVisibleAmount(int),
setValue(int)public boolean getValueIsAdjusting()
valueIsAdjusting propertysetValueIsAdjusting(boolean)public void setValueIsAdjusting(boolean b)
valueIsAdjusting property.
b - new adjustment-in-progress statusgetValueIsAdjusting()public void addAdjustmentListener(AdjustmentListener l)
AdjustmentEvent from this scroll bar.
If l is null, no exception is thrown and no
action is performed.
addAdjustmentListener in interface Adjustablel - the adjustment listenerremoveAdjustmentListener(java.awt.event.AdjustmentListener),
getAdjustmentListeners(),
java.awt.event.AdjustmentEvent,
java.awt.event.AdjustmentListenerpublic void removeAdjustmentListener(AdjustmentListener l)
AdjustmentEvent from this scroll bar.
If l is null, no exception is thrown and no action
is performed.
removeAdjustmentListener in interface Adjustablel - the adjustment listeneraddAdjustmentListener(java.awt.event.AdjustmentListener),
getAdjustmentListeners(),
java.awt.event.AdjustmentEvent,
java.awt.event.AdjustmentListenerpublic AdjustmentListener[] getAdjustmentListeners()
AdjustmentListeners
or an empty array if no adjustment
listeners are currently registeredaddAdjustmentListener(java.awt.event.AdjustmentListener),
removeAdjustmentListener(java.awt.event.AdjustmentListener),
java.awt.event.AdjustmentEvent,
java.awt.event.AdjustmentListenerpublic EventListener[] getListeners(Class listenerType)
FooListeners
upon this Scrollbar.
FooListeners are registered using the
addFooListener method.
You can specify the listenerType argument
with a class literal, such as
FooListener.class.
For example, you can query a
Scrollbar c
for its mouse listeners with the following code:
MouseListener[] mls = (MouseListener[])(c.getListeners(MouseListener.class));If no such listeners exist, this method returns an empty array.
getListeners in class ComponentlistenerType - the type of listeners requested; this parameter
should specify an interface that descends from
java.util.EventListener
FooListeners on this component,
or an empty array if no such listeners have been addedComponent.getComponentListeners(),
Component.getFocusListeners(),
Component.getHierarchyListeners(),
Component.getHierarchyBoundsListeners(),
Component.getKeyListeners(),
Component.getMouseListeners(),
Component.getMouseMotionListeners(),
Component.getMouseWheelListeners(),
Component.getInputMethodListeners(),
Component.getPropertyChangeListeners()boolean eventEnabled(AWTEvent e)
eventEnabled in class Componentprotected void processEvent(AWTEvent e)
AdjustmentEvent, it invokes the
processAdjustmentEvent method.
Otherwise, it invokes its superclass's
processEvent method.
Note that if the event parameter is null
the behavior is unspecified and may result in an
exception.
processEvent in class Componente - the eventjava.awt.event.AdjustmentEvent,
java.awt.Scrollbar#processAdjustmentEventprotected void processAdjustmentEvent(AdjustmentEvent e)
AdjustmentListener objects.
This method is not called unless adjustment events are enabled for this component. Adjustment events are enabled when one of the following occurs:
AdjustmentListener object is registered
via addAdjustmentListener.
enableEvents.
Note that if the event parameter is null
the behavior is unspecified and may result in an
exception.
e - the adjustment eventjava.awt.event.AdjustmentEvent,
java.awt.event.AdjustmentListener,
java.awt.Scrollbar#addAdjustmentListener,
java.awt.Component#enableEventsprotected String paramString()
Scrollbar.
This method is intended to be used only for debugging purposes, and the
content and format of the returned string may vary between
implementations. The returned string may be empty but may not be
null.
paramString in class Component
private void writeObject(ObjectOutputStream s)
throws IOException
AdjustmentListeners
as optional data. The non-serializable listeners are
detected and no attempt is made to serialize them.
s - the ObjectOutputStream to write
IOExceptionAWTEventMulticaster.save(ObjectOutputStream, String, EventListener),
java.awt.Component.adjustmentListenerK,
writeObject(java.io.ObjectOutputStream)
private void readObject(ObjectInputStream s)
throws ClassNotFoundException,
IOException,
HeadlessException
ObjectInputStream and if
it isn't null adds a listener to
receive adjustment events fired by the
Scrollbar.
Unrecognized keys or values will be ignored.
s - the ObjectInputStream to read
ClassNotFoundException
IOException
HeadlessExceptionjava.awt.GraphicsEnvironment#isHeadless,
writeObject(java.io.ObjectOutputStream)public AccessibleContext getAccessibleContext()
AccessibleContext associated with this
Scrollbar. For scrollbars, the
AccessibleContext takes the form of an
AccessibleAWTScrollBar. A new
AccessibleAWTScrollBar instance is created if necessary.
getAccessibleContext in interface AccessiblegetAccessibleContext in class ComponentAccessibleAWTScrollBar that serves as the
AccessibleContext of this ScrollBar
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||