java.awt
Class ScrollPaneAdjustable

java.lang.Object
  |
  +--java.awt.ScrollPaneAdjustable
All Implemented Interfaces:
Adjustable, Serializable

public class ScrollPaneAdjustable
extends Object
implements Adjustable, Serializable

Safe:

See Also:
Serialized Form

Field Summary
private  AdjustmentListener adjustmentListener
           
private  int blockIncrement
          The amount by which the scrollbar value will change when going up or down by a page.
private  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 String SCROLLPANE_ONLY
          Error message for AWTError reported when one of the public but unsupported methods is called.
private static long serialVersionUID
          JDK 1.1 serialVersionUID.
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.
 
Fields inherited from interface java.awt.Adjustable
HORIZONTAL, NO_ORIENTATION, VERTICAL
 
Constructor Summary
(package private) ScrollPaneAdjustable(ScrollPane sp, AdjustmentListener l, int orientation)
          Constructs a new object to represent specified scrollabar of the specified ScrollPane.
 
Method Summary
 void addAdjustmentListener(AdjustmentListener l)
          Enabled: Adds the specified adjustment listener to receive adjustment events from this ScrollPaneAdjustable.
 AdjustmentListener[] getAdjustmentListeners()
          Suppressed: Returns an array of all the adjustment listeners registered on this ScrollPaneAdjustable.
 int getBlockIncrement()
          Enabled:
 int getMaximum()
          Enabled:
 int getMinimum()
          Enabled:
 int getOrientation()
          Enabled: Returns the orientation of this scrollbar.
 int getUnitIncrement()
          Enabled:
 int getValue()
          Enabled:
 boolean getValueIsAdjusting()
          Enabled: Returns true if the value is in the process of changing as a result of actions being taken by the user.
 int getVisibleAmount()
          Enabled:
private static void initIDs()
          Initialize JNI field and method ids.
 String paramString()
          Enabled: Returns a string representing the state of this scrollbar.
 void removeAdjustmentListener(AdjustmentListener l)
          Enabled: Removes the specified adjustment listener so that it no longer receives adjustment events from this ScrollPaneAdjustable.
 void setBlockIncrement(int b)
          Enabled:
 void setMaximum(int max)
          Suppressed: This method should NOT be called by user code.
 void setMinimum(int min)
          Suppressed: This method should NOT be called by user code.
(package private)  void setSpan(int min, int max, int visible)
          This is called by the scrollpane itself to update the minimum, maximum and visible values.
 void setUnitIncrement(int u)
          Enabled:
 void setValue(int v)
          Enabled: Sets the value of this scrollbar to the specified value.
 void setValueIsAdjusting(boolean b)
          Enabled: Sets the valueIsAdjusting property.
 void setVisibleAmount(int v)
          Suppressed: This method should NOT be called by user code.
 String toString()
          Suppressed: Returns a string representation of this scrollbar and its values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sp

private ScrollPane sp
The ScrollPane this object is a scrollbar of.


orientation

private int orientation
Orientation of this scrollbar.

See Also:
getOrientation(), java.awt.Adjustable#HORIZONTAL, java.awt.Adjustable#VERTICAL

value

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

See Also:
getValue(), setValue(int)

minimum

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)

maximum

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)

visibleAmount

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)

isAdjusting

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(boolean)

unitIncrement

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(int)

blockIncrement

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(int)

adjustmentListener

private AdjustmentListener adjustmentListener

SCROLLPANE_ONLY

private static final String SCROLLPANE_ONLY
Error message for AWTError reported when one of the public but unsupported methods is called.


serialVersionUID

private static final long serialVersionUID
JDK 1.1 serialVersionUID.

Constructor Detail

ScrollPaneAdjustable

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
l - AdjustmentListener to add upon creation.
orientation - specifies which scrollbar this object represents, can be either Adjustable.HORIZONTAL or Adjustable.VERTICAL.
Method Detail

initIDs

private static void initIDs()
Initialize JNI field and method ids.


setSpan

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.


getOrientation

public int getOrientation()
Enabled: Returns the orientation of this scrollbar.

Specified by:
getOrientation in interface Adjustable
Returns:
the orientation of this scrollbar, either Adjustable.HORIZONTAL or Adjustable.VERTICAL

setMinimum

public void setMinimum(int min)
Suppressed: This method should NOT be called by user code. This method is public for this class to properly implement Adjustable interface.

