APIdia Launch Partner
Top Description Fields Constructors Methods
java.awt

public final Class ScrollPaneAdjustable

extends Object
implements Adjustable, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.awt.Adjustable
Imports
java.awt.event.AdjustmentEvent, .AdjustmentListener, java.awt.peer.ScrollPanePeer, java.io.Serial, .Serializable, sun.awt.AWTAccessor

This class represents the state of a horizontal or vertical scrollbar of a ScrollPane. Objects of this class are returned by ScrollPane methods.
Since
1.4

Field Summary

Modifier and TypeField and Description
private AdjustmentListener
private int
blockIncrement

The amount by which the scrollbar value will change when going up or down by a page.

private transient boolean
isAdjusting

The adjusting status of the Scrollbar.

private int
maximum

The maximum value of this scrollbar.

private int
minimum

The minimum value of this scrollbar.

private int
orientation

Orientation of this scrollbar.

private static final String
SCROLLPANE_ONLY

Error message for AWTError reported when one of the public but unsupported methods is called.

private static final long
serialVersionUID

Use serialVersionUID from JDK 1.1 for interoperability.

private ScrollPane
sp

The ScrollPane this object is a scrollbar of.

private int
unitIncrement

The amount by which the scrollbar value will change when going up or down by a line.

private int
value

The value of this scrollbar.

private int
visibleAmount

The size of the visible portion of this scrollbar.

Constructor Summary

AccessConstructor and Description
pack-priv
ScrollPaneAdjustable(ScrollPane
ScrollPane
sp
,
AdjustmentListener
AdjustmentListener to add upon creation.
l
,
int
specifies which scrollbar this object represents, can be either Adjustable.HORIZONTAL or Adjustable.VERTICAL.
orientation
)

Constructs a new object to represent specified scrollabar of the specified ScrollPane.

Method Summary

Modifier and TypeMethod and Description
public synchronized void
addAdjustmentListener(AdjustmentListener
the adjustment listener.
l
)

Implements java.awt.Adjustable.addAdjustmentListener.

Adds the specified adjustment listener to receive adjustment events from this ScrollPaneAdjustable.

public synchronized AdjustmentListener[]

Returns:

all of this ScrollPaneAdjustable's AdjustmentListeners or an empty array if no adjustment listeners are currently registered
getAdjustmentListeners
()

Returns an array of all the adjustment listeners registered on this ScrollPaneAdjustable.

public int
getBlockIncrement()

Implements java.awt.Adjustable.getBlockIncrement.

Gets the block value increment for the adjustable object.

public int
getMaximum()

Implements java.awt.Adjustable.getMaximum.

Gets the maximum value of the adjustable object.

public int
getMinimum()

Implements java.awt.Adjustable.getMinimum.

Gets the minimum value of the adjustable object.

public int

Returns:

the orientation of this scrollbar, either Adjustable.HORIZONTAL or Adjustable.VERTICAL
getOrientation
()

Implements java.awt.Adjustable.getOrientation.

Returns the orientation of this scrollbar.

public int
getUnitIncrement()

Implements java.awt.Adjustable.getUnitIncrement.

Gets the unit value increment for the adjustable object.

public int
getValue()

Implements java.awt.Adjustable.getValue.

Gets the current value of the adjustable object.

public boolean

Returns:

the value of the valueIsAdjusting property
getValueIsAdjusting
()

Returns true if the value is in the process of changing as a result of actions being taken by the user.

public int
getVisibleAmount()

Implements java.awt.Adjustable.getVisibleAmount.

Gets the length of the proportional indicator.

private static native void
initIDs()

Initialize JNI field and method ids.

public String

Returns:

the parameter string of this scrollbar.
paramString
()

Returns a string representing the state of this scrollbar.

public synchronized void
removeAdjustmentListener(AdjustmentListener
the adjustment listener.
l
)

Implements java.awt.Adjustable.removeAdjustmentListener.

Removes the specified adjustment listener so that it no longer receives adjustment events from this ScrollPaneAdjustable.

public synchronized void
setBlockIncrement(int b)

Implements java.awt.Adjustable.setBlockIncrement.

Sets the block value increment for the adjustable object.

public void
setMaximum(int max)

Implements java.awt.Adjustable.setMaximum.

This method should NOT be called by user code.

public void
setMinimum(int min)

Implements java.awt.Adjustable.setMinimum.

This method should NOT be called by user code.

pack-priv void
setSpan(int min, int max, int visible)

This is called by the scrollpane itself to update the minimum, maximum and visible values.

private void
setTypedValue(int
the new value of the scrollbar
v
,
int
the type of the scrolling operation occurred
type
)

Sets the value of this scrollbar to the specified value.

public synchronized void
setUnitIncrement(int u)

