| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public class BasicScrollBarUI extends ScrollBarUI implements LayoutManager, SwingConstants
Implementation of ScrollBarUI for the Basic Look and Feel
Nested Class Summary | |
---|---|
protected class |
Listener for cursor keys. |
protected class |
A listener to listen for model changes. |
class |
|
protected class |
Listener for scrolling events initiated in the ScrollPane . |
protected class |
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
|
Constructor Summary | |
---|---|
|
Method Summary | |
---|---|
void |
addLayoutComponent(String name, Component child) |
protected void |
|
protected BasicScrollBarUI.ArrowButtonListener |
|
protected JButton |
createDecreaseButton(int orientation) |
protected JButton |
createIncreaseButton(int orientation) |
protected BasicScrollBarUI.ModelListener |
|
protected PropertyChangeListener |
|
protected BasicScrollBarUI.ScrollListener |
|
protected BasicScrollBarUI.TrackListener |
|
static ComponentUI |
|
Dimension |
Returns the specified component's maximum size appropriate for the look and feel. |
protected Dimension |
Return the largest acceptable size for the thumb. |
protected Dimension |
Return the smallest acceptable size for the thumb. |
Dimension |
A vertical scrollbar's preferred width is the maximum of preferred widths of the (non null )
increment/decrement buttons,
and the minimum width of the thumb.
|
boolean |
Indicates whether the user can absolutely position the thumb with a mouse gesture (usually the middle mouse button). |
protected Rectangle |
Return the current size/location of the thumb. |
protected Rectangle |
Returns the current bounds of the track, i.e. |
protected void |
|
protected void |
|
protected void |
|
protected void |
|
void |
Configures the specified component appropriate for the look and feel. |
boolean |
Returns true if the mouse is currently over the thumb. |
void |
layoutContainer(Container scrollbarContainer) |
protected void |
|
protected void |
|
Dimension |
minimumLayoutSize(Container scrollbarContainer) |
void |
paint(Graphics g, JComponent c) Paints the specified component appropriate for the look and feel. |
protected void |
|
protected void |
|
protected void |
paintThumb(Graphics g, JComponent c, Rectangle thumbBounds) |
protected void |
paintTrack(Graphics g, JComponent c, Rectangle trackBounds) |
Dimension |
preferredLayoutSize(Container scrollbarContainer) |
void |
removeLayoutComponent(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 |
setThumbRollover(boolean active) Sets whether or not the mouse is currently over the thumb. |
protected void |
|
protected void |
|
protected void |
|
protected void |
|
void |
Reverses configuration which was done on the specified component during installUI .
|
Methods inherited from class javax.swing.plaf.ComponentUI |
---|
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, installUI, paint, uninstallUI, update |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected BasicScrollBarUI.ArrowButtonListener buttonListener
protected JButton decrButton
protected static final int DECREASE_HIGHLIGHT
protected JButton incrButton
protected static final int INCREASE_HIGHLIGHT
protected boolean isDragging
protected Dimension maximumThumbSize
protected Dimension minimumThumbSize
protected BasicScrollBarUI.ModelListener modelListener
protected static final 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
Constructor Detail |
---|
public BasicScrollBarUI()
Method Detail |
---|
public void addLayoutComponent(String name, Component child)
name
child
protected void configureScrollBarColors()
protected BasicScrollBarUI.ArrowButtonListener createArrowButtonListener()
protected JButton createDecreaseButton(int orientation)
orientation
protected JButton createIncreaseButton(int orientation)
orientation
protected BasicScrollBarUI.ModelListener createModelListener()
protected PropertyChangeListener createPropertyChangeListener()
protected BasicScrollBarUI.ScrollListener createScrollListener()
protected BasicScrollBarUI.TrackListener createTrackListener()
public static ComponentUI createUI(JComponent c)
c
public Dimension getMaximumSize(JComponent c)
getMaximumSize
in class ComponentUI
c
- The JScrollBar that's delegating this method to us.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.
protected Dimension getMinimumThumbSize()
Warning : the value returned by this method should not be be modified, it's a shared static constant.
public Dimension getPreferredSize(JComponent c)
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, subsequent
calls to this method just return a cached size.
getPreferredSize
in class ComponentUI
c
- the JScrollBar
that's delegating this method to uspublic boolean getSupportsAbsolutePositioning()
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.
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.
protected void installComponents()
protected void installDefaults()
protected void installKeyboardActions()
protected void installListeners()
public void installUI(JComponent c)
installUI
in class ComponentUI
c
public boolean isThumbRollover()
public void layoutContainer(Container scrollbarContainer)
scrollbarContainer
protected void layoutHScrollbar(JScrollBar sb)
sb
protected void layoutVScrollbar(JScrollBar sb)
sb
public Dimension minimumLayoutSize(Container scrollbarContainer)
scrollbarContainer
public void paint(Graphics g, JComponent c)
paint
in class ComponentUI
g
c
protected void paintDecreaseHighlight(Graphics g)
g
protected void paintIncreaseHighlight(Graphics g)
g
protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds)
g
c
thumbBounds
protected void paintTrack(Graphics g, JComponent c, Rectangle trackBounds)
g
c
trackBounds
public Dimension preferredLayoutSize(Container scrollbarContainer)
scrollbarContainer
public void removeLayoutComponent(Component child)
child
protected void scrollByBlock(int direction)
direction
protected void scrollByUnit(int direction)
direction
protected void setThumbBounds(int x, int y, int width, int height)
x
y
width
height
protected void setThumbRollover(boolean active)
active
- True indicates the thumb is currently active.protected void uninstallComponents()
protected void uninstallDefaults()
protected void uninstallKeyboardActions()
protected void uninstallListeners()
public void uninstallUI(JComponent c)
uninstallUI
in class ComponentUI
c
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |