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
BasicScrollBarUI.ArrowButtonListener-
BasicScrollBarUI.ModelListener-
BasicScrollBarUI.ScrollListener-
BasicScrollBarUI.TrackListener-
buttonListener-
decrButton-
DECREASE_HIGHLIGHT-
incrButton-
INCREASE_HIGHLIGHT-
isDragging-
modelListener-
NO_HIGHLIGHT-
scrollbar-
scrollListener-
scrollTimer-
trackHighlight-
trackListener-
BasicScrollBarUI()
-
addLayoutComponent(String, Component)
-
configureScrollBarColors()
- Initialize the private static colors used by
paintKnob()
and paintTrack()
.
createDecreaseButton(int)
-
createIncreaseButton(int)
-
createUI(JComponent)
-
getMaximumSize(JComponent)
-
getMaximumThumbSize()
- Return the smallest acceptable size for the thumb.
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.
getMinimumThumbSize()
- Return the smallest acceptable size for the thumb.
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.
getThumbBounds()
- Return the current size/location of the thumb.
getTrackBounds()
- Return the current bounds of the track, i.e.
installUI(JComponent)
-
layoutContainer(Container)
-
layoutHScrollbar(JScrollBar)
-
layoutVScrollbar(JScrollBar)
-
minimumLayoutSize(Container)
-
paint(Graphics, JComponent)
-
paintBackground(Graphics, JComponent)
-
paintDecreaseHighlight(Graphics)
-
paintIncreaseHighlight(Graphics)
-
paintThumb(Graphics, JComponent, Rectangle)
-
paintTrack(Graphics, JComponent, Rectangle)
-
preferredLayoutSize(Container)
-
removeLayoutComponent(Component)
-
scrollByBlock(int)
-
scrollByUnit(int)
-
setThumbBounds(int, int, int, int)
- Set the bounds of the thumb and force a repaint that includes
the old thumbBounds and the new one.
uninstallUI(JComponent)
-
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
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
scrollTimer
protected Timer scrollTimer
BasicScrollBarUI
public BasicScrollBarUI()
createUI
public static ComponentUI createUI(JComponent c)
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.
installUI
public void installUI(JComponent c)
- Overrides:
- installUI in class ComponentUI
uninstallUI
public void uninstallUI(JComponent c)
- Overrides:
- uninstallUI in class ComponentUI
paintBackground
protected void paintBackground(Graphics g,
JComponent c)
paint
public void paint(Graphics g,
JComponent c)
- Overrides:
- paint in class ComponentUI
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
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
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
createDecreaseButton
protected JButton createDecreaseButton(int orientation)
createIncreaseButton
protected JButton createIncreaseButton(int orientation)
paintDecreaseHighlight
protected void paintDecreaseHighlight(Graphics g)
paintIncreaseHighlight
protected void paintIncreaseHighlight(Graphics g)
paintTrack
protected void paintTrack(Graphics g,
JComponent c,
Rectangle trackBounds)
paintThumb
protected void paintThumb(Graphics g,
JComponent c,
Rectangle thumbBounds)
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
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
addLayoutComponent
public void addLayoutComponent(String name,
Component child)
removeLayoutComponent
public void removeLayoutComponent(Component child)
preferredLayoutSize
public Dimension preferredLayoutSize(Container scrollbarContainer)
minimumLayoutSize
public Dimension minimumLayoutSize(Container scrollbarContainer)
layoutVScrollbar
protected void layoutVScrollbar(JScrollBar sb)
layoutHScrollbar
protected void layoutHScrollbar(JScrollBar sb)
layoutContainer
public void layoutContainer(Container scrollbarContainer)
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 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
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
scrollByBlock
protected void scrollByBlock(int direction)
scrollByUnit
protected void scrollByUnit(int direction)
All Packages Class Hierarchy This Package Previous Next Index
Submit a bug or feature