Implements java.awt.Adjustable.setUnitIncrement.

Sets the unit value increment for the adjustable object.

public void
setValue(int
the new value of the scrollbar
v
)

Implements java.awt.Adjustable.setValue.

Sets the value of this scrollbar to the specified value.

public void
setValueIsAdjusting(boolean
new adjustment-in-progress status
b
)

Sets the valueIsAdjusting property.

public void
setVisibleAmount(int v)

Implements java.awt.Adjustable.setVisibleAmount.

This method should NOT be called by user code.

public String

Returns:

a string representation of this scrollbar.
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of this scrollbar and its values.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

adjustmentListenerback to summary
private AdjustmentListener adjustmentListener
Annotations
@SuppressWarnings:serial
blockIncrementback to summary
private int blockIncrement

The amount by which the scrollbar value will change when going up or down by a page. This value should be a non negative integer.

See Also
getBlockIncrement, setBlockIncrement
isAdjustingback to summary
private transient boolean isAdjusting

The adjusting status of the Scrollbar. True if the value is in the process of changing as a result of actions being taken by the user.

Since
1.4
See Also
getValueIsAdjusting, setValueIsAdjusting
maximumback to summary
private int maximum

The maximum value of this scrollbar. This value can only be set by the ScrollPane.

See Also
getMaximum, setSpan(int, int, int)
minimumback to summary
private int minimum

The minimum value of this scrollbar. This value can only be set by the ScrollPane.

ATTN: In current implementation minimum is always 0. This field can only be altered via setSpan method and ScrollPane always calls that method with 0 for the minimum. getMinimum method always returns 0 without checking this field.

See Also
getMinimum, setSpan(int, int, int)
orientationback to summary
private int orientation

Orientation of this scrollbar.

See Also
getOrientation, java.awt.Adjustable#HORIZONTAL, java.awt.Adjustable#VERTICAL
SCROLLPANE_ONLYback to summary
private static final String SCROLLPANE_ONLY

Error message for AWTError reported when one of the public but unsupported methods is called.

serialVersionUIDback to summary
private static final long serialVersionUID

Use serialVersionUID from JDK 1.1 for interoperability.

Annotations
@Serial
spback to summary
private ScrollPane sp

The ScrollPane this object is a scrollbar of.

unitIncrementback to summary
private int unitIncrement

The amount by which the scrollbar value will change when going up or down by a line. This value should be a non negative integer.

See Also
getUnitIncrement, setUnitIncrement
valueback to summary
private int value

The value of this scrollbar. value should be greater than minimum and less than maximum

See Also
getValue, setValue
visibleAmountback to summary
private int visibleAmount

The size of the visible portion of this scrollbar. This value can only be set by the ScrollPane.

See Also
getVisibleAmount, setSpan(int, int, int)

Constructor Detail

ScrollPaneAdjustableback to summary
pack-priv ScrollPaneAdjustable(ScrollPane sp, AdjustmentListener l, int orientation)

Constructs a new object to represent specified scrollabar of the specified ScrollPane. Only ScrollPane creates instances of this class.

Parameters
sp:ScrollPane

ScrollPane

l:AdjustmentListener

AdjustmentListener to add upon creation.

orientation:int

specifies which scrollbar this object represents, can be either Adjustable.HORIZONTAL or Adjustable.VERTICAL.

Method Detail

addAdjustmentListenerback to summary
public synchronized void addAdjustmentListener(AdjustmentListener l)

Implements java.awt.Adjustable.addAdjustmentListener.

Adds the specified adjustment listener to receive adjustment events from this ScrollPaneAdjustable. If l is null, no exception is thrown and no action is performed.

Refer to AWT Threading Issues for details on AWT's threading model.

Parameters
l:AdjustmentListener

the adjustment listener.

See Also
removeAdjustmentListener, getAdjustmentListeners, java.awt.event.AdjustmentListener, java.awt.event.AdjustmentEvent
getAdjustmentListenersback to summary
public synchronized AdjustmentListener[] getAdjustmentListeners()

Returns an array of all the adjustment listeners registered on this ScrollPaneAdjustable.

Returns:AdjustmentListener[]

all of this ScrollPaneAdjustable's AdjustmentListeners or an empty array if no adjustment listeners are currently registered

Since
1.4
See Also
addAdjustmentListener, removeAdjustmentListener, java.awt.event.AdjustmentListener, java.awt.event.AdjustmentEvent
getBlockIncrementback to summary
public int getBlockIncrement()

Implements java.awt.Adjustable.getBlockIncrement.

Doc from java.awt.Adjustable.getBlockIncrement.

Gets the block value increment for the adjustable object.

getMaximumback to summary
public int getMaximum()

Implements java.awt.Adjustable.getMaximum.

