|
JavaTM 2 Platform Std. Ed. v1.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
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 Dimension |
maximumThumbSize
|
protected Dimension |
minimumThumbSize
|
protected BasicScrollBarUI.ModelListener |
modelListener
|
protected static int |
NO_HIGHLIGHT
|
protected PropertyChangeListener |
propertyChangeListener
|
protected JScrollBar |
scrollbar
|
protected BasicScrollBarUI.ScrollListener |
scrollListener
|
protected Timer |
scrollTimer
|
protected Color |
thumbColor
|
protected Color |
thumbDarkShadowColor
|
protected Color |
thumbHighlightColor
|
protected Color |
thumbLightShadowColor
|
protected Rectangle |
thumbRect
|
protected Color |
trackColor
|
protected int |
trackHighlight
|
protected Color |
trackHighlightColor
|
protected BasicScrollBarUI.TrackListener |
trackListener
|
protected Rectangle |
trackRect
|
Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NORTH, NORTH_EAST, NORTH_WEST, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Constructor Summary | |
BasicScrollBarUI()
|
Method Summary | |
void |
addLayoutComponent(String name,
Component child)
Adds the specified component with the specified name to the layout. |
protected void |
configureScrollBarColors()
|
protected BasicScrollBarUI.ArrowButtonListener |
createArrowButtonListener()
|
protected JButton |
createDecreaseButton(int orientation)
|
protected JButton |
createIncreaseButton(int orientation)
|
protected BasicScrollBarUI.ModelListener |
createModelListener()
|
protected PropertyChangeListener |
createPropertyChangeListener()
|
protected BasicScrollBarUI.ScrollListener |
createScrollListener()
|
protected BasicScrollBarUI.TrackListener |
createTrackListener()
|
static ComponentUI |
createUI(JComponent c)
|
Dimension |
getMaximumSize(JComponent c)
|
protected Dimension |
getMaximumThumbSize()
Return the largest acceptable size for the thumb. |
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 Dimension |
getMinimumThumbSize()
Return the smallest acceptable size for the thumb. |
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 Rectangle |
getThumbBounds()
Return the current size/location of the thumb. |
protected 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(Container scrollbarContainer)
Lays out the container in the specified panel. |
protected void |
layoutHScrollbar(JScrollBar sb)
|
protected void |
layoutVScrollbar(JScrollBar sb)
|
Dimension |
minimumLayoutSize(Container scrollbarContainer)
Calculates the minimum size dimensions for the specified panel given the components in the specified parent container. |
void |
paint(Graphics g,
JComponent c)
|
protected void |
paintDecreaseHighlight(Graphics g)
|
protected void |
paintIncreaseHighlight(Graphics g)
|
protected void |
paintThumb(Graphics g,
JComponent c,
Rectangle thumbBounds)
|
protected void |
paintTrack(Graphics g,
JComponent c,
Rectangle trackBounds)
|
Dimension |
preferredLayoutSize(Container scrollbarContainer)
Calculates the preferred size dimensions for the specified panel given the components in the specified parent container. |
void |
removeLayoutComponent(Component child)
Removes the specified component from the layout. |
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 |
protected Dimension minimumThumbSize
protected Dimension maximumThumbSize
protected Color thumbHighlightColor
protected Color thumbLightShadowColor
protected Color thumbDarkShadowColor
protected Color thumbColor
protected Color trackColor
protected Color trackHighlightColor
protected JScrollBar scrollbar
protected JButton incrButton
protected JButton decrButton
protected boolean isDragging
protected BasicScrollBarUI.TrackListener trackListener
protected BasicScrollBarUI.ArrowButtonListener buttonListener
protected BasicScrollBarUI.ModelListener modelListener
protected Rectangle thumbRect
protected Rectangle trackRect
protected int trackHighlight
protected static final int NO_HIGHLIGHT
protected static final int DECREASE_HIGHLIGHT
protected static final int INCREASE_HIGHLIGHT
protected BasicScrollBarUI.ScrollListener scrollListener
protected PropertyChangeListener propertyChangeListener
protected Timer scrollTimer
Constructor Detail |
public BasicScrollBarUI()
Method Detail |
public static ComponentUI createUI(JComponent c)
protected void configureScrollBarColors()
public void installUI(JComponent c)
installUI
in class ComponentUI
public void uninstallUI(JComponent c)
uninstallUI
in class ComponentUI
protected void installDefaults()
protected void installComponents()
protected void uninstallComponents()
protected void installListeners()
protected void installKeyboardActions()
protected void uninstallKeyboardActions()
protected void uninstallListeners()
protected void uninstallDefaults()
protected BasicScrollBarUI.TrackListener createTrackListener()
protected BasicScrollBarUI.ArrowButtonListener createArrowButtonListener()
protected BasicScrollBarUI.ModelListener createModelListener()
protected BasicScrollBarUI.ScrollListener createScrollListener()
protected PropertyChangeListener createPropertyChangeListener()
public void paint(Graphics g, JComponent c)
paint
in class ComponentUI
public Dimension getPreferredSize(JComponent c)
The preferredSize is only computed once, subequent calls to this method just return a cached size. T
getPreferredSize
in class ComponentUI
c
- The JScrollBar that's delegating this method to us.getMaximumSize(javax.swing.JComponent)
,
getMinimumSize(javax.swing.JComponent)
public Dimension getMinimumSize(JComponent c)
The minimumSize is only computed once, subequent calls to this method just return a cached size. T
getMinimumSize
in class ComponentUI
c
- The JScrollBar that's delegating this method to us.getMaximumSize(javax.swing.JComponent)
,
getPreferredSize(javax.swing.JComponent)
public Dimension getMaximumSize(JComponent c)
getMaximumSize
in class ComponentUI
c
- The JScrollBar that's delegating this method to us.getMinimumSize(javax.swing.JComponent)
,
getPreferredSize(javax.swing.JComponent)
protected JButton createDecreaseButton(int orientation)
protected JButton createIncreaseButton(int orientation)
protected void paintDecreaseHighlight(Graphics g)
protected void paintIncreaseHighlight(Graphics g)
protected void paintTrack(Graphics g, JComponent c, Rectangle trackBounds)
protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds)
protected Dimension getMinimumThumbSize()
Warning : the value returned by this method should not be be modified, it's a shared static constant.
getMaximumThumbSize()
protected Dimension getMaximumThumbSize()
getMinimumThumbSize
return the same value.
Warning : the value returned by this method should not be be modified, it's a shared static constant.
getMinimumThumbSize()
public void addLayoutComponent(String name, Component child)
LayoutManager
addLayoutComponent
in interface LayoutManager
java.awt.LayoutManager
name
- the component namecomp
- the component to be addedpublic void removeLayoutComponent(Component child)
LayoutManager
removeLayoutComponent
in interface LayoutManager
java.awt.LayoutManager
comp
- the component to be removedpublic Dimension preferredLayoutSize(Container scrollbarContainer)
LayoutManager
preferredLayoutSize
in interface LayoutManager
java.awt.LayoutManager
parent
- the component to be laid outLayoutManager.minimumLayoutSize(java.awt.Container)
public Dimension minimumLayoutSize(Container scrollbarContainer)
LayoutManager
minimumLayoutSize
in interface LayoutManager
java.awt.LayoutManager
parent
- the component to be laid outLayoutManager.preferredLayoutSize(java.awt.Container)
protected void layoutVScrollbar(JScrollBar sb)
protected void layoutHScrollbar(JScrollBar sb)
public void layoutContainer(Container scrollbarContainer)
LayoutManager
layoutContainer
in interface LayoutManager
java.awt.LayoutManager
parent
- the component which needs to be laid outprotected void setThumbBounds(int x, int y, int width, int height)
getThumbBounds()
protected Rectangle getThumbBounds()
Warning : the value returned by this method should not be be modified, it's a reference to the actual rectangle, not a copy.
setThumbBounds(int, int, int, int)
protected Rectangle getTrackBounds()
Warning : the value returned by this method should not be be modified, it's a reference to the actual rectangle, not a copy.
layoutContainer(java.awt.Container)
protected void scrollByBlock(int direction)
protected void scrollByUnit(int direction)
|
JavaTM 2 Platform Std. Ed. v1.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.