APIdia Launch Partner
Top Description Fields Constructors Methods
sun.awt.X11

pack-priv abstract Class XScrollbar

Additional top-level class in compilation unit: XScrollRepeater.

extends Object
Class Inheritance
Known Direct Subclasses
sun.awt.X11.XVerticalScrollbar, sun.awt.X11.XHorizontalScrollbar
Imports
java.awt.*, java.awt.event.*, java.awt.image.BufferedImage, sun.awt.SunToolkit, .X11GraphicsConfig, sun.util.logging.PlatformLogger

A simple vertical scroll bar.

Field Summary

Modifier and TypeField and Description
pack-priv int
public static final int
public static final int
private static final int
pack-priv int
pack-priv int
pack-priv int
private boolean
pack-priv Polygon
pack-priv int
private XScrollRepeater
private int
private static PlatformLogger
private int
private int
private static final int
pack-priv int
private boolean
private int
private boolean
private Rectangle
pack-priv XScrollbarClient
private static XScrollRepeater
scroller

The thread that asynchronously tells the scrollbar to scroll.

pack-priv Polygon
pack-priv Point
private int
private int
pack-priv int

Constructor Summary

AccessConstructor and Description
public
XScrollbar(int alignment, XScrollbarClient sb)

Method Summary

Modifier and TypeMethod and Description
pack-priv abstract boolean
beforeThumb(int x, int y)

pack-priv void
private int
calculateCursorOffset(int x, int y)

protected Rectangle
calculateThumbRect()

Method to calculate the scroll thumb's size and position.

protected Polygon
createArrowShape(boolean vertical, boolean up)

Creates oriented directed arrow

pack-priv int
getArrowAreaWidth()

Width of the area reserved for arrow

pack-priv int
getArrowWidth()

Width of the arrow image

pack-priv int
getBlockIncrement()

Gets the block increment for this scrollbar.

pack-priv int
getMaximum()

Returns the maximum value of this Scrollbar.

pack-priv int
getMinimum()

Returns the minimum value of this Scrollbar.

private double
getScaleFactor()

Returns the scale factor for the thumbArea ( thumbAreaH / (max - min)).

protected abstract Rectangle
getThumbArea()

Gets the area of the scroll track

pack-priv int
getUnitIncrement()

Gets the unit increment for this scrollbar.

pack-priv int
getValue()

Returns the current value of this Scrollbar.

pack-priv int
getVisibleAmount()

Returns the visible amount of this Scrollbar.

public void
handleMouseEvent(int id, int modifiers, int x, int y)

private void
handleTrackEvent(int x, int y, boolean isAdjusting)

pack-priv boolean
isInArrow(int x, int y)

pack-priv boolean
isInThumb(int x, int y)

Is x,y in the scroll thumb?

public boolean
pack-priv void
notifyValue(int v)

pack-priv void
notifyValue(int v, final boolean isAdjusting)

pack-priv void
paint(Graphics
the graphics context to paint into
g
,
Color[]
the colors to use when painting the scrollbar
colors
,
boolean
paint the whole scrollbar if true, just the thumb is false
paintAll
)

paint the scrollbar

pack-priv void
paintArrows(Graphics2D g, Color background, Color darkShadow, Color lightShadow)

protected abstract void
pack-priv void
scroll()

Scroll one unit.

pack-priv synchronized void
setBlockIncrement(int
is the block size for increment or decrement of the value
blockSize
)

Sets the block increment for this scrollbar.

pack-priv synchronized void
setMaximum(int
the maximum value of the scrollbar
newMaximum
)

Sets the maximum value for this Scrollbar.

pack-priv synchronized void
setMinimum(int
the minimum value of the scrollbar
newMinimum
)

Sets the minimum value for this Scrollbar.

public void
setMode(int mode)

The set method for mode property.

public void
setSize(int width, int height)

pack-priv synchronized void
setUnitIncrement(int
is the unit size for increment or decrement of the value
unitSize
)

Sets the unit increment for this scrollbar.

pack-priv synchronized void
setValue(int
the new value of the Scrollbar. If this value is below the current minimum or above the current maximum minus the visible amount, it becomes the new one of those values, respectively.
newValue
)

Sets the value of this Scrollbar to the specified value.

pack-priv synchronized void
setValues(int
is the position in the current window.
value
,
int
is the amount visible per page
visible
,
int
is the minimum value of the scrollbar
minimum
,
int
is the maximum value of the scrollbar
maximum
)

Sets the values for this Scrollbar.

