javax.swing.plaf.basic
public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, SwingConstants
| Nested Class Summary | |
|---|---|
| protected class | BasicScrollBarUI.ArrowButtonListener
A helper class that listens to the two JButtons on each end of the
JScrollBar. |
| protected class | BasicScrollBarUI.ModelListener
A helper class that listens to the ScrollBar's model for ChangeEvents. |
| class | BasicScrollBarUI.PropertyChangeHandler
A helper class that listens to the ScrollBar's properties. |
| protected class | BasicScrollBarUI.ScrollListener
A helper class that listens for events from the timer that is used to
move the thumb. |
| protected class | BasicScrollBarUI.TrackListener
Helper class that listens for movement on the track. |
| Field Summary | |
|---|---|
| protected BasicScrollBarUI.ArrowButtonListener | buttonListener The listener that listens to the JButtons. |
| protected JButton | decrButton The JButton that decrements the scrollbar's value. |
| protected static int | DECREASE_HIGHLIGHT Indicates that the decrease highlight should be painted. |
| protected JButton | incrButton The JButton that increments the scrollbar's value. |
| protected boolean | isDragging FIXME: Use this for something (presumably mouseDragged) |
| protected static int | INCREASE_HIGHLIGHT Indicates that the increase highlight should be painted. |
| protected Dimension | maximumThumbSize The dimensions of the maximum thumb size. |
| protected Dimension | minimumThumbSize The dimensions of the minimum thumb size. |
| protected BasicScrollBarUI.ModelListener | modelListener The listener that listens to the model. |
| protected static int | NO_HIGHLIGHT Indicates that no highlight should be painted. |
| protected PropertyChangeListener | propertyChangeListener The listener that listens to the scrollbar for property changes. |
| protected JScrollBar | scrollbar The scrollbar this UI is acting for. |
| protected BasicScrollBarUI.ScrollListener | scrollListener The listener that listens to the timer. |
| protected Timer | scrollTimer The timer used to move the thumb when the mouse is held. |
| protected Color | thumbColor The color of the thumb. |
| protected Color | thumbDarkShadowColor The outer shadow of the thumb. |
| protected Color | thumbHighlightColor The top and left edge color for the thumb. |
| protected Color | thumbLightShadowColor The outer light shadow for the thumb. |
| protected Rectangle | thumbRect The size and position of the thumb. |
| protected Color | trackColor The color of the track. |
| protected int | trackHighlight The current highlight status. |
| protected Color | trackHighlightColor The color that is used when the mouse press occurs in the track. |
| protected BasicScrollBarUI.TrackListener | trackListener The listener that listens for MouseEvents on the track. |
| protected Rectangle | trackRect The size and position of the track. |
| Method Summary | |
|---|---|
| void | addLayoutComponent(String name, Component child)
This method adds a component to the layout.
|
| protected void | configureScrollBarColors()
This method configures the scrollbar's colors. |
| protected BasicScrollBarUI.ArrowButtonListener | createArrowButtonListener()
This method creates an ArrowButtonListener.
|
| protected JButton | createDecreaseButton(int orientation)
This method creates a new JButton with the appropriate icon for the
orientation.
|
| protected JButton | createIncreaseButton(int orientation)
This method creates a new JButton with the appropriate icon for the
orientation.
|
| protected BasicScrollBarUI.ModelListener | createModelListener()
This method creates a new ModelListener.
|
| protected PropertyChangeListener | createPropertyChangeListener()
This method creates a new PropertyChangeListener.
|
| protected BasicScrollBarUI.ScrollListener | createScrollListener()
This method creates a new ScrollListener.
|
| protected BasicScrollBarUI.TrackListener | createTrackListener()
This method creates a new TrackListener.
|
| static ComponentUI | createUI(JComponent c)
This method returns a new BasicScrollBarUI.
|
| Dimension | getMaximumSize(JComponent c)
This method returns the maximum size for this JComponent.
|
| protected Dimension | getMaximumThumbSize()
This method returns the maximum thumb size.
|
| Dimension | getMinimumSize(JComponent c)
This method returns the minimum size for this JComponent.
|
| protected Dimension | getMinimumThumbSize()
This method returns the minimum thumb size.
|
| Dimension | getPreferredSize(JComponent c)
This method returns a cached value of the preferredSize. |
| boolean | getSupportsAbsolutePositioning()
Indicates whether the user can position the thumb with
a mouse click (i.e. middle button).
|
| protected Rectangle | getThumbBounds()
This method returns the thumb's bounds based on the current value of the
scrollbar. |
| protected Rectangle | getTrackBounds()
This method calculates the bounds of the track. |
| protected void | installComponents()
This method installs any addition Components that are a part of or
related to this scrollbar. |
| protected void | installDefaults()
This method installs the defaults for the scrollbar specified by the
Basic Look and Feel. |
| protected void | installKeyboardActions()
Installs the input map from the look and feel defaults, and a
corresponding action map. |
| protected void | installListeners()
This method installs any listeners for the scrollbar. |
| void | installUI(JComponent c)
This method installs the UI for the component. |
| boolean | isThumbRollover()
Returns true if the mouse is over the thumb.
|
| void | layoutContainer(Container scrollbarContainer)
This method lays out the scrollbar.
|
| protected void | layoutHScrollbar(JScrollBar sb)
This method lays out the scrollbar horizontally.
|
| protected void | layoutVScrollbar(JScrollBar sb)
This method lays out the scrollbar vertically.
|
| Dimension | minimumLayoutSize(Container scrollbarContainer)
This method returns the minimum size required for the layout.
|
| void | paint(Graphics g, JComponent c)
This method is called when the component is painted.
|
| protected void | paintDecreaseHighlight(Graphics g)
This method is called when repainting and the mouse is pressed in the
track. |
| protected void | paintIncreaseHighlight(Graphics g)
This method is called when repainting and the mouse is pressed in the
track. |
| protected void | paintThumb(Graphics g, JComponent c, Rectangle thumbBounds)
This method paints the thumb.
|
| protected void | paintTrack(Graphics g, JComponent c, Rectangle trackBounds)
This method paints the track.
|
| Dimension | preferredLayoutSize(Container scrollbarContainer)
This method returns the preferred size for the layout.
|
| void | removeLayoutComponent(Component child)
This method removes a child component from the layout.
|
| protected void | scrollByBlock(int direction)
The method scrolls the thumb by a block in the direction specified.
|
| protected void | scrollByUnit(int direction)
The method scrolls the thumb by a unit in the direction specified.
|
| protected void | setThumbBounds(int x, int y, int width, int height)
This method sets the thumb's bounds.
|
| protected void | setThumbRollover(boolean active)
Set thumbRollover to active. |
| protected void | uninstallComponents()
This method uninstalls any components that are a part of or related to
this scrollbar. |
| protected void | uninstallDefaults()
This method uninstalls any defaults that this scrollbar acquired from the
Basic Look and Feel defaults. |
| protected void | uninstallKeyboardActions()
Uninstalls the input map and action map installed by
{@link #installKeyboardActions()}. |
| protected void | uninstallListeners()
This method uninstalls any listeners that were registered during install. |
| void | uninstallUI(JComponent c)
This method uninstalls the UI. |
Parameters: name The name to associate with the component that is added. child The Component to add.
Returns: A new ArrowButtonListener.
Parameters: orientation The orientation this JButton uses.
Returns: The decrease JButton.
Parameters: orientation The orientation this JButton uses.
Returns: The increase JButton.
Returns: A new ModelListener.
Returns: A new PropertyChangeListener.
Returns: A new ScrollListener.
Returns: A new TrackListener.
Parameters: c The JComponent to create a UI for.
Returns: A new BasicScrollBarUI.
Parameters: c The JComponent to measure the maximum size for.
Returns: The maximum size for the component.
Returns: The maximum thumb size.
Parameters: c The JComponent to measure the minimum size for.
Returns: The minimum size for the component.
Returns: The minimum thumb size.
Parameters: c The JComponent to measure.
Returns: The preferredSize.
Returns: true if the user can position the thumb with a mouse click.
Since: 1.5
Returns: The thumb bounds.
Returns: The track's bounds.
Parameters: c The JComponent to install.
Returns: true if the mouse is over the thumb.
Since: 1.5
Parameters: scrollbarContainer The Container to layout.
Parameters: sb The JScrollBar to layout.
Parameters: sb The JScrollBar to layout.
Parameters: scrollbarContainer The Container that is laid out.
Returns: The minimum size.
Parameters: g The Graphics object to paint with. c The JComponent to paint.
Parameters: g The Graphics object to paint with.
Parameters: g The Graphics objet to paint with.
Parameters: g The Graphics object to paint with. c The Component that is being painted. thumbBounds The thumb bounds.
Parameters: g The Graphics object to paint with. c The JComponent being painted. trackBounds The track's bounds.
Parameters: scrollbarContainer The Container to find a size for.
Returns: The preferred size for the layout.
Parameters: child The child to remove.
Parameters: direction The direction to scroll.
Parameters: direction The direction to scroll.
Parameters: x The X position of the thumb. y The Y position of the thumb. width The width of the thumb. height The height of the thumb.
Parameters: active - true if the mouse is over the thumb.
Since: 1.5
Parameters: c The Component to uninstall for.