Specified by:
setMinimum in interface Adjustable
Parameters:
min - the minimum value
Throws:
AWTError - Always throws an error when called.

getMinimum

public int getMinimum()
Enabled:

Specified by:
getMinimum in interface Adjustable
Returns:
the minimum value of the adjustable object

setMaximum

public void setMaximum(int max)
Suppressed: This method should NOT be called by user code. This method is public for this class to properly implement Adjustable interface.

Specified by:
setMaximum in interface Adjustable
Parameters:
max - the maximum value
Throws:
AWTError - Always throws an error when called.

getMaximum

public int getMaximum()
Enabled:

Specified by:
getMaximum in interface Adjustable
Returns:
the maximum value of the adjustable object

setUnitIncrement

public void setUnitIncrement(int u)
Enabled:

Specified by:
setUnitIncrement in interface Adjustable
Parameters:
u - the unit increment

getUnitIncrement

public int getUnitIncrement()
Enabled:

Specified by:
getUnitIncrement in interface Adjustable
Returns:
the unit value increment for the adjustable object

setBlockIncrement

public void setBlockIncrement(int b)
Enabled:

Specified by:
setBlockIncrement in interface Adjustable
Parameters:
b - the block increment

getBlockIncrement

public int getBlockIncrement()
Enabled:

Specified by:
getBlockIncrement in interface Adjustable
Returns:
the block value increment for the adjustable object

setVisibleAmount

public void setVisibleAmount(int v)
Suppressed: This method should NOT be called by user code. This method is public for this class to properly implement Adjustable interface.

Specified by:
setVisibleAmount in interface Adjustable
Parameters:
v - the length of the indicator
Throws:
AWTError - Always throws an error when called.

getVisibleAmount

public int getVisibleAmount()
Enabled:

Specified by:
getVisibleAmount in interface Adjustable
Returns:
the length of the proportional indicator

setValueIsAdjusting

public void setValueIsAdjusting(boolean b)
Enabled: Sets the valueIsAdjusting property.

Parameters:
b - new adjustment-in-progress status
Since:
1.4
See Also:
getValueIsAdjusting()

getValueIsAdjusting

public boolean getValueIsAdjusting()
Enabled: Returns true if the value is in the process of changing as a result of actions being taken by the user.

Returns:
the value of the valueIsAdjusting property
See Also:
setValueIsAdjusting(boolean)

setValue

public void setValue(int v)
Enabled: 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.

Specified by:
setValue in interface Adjustable
Parameters:
v - the new value of the scrollbar

getValue

public int getValue()
Enabled:

Specified by:
getValue in interface Adjustable
Returns:
the current value of the adjustable object

addAdjustmentListener

public void addAdjustmentListener(AdjustmentListener l)
Enabled: 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.

Specified by:
addAdjustmentListener in interface Adjustable
Parameters:
l - the adjustment listener.
See Also:
removeAdjustmentListener(java.awt.event.AdjustmentListener), getAdjustmentListeners(), java.awt.event.AdjustmentListener, java.awt.event.AdjustmentEvent

removeAdjustmentListener

public void removeAdjustmentListener(AdjustmentListener l)
Enabled: 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.

Specified by:
removeAdjustmentListener in interface Adjustable
Parameters:
l - the adjustment listener.
Since:
JDK1.1
See Also:
addAdjustmentListener(java.awt.event.AdjustmentListener), getAdjustmentListeners(), java.awt.event.AdjustmentListener, java.awt.event.AdjustmentEvent

getAdjustmentListeners

public AdjustmentListener[] getAdjustmentListeners()
Suppressed: Returns an array of all the adjustment listeners registered on this ScrollPaneAdjustable.

Returns:
all of this ScrollPaneAdjustable's AdjustmentListeners or an empty array if no adjustment listeners are currently registered
Since:
1.4
See Also:
addAdjustmentListener(java.awt.event.AdjustmentListener), removeAdjustmentListener(java.awt.event.AdjustmentListener), java.awt.event.AdjustmentListener, java.awt.event.AdjustmentEvent

toString

public String toString()
Suppressed: Returns a string representation of this scrollbar and its values.

Overrides:
toString in class Object
Returns:
a string representation of this scrollbar.

paramString

public String paramString()
Enabled: 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:
the parameter string of this scrollbar.


comments?