All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class java.awt.swing.basic.BasicScrollBarUI

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

public class BasicScrollBarUI
extends ScrollBarUI
implements LayoutManager, Serializable, SwingConstants
Implementation of ScrollBarUI for the Basic Look and Feel


Class Index

 o BasicScrollBarUI.ArrowButtonListener
 o BasicScrollBarUI.ModelListener
 o BasicScrollBarUI.ScrollListener
 o BasicScrollBarUI.TrackListener

Variable Index

 o buttonListener
 o decrButton
 o DECREASE_HIGHLIGHT
 o incrButton
 o INCREASE_HIGHLIGHT
 o isDragging
 o modelListener
 o NO_HIGHLIGHT
 o scrollbar
 o scrollListener
 o scrollTimer
 o trackHighlight
 o trackListener

Constructor Index

 o BasicScrollBarUI()

Method Index

 o addLayoutComponent(String, Component)
 o configureScrollBarColors()
Initialize the private static colors used by paintKnob() and paintTrack().
 o createDecreaseButton(int)
 o createIncreaseButton(int)
 o createUI(JComponent)
 o getMaximumSize(JComponent)
 o getMaximumThumbSize()
Return the smallest acceptable size for the thumb.
 o getMinimumSize(JComponent)
A vertical scrollbars minimum width is the largest minimum width of the (non null) increment/decrement buttons, and the minimum width of the thumb.
 o getMinimumThumbSize()
Return the smallest acceptable size for the thumb.
 o getPreferredSize(JComponent)
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.
 o getThumbBounds()
Return the current size/location of the thumb.
 o getTrackBounds()
Return the current bounds of the track, i.e.
 o installUI(JComponent)
 o layoutContainer(Container)
 o layoutHScrollbar(JScrollBar)
 o layoutVScrollbar(JScrollBar)
 o minimumLayoutSize(Container)
 o paint(Graphics, JComponent)
 o paintBackground(Graphics, JComponent)
 o paintDecreaseHighlight(Graphics)
 o paintIncreaseHighlight(Graphics)
 o paintThumb(Graphics, JComponent, Rectangle)
 o paintTrack(Graphics, JComponent, Rectangle)
 o preferredLayoutSize(Container)
 o removeLayoutComponent(Component)
 o scrollByBlock(int)
 o scrollByUnit(int)
 o setThumbBounds(int, int, int, int)
Set the bounds of the thumb and force a repaint that includes the old thumbBounds and the new one.
 o uninstallUI(JComponent)

Variables

 o scrollbar
protected JScrollBar scrollbar
 o incrButton
protected JButton incrButton
 o decrButton
protected JButton decrButton
 o isDragging
protected boolean isDragging
 o trackListener
protected BasicScrollBarUI.TrackListener trackListener
 o buttonListener
protected BasicScrollBarUI.ArrowButtonListener buttonListener
 o modelListener
protected BasicScrollBarUI.ModelListener modelListener
 o trackHighlight
protected int trackHighlight
 o NO_HIGHLIGHT
protected static final int NO_HIGHLIGHT
 o DECREASE_HIGHLIGHT
protected static final int DECREASE_HIGHLIGHT
 o INCREASE_HIGHLIGHT
protected static final int INCREASE_HIGHLIGHT
 o scrollListener
protected BasicScrollBarUI.ScrollListener scrollListener
 o scrollTimer
protected Timer scrollTimer

Constructors

 o BasicScrollBarUI
public BasicScrollBarUI()

Methods

 o createUI
public static ComponentUI createUI(JComponent c)
 o configureScrollBarColors
protected void configureScrollBarColors()
Initialize the private static colors used by paintKnob() and paintTrack(). Subclasses that override either of these methods should override this method as well, and set up any colors they need.

 o installUI
public void installUI(JComponent c)
Overrides:
installUI in class ComponentUI
 o uninstallUI
public void uninstallUI(JComponent c)
Overrides:
uninstallUI in class ComponentUI
 o paintBackground
protected void paintBackground(Graphics g,
                               JComponent c)
 o paint
public void paint(Graphics g,
                  JComponent c)
Overrides:
paint in class ComponentUI
 o getPreferredSize
public 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, getMinimumSize
 o getMinimumSize
public 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, getPreferredSize
 o getMaximumSize
public 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, getPreferredSize
 o createDecreaseButton
protected JButton createDecreaseButton(int orientation)
 o createIncreaseButton
protected JButton createIncreaseButton(int orientation)
 o paintDecreaseHighlight
protected void paintDecreaseHighlight(Graphics g)
 o paintIncreaseHighlight
protected void paintIncreaseHighlight(Graphics g)
 o paintTrack
protected void paintTrack(Graphics g,
                          JComponent c,
                          Rectangle trackBounds)
 o paintThumb
protected void paintThumb(Graphics g,
                          JComponent c,
                          Rectangle thumbBounds)
 o getMinimumThumbSize
protected 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
 o getMaximumThumbSize
protected 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
 o addLayoutComponent
public void addLayoutComponent(String name,
                               Component child)
 o removeLayoutComponent
public void removeLayoutComponent(Component child)
 o preferredLayoutSize
public Dimension preferredLayoutSize(Container scrollbarContainer)
 o minimumLayoutSize
public Dimension minimumLayoutSize(Container scrollbarContainer)
 o layoutVScrollbar
protected void layoutVScrollbar(JScrollBar sb)
 o layoutHScrollbar
protected void layoutHScrollbar(JScrollBar sb)
 o layoutContainer
public void layoutContainer(Container scrollbarContainer)
 o 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
 o getThumbBounds
protected 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
 o getTrackBounds
protected 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
 o scrollByBlock
protected void scrollByBlock(int direction)
 o scrollByUnit
protected void scrollByUnit(int direction)

All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Submit a bug or feature