Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Swing 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.swing.plaf.basic
Class BasicScrollBarUI

    java.lang.Object
      |
      +--javax.swing.plaf.ComponentUI
            |
            +--javax.swing.plaf.ScrollBarUI
                  |
                  +--javax.swing.plaf.basic.BasicScrollBarUI

Direct Known Subclasses:
  MetalScrollBarUI

public class BasicScrollBarUI
extends ScrollBarUI
implements java.awt.LayoutManager, SwingConstants

Implementation of ScrollBarUI for the Basic Look and Feel

Inner Class Summary
`protected class` | `BasicScrollBarUI.ArrowButtonListener` Listener for cursor keys.
`protected class` | `BasicScrollBarUI.ModelListener` A listener to listen for model changes.
`class` | `BasicScrollBarUI.PropertyChangeHandler`
`protected class` | `BasicScrollBarUI.ScrollListener` Listener for scrolling events intiated in the ScrollPane.
`protected class` | `BasicScrollBarUI.TrackListener` Track mouse drags.

Field Summary
`protected BasicScrollBarUI.ArrowButtonListener` | `buttonListener`
`protected JButton` | `decrButton`
`protected static int` | `DECREASE_HIGHLIGHT`
`protected JButton` | `incrButton`
`protected static int` | `INCREASE_HIGHLIGHT`
`protected boolean` | `isDragging`
`protected java.awt.Dimension` | `maximumThumbSize`
`protected java.awt.Dimension` | `minimumThumbSize`
`protected BasicScrollBarUI.ModelListener` | `modelListener`
`protected static int` | `NO_HIGHLIGHT`
`protected java.beans.PropertyChangeListener` | `propertyChangeListener`
`protected JScrollBar` | `scrollbar`
`protected BasicScrollBarUI.ScrollListener` | `scrollListener`
`protected Timer` | `scrollTimer`
`protected java.awt.Color` | `thumbColor`
`protected java.awt.Color` | `thumbDarkShadowColor`
`protected java.awt.Color` | `thumbHighlightColor`
`protected java.awt.Color` | `thumbLightShadowColor`
`protected java.awt.Rectangle` | `thumbRect`
`protected java.awt.Color` | `trackColor`
`protected int` | `trackHighlight`
`protected java.awt.Color` | `trackHighlightColor`
`protected BasicScrollBarUI.TrackListener` | `trackListener`
`protected java.awt.Rectangle` | `trackRect`

Constructor Summary
`BasicScrollBarUI()`

Method Summary
`void` | `addLayoutComponent(java.lang.String name, java.awt.Component child)`
`protected void` | `configureScrollBarColors()`
`protected BasicScrollBarUI.ArrowButtonListener` | `createArrowButtonListener()`
`protected JButton` | `createDecreaseButton(int orientation)`
`protected JButton` | `createIncreaseButton(int orientation)`
`protected BasicScrollBarUI.ModelListener` | `createModelListener()`
`protected java.beans.PropertyChangeListener` | `createPropertyChangeListener()`
`protected BasicScrollBarUI.ScrollListener` | `createScrollListener()`
`protected BasicScrollBarUI.TrackListener` | `createTrackListener()`
`static ComponentUI` | `createUI(JComponent c)`
`java.awt.Dimension` | `getMaximumSize(JComponent c)`
`protected java.awt.Dimension` | `getMaximumThumbSize()` Return the smallest acceptable size for the thumb.
`java.awt.Dimension` | `getMinimumSize(JComponent c)` A vertical scrollbars minimum width is the largest minimum width of the (non null) increment/decrement buttons, and the minimum width of the thumb.
`protected java.awt.Dimension` | `getMinimumThumbSize()` Return the smallest acceptable size for the thumb.
`java.awt.Dimension` | `getPreferredSize(JComponent c)` A vertical scrollbars preferred width is the maximum of preferred widths of the (non null) increment/decrement buttons, and the minimum width of the thumb.
`protected java.awt.Rectangle` | `getThumbBounds()` Return the current size/location of the thumb.
`protected java.awt.Rectangle` | `getTrackBounds()` Return the current bounds of the track, i.e.
`protected void` | `installComponents()`
`protected void` | `installDefaults()`
`protected void` | `installKeyboardActions()`
`protected void` | `installListeners()`
`void` | `installUI(JComponent c)`
`void` | `layoutContainer(java.awt.Container scrollbarContainer)`
`protected void` | `layoutHScrollbar(JScrollBar sb)`
`protected void` | `layoutVScrollbar(JScrollBar sb)`
`java.awt.Dimension` | `minimumLayoutSize(java.awt.Container scrollbarContainer)`
`void` | `paint(java.awt.Graphics g, JComponent c)`
`protected void` | `paintDecreaseHighlight(java.awt.Graphics g)`
`protected void` | `paintIncreaseHighlight(java.awt.Graphics g)`
`protected void` | `paintThumb(java.awt.Graphics g, JComponent c, java.awt.Rectangle thumbBounds)`
`protected void` | `paintTrack(java.awt.Graphics g, JComponent c, java.awt.Rectangle trackBounds)`
`java.awt.Dimension` | `preferredLayoutSize(java.awt.Container scrollbarContainer)`
`void` | `removeLayoutComponent(java.awt.Component child)`
`protected void` | `scrollByBlock(int direction)`
`protected void` | `scrollByUnit(int direction)`
`protected void` | `setThumbBounds(int x, int y, int width, int height)` Set the bounds of the thumb and force a repaint that includes the old thumbBounds and the new one.
`protected void` | `uninstallComponents()`
`protected void` | `uninstallDefaults()`
`protected void` | `uninstallKeyboardActions()`
`protected void` | `uninstallListeners()`
`void` | `uninstallUI(JComponent c)`

