Fields Summary |
---|
private ScrollPane | spThe ScrollPane this object is a scrollbar of. |
private int | orientationOrientation of this scrollbar. |
private int | valueThe value of this scrollbar.
value should be greater than minimum
and less than maximum |
private int | minimumThe 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. |
private int | maximumThe maximum value of this scrollbar.
This value can only be set by the ScrollPane . |
private int | visibleAmountThe size of the visible portion of this scrollbar.
This value can only be set by the ScrollPane . |
private transient boolean | isAdjustingThe 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. |
private int | unitIncrementThe amount by which the scrollbar value will change when going
up or down by a line.
This value should be a non negative integer. |
private int | blockIncrementThe amount by which the scrollbar value will change when going
up or down by a page.
This value should be a non negative integer. |
private AdjustmentListener | adjustmentListener |
private static final String | SCROLLPANE_ONLYError message for AWTError reported when one of
the public but unsupported methods is called. |
private static final long | serialVersionUIDJDK 1.1 serialVersionUID. |
Methods Summary |
---|
public synchronized void | addAdjustmentListener(java.awt.event.AdjustmentListener l)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.
if (l == null) {
return;
}
adjustmentListener = AWTEventMulticaster.add(adjustmentListener, l);
|
public synchronized java.awt.event.AdjustmentListener[] | getAdjustmentListeners()Returns an array of all the adjustment listeners
registered on this ScrollPaneAdjustable .
return (AdjustmentListener[])(AWTEventMulticaster.getListeners(
adjustmentListener,
AdjustmentListener.class));
|
public int | getBlockIncrement()
return blockIncrement;
|
public int | getMaximum()
return maximum;
|
public int | getMinimum()
// XXX: This relies on setSpan always being called with 0 for
// the minimum (which is currently true).
return 0;
|
public int | getOrientation()Returns the orientation of this scrollbar.
return orientation;
|
public int | getUnitIncrement()
return unitIncrement;
|
public int | getValue()
return value;
|
public boolean | getValueIsAdjusting()Returns true if the value is in the process of changing as a
result of actions being taken by the user.
return isAdjusting;
|
public int | getVisibleAmount()
return visibleAmount;
|
private static native void | initIDs()Initialize JNI field and method ids.
|
public java.lang.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 .
return ((orientation == Adjustable.VERTICAL ? "vertical,"
:"horizontal,")
+ "[0.."+maximum+"]"
+ ",val=" + value
+ ",vis=" + visibleAmount
+ ",unit=" + unitIncrement
+ ",block=" + blockIncrement
+ ",isAdjusting=" + isAdjusting);
|
public synchronized void | removeAdjustmentListener(java.awt.event.AdjustmentListener l)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.
if (l == null) {
return;
}
adjustmentListener = AWTEventMulticaster.remove(adjustmentListener, l);
|
public synchronized void | setBlockIncrement(int b)
blockIncrement = b;
|
public void | setMaximum(int max)This method should NOT be called by user code.
This method is public for this class to properly implement
Adjustable interface.
throw new AWTError(SCROLLPANE_ONLY);
|
public void | setMinimum(int min)This method should NOT be called by user code.
This method is public for this class to properly implement
Adjustable interface.
throw new AWTError(SCROLLPANE_ONLY);
|
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.
// adjust the values to be reasonable
minimum = min;
maximum = Math.max(max, minimum + 1);
visibleAmount = Math.min(visible, maximum - minimum);
visibleAmount = Math.max(visibleAmount, 1);
blockIncrement = Math.max((int)(visible * .90), 1);
setValue(value);
|
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 AdjustementEvent with specified type and value.
v = Math.max(v, minimum);
v = Math.min(v, maximum - visibleAmount);
if (v != value) {
value = v;
// Synchronously notify the listeners so that they are
// guaranteed to be up-to-date with the Adjustable before
// it is mutated again.
AdjustmentEvent e =
new AdjustmentEvent(this,
AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
type, value, isAdjusting);
adjustmentListener.adjustmentValueChanged(e);
}
|
public synchronized void | setUnitIncrement(int u)
if (u != unitIncrement) {
unitIncrement = u;
if (sp.peer != null) {
ScrollPanePeer peer = (ScrollPanePeer) sp.peer;
peer.setUnitIncrement(this, u);
}
}
|
public void | setValue(int v)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.
setTypedValue(v, AdjustmentEvent.TRACK);
|
public void | setValueIsAdjusting(boolean b)Sets the valueIsAdjusting property.
if (isAdjusting != b) {
isAdjusting = b;
AdjustmentEvent e =
new AdjustmentEvent(this,
AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED,
AdjustmentEvent.TRACK, value, b);
adjustmentListener.adjustmentValueChanged(e);
}
|
public void | setVisibleAmount(int v)This method should NOT be called by user code.
This method is public for this class to properly implement
Adjustable interface.
throw new AWTError(SCROLLPANE_ONLY);
|
public java.lang.String | toString()Returns a string representation of this scrollbar and its values.
return getClass().getName() + "[" + paramString() + "]";
|