Doc from java.awt.Adjustable.getMaximum.

Gets the maximum value of the adjustable object.

getMinimumback to summary
public int getMinimum()

Implements java.awt.Adjustable.getMinimum.

Doc from java.awt.Adjustable.getMinimum.

Gets the minimum value of the adjustable object.

getOrientationback to summary
public int getOrientation()

Implements java.awt.Adjustable.getOrientation.

Returns the orientation of this scrollbar.

Returns:int

the orientation of this scrollbar, either Adjustable.HORIZONTAL or Adjustable.VERTICAL

getUnitIncrementback to summary
public int getUnitIncrement()

Implements java.awt.Adjustable.getUnitIncrement.

Doc from java.awt.Adjustable.getUnitIncrement.

Gets the unit value increment for the adjustable object.

getValueback to summary
public int getValue()

Implements java.awt.Adjustable.getValue.

Doc from java.awt.Adjustable.getValue.

Gets the current value of the adjustable object.

getValueIsAdjustingback to summary
public boolean getValueIsAdjusting()

Returns true if the value is in the process of changing as a result of actions being taken by the user.

Returns:boolean

the value of the valueIsAdjusting property

See Also
setValueIsAdjusting
getVisibleAmountback to summary
public int getVisibleAmount()

Implements java.awt.Adjustable.getVisibleAmount.

Doc from java.awt.Adjustable.getVisibleAmount.

Gets the length of the proportional indicator.

initIDsback to summary
private static native void initIDs()

Initialize JNI field and method ids.

paramStringback to summary
public String paramString()

Returns a string representing the state of this 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.

Returns:String

the parameter string of this scrollbar.

removeAdjustmentListenerback to summary
public synchronized void removeAdjustmentListener(AdjustmentListener l)

Implements java.awt.Adjustable.removeAdjustmentListener.

Removes the specified adjustment listener so that it no longer receives adjustment events from this ScrollPaneAdjustable. If l is null, no exception is thrown and no action is performed.

Refer to AWT Threading Issues for details on AWT's threading model.

Parameters
l:AdjustmentListener

the adjustment listener.

Since
1.1
See Also
addAdjustmentListener, getAdjustmentListeners, java.awt.event.AdjustmentListener, java.awt.event.AdjustmentEvent
setBlockIncrementback to summary
public synchronized void setBlockIncrement(int b)

Implements java.awt.Adjustable.setBlockIncrement.

Doc from java.awt.Adjustable.setBlockIncrement.

Sets the block value increment for the adjustable object.

setMaximumback to summary
public void setMaximum(int max)

Implements java.awt.Adjustable.setMaximum.

This method should NOT be called by user code. This method is public for this class to properly implement Adjustable interface.

Exceptions
AWTError:
Always throws an error when called.
setMinimumback to summary
public void setMinimum(int min)

Implements java.awt.Adjustable.setMinimum.

This method should NOT be called by user code. This method is public for this class to properly implement Adjustable interface.

Exceptions
AWTError:
Always throws an error when called.
setSpanback to summary
pack-priv void setSpan(int min, int max, int visible)

This is called by the scrollpane itself to update the minimum, maximum and visible values. The scrollpane is the only one that should be changing these since it is the source of these values.

setTypedValueback to summary
private void setTypedValue(int v, int type)

Sets the value of this scrollbar to the specified value.

If the value supplied is less than the current minimum or greater than the current maximum, then one of those values is substituted, as appropriate. Also, creates and dispatches the AdjustmentEvent with specified type and value.

Parameters
v:int

the new value of the scrollbar

type:int

the type of the scrolling operation occurred

setUnitIncrementback to summary
public synchronized void setUnitIncrement(int u)

Implements java.awt.Adjustable.setUnitIncrement.

Doc from java.awt.Adjustable.setUnitIncrement.

Sets the unit value increment for the adjustable object.

setValueback to summary
public void setValue(int v)

Implements java.awt.Adjustable.setValue.

Sets the value of this scrollbar to the specified value.

If the value supplied is less than the current minimum or greater than the current maximum, then one of those values is substituted, as appropriate.

Parameters
v:int

the new value of the scrollbar

setValueIsAdjustingback to summary
public void setValueIsAdjusting(boolean b)

Sets the valueIsAdjusting property.

Parameters
b:boolean

new adjustment-in-progress status

Since
1.4
See Also
getValueIsAdjusting
setVisibleAmountback to summary
public void setVisibleAmount(int v)

Implements java.awt.Adjustable.setVisibleAmount.

This method should NOT be called by user code. This method is public for this class to properly implement Adjustable interface.

Exceptions
AWTError:
Always throws an error when called.
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of this scrollbar and its values.

Returns:String

a string representation of this scrollbar.