Methods inherited from class javax.swing.plaf.ComponentUI
`contains, getAccessibleChild, getAccessibleChildrenCount, update`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### minimumThumbSize

    protected java.awt.Dimension minimumThumbSize

### maximumThumbSize

    protected java.awt.Dimension maximumThumbSize

### thumbHighlightColor

    protected java.awt.Color thumbHighlightColor

### thumbLightShadowColor

    protected java.awt.Color thumbLightShadowColor

### thumbDarkShadowColor

    protected java.awt.Color thumbDarkShadowColor

### thumbColor

    protected java.awt.Color thumbColor

### trackColor

    protected java.awt.Color trackColor

### trackHighlightColor

    protected java.awt.Color trackHighlightColor

### scrollbar

    protected JScrollBar scrollbar

### incrButton

    protected JButton incrButton

### decrButton

    protected JButton decrButton

### isDragging

    protected boolean isDragging

### trackListener

    protected BasicScrollBarUI.TrackListener trackListener

### buttonListener

    protected BasicScrollBarUI.ArrowButtonListener buttonListener

### modelListener

    protected BasicScrollBarUI.ModelListener modelListener

### thumbRect

    protected java.awt.Rectangle thumbRect

### trackRect

    protected java.awt.Rectangle trackRect

### trackHighlight

    protected int trackHighlight

### NO_HIGHLIGHT

    protected static final int NO_HIGHLIGHT

### DECREASE_HIGHLIGHT

    protected static final int DECREASE_HIGHLIGHT

### INCREASE_HIGHLIGHT

    protected static final int INCREASE_HIGHLIGHT

### scrollListener

    protected BasicScrollBarUI.ScrollListener scrollListener

### propertyChangeListener

    protected java.beans.PropertyChangeListener propertyChangeListener

### scrollTimer

    protected Timer scrollTimer

Constructor Detail

### BasicScrollBarUI

    public BasicScrollBarUI()

Method Detail

### createUI

    public static ComponentUI createUI(JComponent c)

### configureScrollBarColors

    protected void configureScrollBarColors()

### installUI

    public void installUI(JComponent c)

  Overrides:
    installUI in class ComponentUI

### uninstallUI

    public void uninstallUI(JComponent c)

  Overrides:
    uninstallUI in class ComponentUI

### installDefaults

    protected void installDefaults()

### installComponents

    protected void installComponents()

### uninstallComponents

    protected void uninstallComponents()

### installListeners

    protected void installListeners()

### installKeyboardActions

    protected void installKeyboardActions()

### uninstallKeyboardActions

    protected void uninstallKeyboardActions()

### uninstallListeners

    protected void uninstallListeners()

### uninstallDefaults

    protected void uninstallDefaults()

### createTrackListener

    protected BasicScrollBarUI.TrackListener createTrackListener()

### createArrowButtonListener

    protected BasicScrollBarUI.ArrowButtonListener createArrowButtonListener()

### createModelListener

    protected BasicScrollBarUI.ModelListener createModelListener()

### createScrollListener

    protected BasicScrollBarUI.ScrollListener createScrollListener()

### createPropertyChangeListener

    protected java.beans.PropertyChangeListener createPropertyChangeListener()

### paint

    public void paint(java.awt.Graphics g,
                      JComponent c)

  Overrides:
    paint in class ComponentUI