pack-priv synchronized void
setValues(int
is the position in the current window.
value
,
int
is the amount visible per page
visible
,
int
is the minimum value of the scrollbar
minimum
,
int
is the maximum value of the scrollbar
maximum
,
int
is the unit size for increment or decrement of the value
unitSize
,
int blockSize)

Sets param of this Scrollbar to the specified values.

pack-priv synchronized void
setVisibleAmount(int
the amount visible per page
newAmount
)

Sets the visible amount of this Scrollbar, which is the range of values represented by the width of the scroll bar's bubble.

pack-priv void
startScrolling()

Tell the scroller to start scrolling.

pack-priv void
startScrollingInstance()

Tell the instance scroller to start scrolling.

pack-priv void
stopScrollingInstance()

Tell the instance scroller to stop scrolling.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

alignmentback to summary
pack-priv int alignment
ALIGNMENT_HORIZONTALback to summary
public static final int ALIGNMENT_HORIZONTAL
ALIGNMENT_VERTICALback to summary
public static final int ALIGNMENT_VERTICAL
ARROW_INDback to summary
private static final int ARROW_IND
arrowAreaback to summary
pack-priv int arrowArea
barLengthback to summary
pack-priv int barLength
barWidthback to summary
pack-priv int barWidth
draggingback to summary
private boolean dragging
firstArrowback to summary
pack-priv Polygon firstArrow
heightback to summary
pack-priv int height
i_scrollerback to summary
private XScrollRepeater i_scroller
lineback to summary
private int line
logback to summary
private static PlatformLogger log
maxback to summary
private int max
minback to summary
private int min
MIN_THUMB_Hback to summary
private static final int MIN_THUMB_H
modeback to summary
pack-priv int mode
needsRepaintback to summary
private boolean needsRepaint
pageback to summary
private int page
pressedback to summary
private boolean pressed
prevThumbback to summary
private Rectangle prevThumb
sbback to summary
pack-priv XScrollbarClient sb
scrollerback to summary
private static XScrollRepeater scroller

The thread that asynchronously tells the scrollbar to scroll.

See Also
startScrolling
secondArrowback to summary
pack-priv Polygon secondArrow
thumbOffsetback to summary
pack-priv Point thumbOffset
valback to summary
private int val
visback to summary
private int vis
widthback to summary
pack-priv int width

Constructor Detail

XScrollbarback to summary
public XScrollbar(int alignment, XScrollbarClient sb)

Method Detail

beforeThumbback to summary
pack-priv abstract boolean beforeThumb(int x, int y)
calculateArrowWidthback to summary
pack-priv void calculateArrowWidth()
calculateCursorOffsetback to summary
private int calculateCursorOffset(int x, int y)
calculateThumbRectback to summary
protected Rectangle calculateThumbRect()

Method to calculate the scroll thumb's size and position. This is based on CalcSliderRect in ScrollBar.c of Motif source. If we ever cache the thumb rect, we'll need to use a clone in isInThumb().

createArrowShapeback to summary
protected Polygon createArrowShape(boolean vertical, boolean up)

Creates oriented directed arrow

getArrowAreaWidthback to summary
pack-priv int getArrowAreaWidth()

Width of the area reserved for arrow

getArrowWidthback to summary
pack-priv int getArrowWidth()

Width of the arrow image

getBlockIncrementback to summary
pack-priv int getBlockIncrement()

Gets the block increment for this scrollbar.

getMaximumback to summary
pack-priv int getMaximum()

Returns the maximum value of this Scrollbar.

See Also
getMinimum, getValue
getMinimumback to summary
pack-priv int getMinimum()

Returns the minimum value of this Scrollbar.

See Also
getMaximum, getValue
getScaleFactorback to summary
private double getScaleFactor()

Returns the scale factor for the thumbArea ( thumbAreaH / (max - min)).

See Also
getArrowAreaWidth
getThumbAreaback to summary
protected abstract Rectangle getThumbArea()

Gets the area of the scroll track

getUnitIncrementback to summary
pack-priv int getUnitIncrement()

Gets the unit increment for this scrollbar.

getValueback to summary
pack-priv int getValue()

Returns the current value of this Scrollbar.

See Also
getMinimum, getMaximum
getVisibleAmountback to summary
pack-priv int getVisibleAmount()

Returns the visible amount of this Scrollbar.

