java.lang.Object | |||
↳ | javax.swing.plaf.ComponentUI | ||
↳ | javax.swing.plaf.ScrollBarUI | ||
↳ | javax.swing.plaf.basic.BasicScrollBarUI |
![]() |
Implementation of ScrollBarUI for the Basic Look and Feel
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
BasicScrollBarUI.ArrowButtonListener | Listener for cursor keys. | ||||||||||
BasicScrollBarUI.ModelListener | A listener to listen for model changes. | ||||||||||
BasicScrollBarUI.PropertyChangeHandler | |||||||||||
BasicScrollBarUI.ScrollListener | Listener for scrolling events initiated in the
ScrollPane . |
||||||||||
BasicScrollBarUI.TrackListener | Track mouse drags. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | DECREASE_HIGHLIGHT | ||||||||||
int | INCREASE_HIGHLIGHT | ||||||||||
int | NO_HIGHLIGHT |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
buttonListener | |||||||||||
decrButton | |||||||||||
incrButton | |||||||||||
isDragging | |||||||||||
maximumThumbSize | |||||||||||
minimumThumbSize | |||||||||||
modelListener | |||||||||||
propertyChangeListener | |||||||||||
scrollListener | |||||||||||
scrollTimer | |||||||||||
scrollbar | |||||||||||
thumbColor | |||||||||||
thumbDarkShadowColor | |||||||||||
thumbHighlightColor | |||||||||||
thumbLightShadowColor | |||||||||||
thumbRect | |||||||||||
trackColor | |||||||||||
trackHighlight | |||||||||||
trackHighlightColor | |||||||||||
trackListener | |||||||||||
trackRect |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
If the layout manager uses a per-component string,
adds the component
comp to the layout,
associating it
with the string specified by name . | |||||||||||
Returns the specified component's maximum size appropriate for
the look and feel.
| |||||||||||
A vertical scrollbar's preferred width is the maximum of
preferred widths of the (non
null )
increment/decrement buttons,
and the minimum width of the thumb. | |||||||||||
Indicates whether the user can absolutely position the thumb with
a mouse gesture (usually the middle mouse button).
| |||||||||||
Configures the specified component appropriate for the look and feel.
| |||||||||||
Returns true if the mouse is currently over the thumb.
| |||||||||||
Lays out the specified container.
| |||||||||||
Calculates the minimum size dimensions for the specified
container, given the components it contains.
| |||||||||||
Paints the specified component appropriate for the look and feel.
| |||||||||||
Calculates the preferred size dimensions for the specified
container, given the components it contains.
| |||||||||||
Removes the specified component from the layout.
| |||||||||||
Reverses configuration which was done on the specified component during
installUI . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
If the layout manager uses a per-component string,
adds the component comp
to the layout,
associating it
with the string specified by name
.
name | the string to be associated with the component |
---|---|
child | the component to be added |
Returns the specified component's maximum size appropriate for
the look and feel. If null
is returned, the maximum
size will be calculated by the component's layout manager instead
(this is the preferred approach for any component with a specific
layout manager installed). The default implementation of this
method invokes getPreferredSize
and returns that value.
c | The JScrollBar that's delegating this method to us. |
---|
A vertical scrollbar's preferred width is the maximum of
preferred widths of the (non null
)
increment/decrement buttons,
and the minimum width of the thumb. The preferred height is the
sum of the preferred heights of the same parts. The basis for
the preferred size of a horizontal scrollbar is similar.
The preferredSize
is only computed once, subsequent
calls to this method just return a cached size.
c | the JScrollBar that's delegating this method to us |
---|
Indicates whether the user can absolutely position the thumb with a mouse gesture (usually the middle mouse button).
Configures the specified component appropriate for the look and feel.
This method is invoked when the ComponentUI
instance is being installed
as the UI delegate on the specified component. This method should
completely configure the component for the look and feel,
including the following:
LayoutManager
on the component if necessary.
PropertyChangeListener
on the component in order
to detect and respond to component property changes appropriately.
c | the component where this UI delegate is being installed |
---|
Returns true if the mouse is currently over the thumb.
Lays out the specified container.
scrollbarContainer | the container to be laid out |
---|
Calculates the minimum size dimensions for the specified container, given the components it contains.
scrollbarContainer | the component to be laid out |
---|
Paints the specified component appropriate for the look and feel.
This method is invoked from the ComponentUI.update
method when
the specified component is being painted. Subclasses should override
this method and use the specified Graphics
object to
render the content of the component.
g | the Graphics context in which to paint |
---|---|
c | the component being painted; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components |
Calculates the preferred size dimensions for the specified container, given the components it contains.
scrollbarContainer | the container to be laid out |
---|
Removes the specified component from the layout.
child | the component to be removed |
---|
Reverses configuration which was done on the specified component during
installUI
. This method is invoked when this
UIComponent
instance is being removed as the UI delegate
for the specified component. This method should undo the
configuration performed in installUI
, being careful to
leave the JComponent
instance in a clean state (no
extraneous listeners, look-and-feel-specific property objects, etc.).
This should include the following:
c | the component from which this UI delegate is being removed; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components |
---|
Return the largest acceptable size for the thumb. To create a fixed
size thumb one make this method and getMinimumThumbSize
return the same value.
Warning : the value returned by this method should not be be modified, it's a shared static constant.
Return the smallest acceptable size for the thumb. If the scrollbar becomes so small that this size isn't available, the thumb will be hidden.
Warning : the value returned by this method should not be be modified, it's a shared static constant.
Return the current size/location of the thumb.
Warning : the value returned by this method should not be be modified, it's a reference to the actual rectangle, not a copy.
Returns the current bounds of the track, i.e. the space in between the increment and decrement buttons, less the insets. The value returned by this method is updated each time the scrollbar is laid out (validated).
Warning : the value returned by this method should not be be modified, it's a reference to the actual rectangle, not a copy.
Set the bounds of the thumb and force a repaint that includes the old thumbBounds and the new one.
Sets whether or not the mouse is currently over the thumb.
active | True indicates the thumb is currently active. |
---|