### getPreferredSize

    public java.awt.Dimension getPreferredSize(JComponent c)

  A vertical scrollbars 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, subequent calls to this method just return a cached size. T

  Parameters:
    `c` - The JScrollBar that's delegating this method to us.
  Returns:
    The preferred size of a Basic JScrollBar.
  Overrides:
    getPreferredSize in class ComponentUI
  See Also:
    `getMaximumSize(javax.swing.JComponent)`, `getMinimumSize(javax.swing.JComponent)`

### getMinimumSize

    public java.awt.Dimension getMinimumSize(JComponent c)

  A vertical scrollbars minimum width is the largest minimum width of the (non null) increment/decrement buttons, and the minimum width of the thumb. The minimum height is the sum of the minimum heights of the same parts. The basis for the preferred size of a horizontal scrollbar is similar.

  The minimumSize is only computed once, subequent calls to this method just return a cached size. T

  Parameters:
    `c` - The JScrollBar that's delegating this method to us.
  Returns:
    The minimum size of a Basic JScrollBar.
  Overrides:
    getMinimumSize in class ComponentUI
  See Also:
    `getMaximumSize(javax.swing.JComponent)`, `getPreferredSize(javax.swing.JComponent)`

### getMaximumSize

    public java.awt.Dimension getMaximumSize(JComponent c)

  Parameters:
    `c` - The JScrollBar that's delegating this method to us.
  Returns:
    new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
  Overrides:
    getMaximumSize in class ComponentUI
  See Also:
    `getMinimumSize(javax.swing.JComponent)`, `getPreferredSize(javax.swing.JComponent)`

### createDecreaseButton

    protected JButton createDecreaseButton(int orientation)

### createIncreaseButton

    protected JButton createIncreaseButton(int orientation)

### paintDecreaseHighlight

    protected void paintDecreaseHighlight(java.awt.Graphics g)

### paintIncreaseHighlight

    protected void paintIncreaseHighlight(java.awt.Graphics g)

### paintTrack

    protected void paintTrack(java.awt.Graphics g,
                              JComponent c,
                              java.awt.Rectangle trackBounds)

### paintThumb

    protected void paintThumb(java.awt.Graphics g,
                              JComponent c,
                              java.awt.Rectangle thumbBounds)

### getMinimumThumbSize

    protected java.awt.Dimension getMinimumThumbSize()

  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.

  Returns:
    The smallest acceptable size for the thumb.
  See Also:
    `getMaximumThumbSize()`

### getMaximumThumbSize

    protected java.awt.Dimension getMaximumThumbSize()

  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. 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.

  Returns:
    The smallest acceptable size for the thumb.
  See Also:
    `getMinimumThumbSize()`

### addLayoutComponent

    public void addLayoutComponent(java.lang.String name,
                                   java.awt.Component child)

  Specified by:
    addLayoutComponent in interface java.awt.LayoutManager

### removeLayoutComponent

    public void removeLayoutComponent(java.awt.Component child)

  Specified by:
    removeLayoutComponent in interface java.awt.LayoutManager

### preferredLayoutSize

    public java.awt.Dimension preferredLayoutSize(java.awt.Container scrollbarContainer)

  Specified by:
    preferredLayoutSize in interface java.awt.LayoutManager

### minimumLayoutSize

    public java.awt.Dimension minimumLayoutSize(java.awt.Container scrollbarContainer)

  Specified by:
    minimumLayoutSize in interface java.awt.LayoutManager

### layoutVScrollbar

    protected void layoutVScrollbar(JScrollBar sb)

### layoutHScrollbar

    protected void layoutHScrollbar(JScrollBar sb)

### layoutContainer

    public void layoutContainer(java.awt.Container scrollbarContainer)

  Specified by:
    layoutContainer in interface java.awt.LayoutManager

### setThumbBounds

    protected void setThumbBounds(int x,
                                  int y,
                                  int width,
                                  int height)

  Set the bounds of the thumb and force a repaint that includes the old thumbBounds and the new one.
  See Also:
    `getThumbBounds()`

### getThumbBounds

    protected java.awt.Rectangle getThumbBounds()

  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 size/location of the thumb.
  See Also:
    `setThumbBounds(int, int, int, int)`

### getTrackBounds

    protected java.awt.Rectangle getTrackBounds()

  Return 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 layed 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.

  Returns:
    The current bounds of the scrollbar track.
  See Also:
    `layoutContainer(java.awt.Container)`

### scrollByBlock

    protected void scrollByBlock(int direction)

### scrollByUnit

    protected void scrollByUnit(int direction)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Swing 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Submit a bug or feature
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.