handleMouseEventback to summary
public void handleMouseEvent(int id, int modifiers, int x, int y)
Annotations
@SuppressWarnings:deprecation
See Also
MouseEvent.MOUSE_CLICKED MouseEvent.MOUSE_PRESSED MouseEvent.MOUSE_RELEASED MouseEvent.MOUSE_MOVED MouseEvent.MOUSE_ENTERED MouseEvent.MOUSE_EXITED MouseEvent.MOUSE_DRAGGED
handleTrackEventback to summary
private void handleTrackEvent(int x, int y, boolean isAdjusting)
isInArrowback to summary
pack-priv boolean isInArrow(int x, int y)
isInThumbback to summary
pack-priv boolean isInThumb(int x, int y)

Is x,y in the scroll thumb? If we ever cache the thumb rect, we may need to clone the result of calculateThumbRect().

needsRepaintback to summary
public boolean needsRepaint()
notifyValueback to summary
pack-priv void notifyValue(int v)
notifyValueback to summary
pack-priv void notifyValue(int v, final boolean isAdjusting)
paintback to summary
pack-priv void paint(Graphics g, Color[] colors, boolean paintAll)

paint the scrollbar

Parameters
g:Graphics

the graphics context to paint into

colors:Color[]

the colors to use when painting the scrollbar

paintAll:boolean

paint the whole scrollbar if true, just the thumb is false

paintArrowsback to summary
pack-priv void paintArrows(Graphics2D g, Color background, Color darkShadow, Color lightShadow)
rebuildArrowsback to summary
protected abstract void rebuildArrows()
scrollback to summary
pack-priv void scroll()

Scroll one unit.

See Also
notifyValue
setBlockIncrementback to summary
pack-priv synchronized void setBlockIncrement(int blockSize)

Sets the block increment for this scrollbar. This is the value that will be added (subtracted) when the user hits the block down (up) gadgets.

Parameters
blockSize:int

is the block size for increment or decrement of the value

setMaximumback to summary
pack-priv synchronized void setMaximum(int newMaximum)

Sets the maximum value for this Scrollbar.

Parameters
newMaximum:int

the maximum value of the scrollbar

setMinimumback to summary
pack-priv synchronized void setMinimum(int newMinimum)

Sets the minimum value for this Scrollbar.

Parameters
newMinimum:int

the minimum value of the scrollbar

setModeback to summary
public void setMode(int mode)

The set method for mode property. See 6243382 for more information

setSizeback to summary
public void setSize(int width, int height)
setUnitIncrementback to summary
pack-priv synchronized void setUnitIncrement(int unitSize)

Sets the unit increment for this scrollbar. This is the value that will be added (subtracted) when the user hits the unit down (up) gadgets.

Parameters
unitSize:int

is the unit size for increment or decrement of the value

setValueback to summary
pack-priv synchronized void setValue(int newValue)

Sets the value of this Scrollbar to the specified value.

Parameters
newValue:int

the new value of the Scrollbar. If this value is below the current minimum or above the current maximum minus the visible amount, it becomes the new one of those values, respectively.

See Also
getValue
setValuesback to summary
pack-priv synchronized void setValues(int value, int visible, int minimum, int maximum)

Sets the values for this Scrollbar. This method enforces the same constraints as in java.awt.Scrollbar:

  • The maximum must be greater than the minimum
  • The value must be greater than or equal to the minimum and less than or equal to the maximum minus the visible amount
  • The visible amount must be greater than 1 and less than or equal to the difference between the maximum and minimum values.
Values which do not meet these criteria are quietly coerced to the appropriate boundary value.
Parameters
value:int

is the position in the current window.

visible:int

is the amount visible per page

minimum:int

is the minimum value of the scrollbar

maximum:int

is the maximum value of the scrollbar

setValuesback to summary
pack-priv synchronized void setValues(int value, int visible, int minimum, int maximum, int unitSize, int blockSize)

Sets param of this Scrollbar to the specified values.

Parameters
value:int

is the position in the current window.

visible:int

is the amount visible per page

minimum:int

is the minimum value of the scrollbar

maximum:int

is the maximum value of the scrollbar

unitSize:int

is the unit size for increment or decrement of the value

See Also
setValues
setVisibleAmountback to summary
pack-priv synchronized void setVisibleAmount(int newAmount)

Sets the visible amount of this Scrollbar, which is the range of values represented by the width of the scroll bar's bubble.

Parameters
newAmount:int

the amount visible per page

startScrollingback to summary
pack-priv void startScrolling()

Tell the scroller to start scrolling.

startScrollingInstanceback to summary
pack-priv void startScrollingInstance()

Tell the instance scroller to start scrolling. See 6243382 for more information

stopScrollingInstanceback to summary
pack-priv void stopScrollingInstance()

Tell the instance scroller to stop scrolling. See 6243382 for more information

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override