public class UIScrollBarUI
extends javax.swing.plaf.ScrollBarUI
implements java.awt.LayoutManager, javax.swing.SwingConstants
限定符和类型 | 类和说明 |
---|---|
protected class |
UIScrollBarUI.ModelListener
A listener to listen for model changes.
|
class |
UIScrollBarUI.PropertyChangeHandler
PropertyChangeHandler
|
protected class |
UIScrollBarUI.ScrollListener
Listener for scrolling events initiated in the
ScrollPane . |
protected class |
UIScrollBarUI.TrackListener
Track mouse drags.
|
限定符和类型 | 字段和说明 |
---|---|
protected static int |
DECREASE_HIGHLIGHT |
protected static int |
INCREASE_HIGHLIGHT |
protected boolean |
isDragging |
protected boolean |
isPressing |
protected java.awt.Dimension |
maximumThumbSize |
protected java.awt.Dimension |
minimumThumbSize |
protected UIScrollBarUI.ModelListener |
modelListener |
protected static int |
NO_HIGHLIGHT |
protected java.beans.PropertyChangeListener |
propertyChangeListener |
protected javax.swing.JScrollBar |
scrollbar |
protected UIScrollBarUI.ScrollListener |
scrollListener |
protected javax.swing.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 UIScrollBarUI.TrackListener |
trackListener |
protected java.awt.Rectangle |
trackRect |
构造器和说明 |
---|
UIScrollBarUI() |
限定符和类型 | 方法和说明 |
---|---|
void |
addLayoutComponent(java.lang.String name,
java.awt.Component child) |
protected void |
configureScrollBarColors() |
protected UIScrollBarUI.ModelListener |
createModelListener() |
protected java.beans.PropertyChangeListener |
createPropertyChangeListener() |
protected UIScrollBarUI.ScrollListener |
createScrollListener() |
protected UIScrollBarUI.TrackListener |
createTrackListener() |
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent c) |
java.awt.Dimension |
getMaximumSize(javax.swing.JComponent c) |
protected java.awt.Dimension |
getMaximumThumbSize()
Return the largest acceptable size for the thumb.
|
protected java.awt.Dimension |
getMinimumThumbSize()
Return the smallest acceptable size for the thumb.
|
java.awt.Dimension |
getPreferredSize(javax.swing.JComponent c)
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. |
protected java.awt.Rectangle |
getThumbBounds()
Return the current size/location of the thumb.
|
protected java.awt.Rectangle |
getTrackBounds()
Returns the current bounds of the track, i.e. the space in between the
increment and decrement buttons, less the insets.
|
protected void |
installComponents() |
protected void |
installDefaults() |
protected void |
installKeyboardActions() |
protected void |
installListeners() |
void |
installUI(javax.swing.JComponent c)
设置UI
|
boolean |
isSupportsAbsolutePositioning()
Indicates whether the user can absolutely position the thumb with a mouse
gesture (usually the middle mouse button).
|
boolean |
isThumbRollover()
Returns true if the mouse is currently over the thumb.
|
void |
layoutContainer(java.awt.Container scrollbarContainer) |
protected void |
layoutHScrollbar(javax.swing.JScrollBar sb) |
protected void |
layoutVScrollbar(javax.swing.JScrollBar sb) |
java.awt.Dimension |
minimumLayoutSize(java.awt.Container scrollbarContainer)
最小的布局大小
|
void |
paint(java.awt.Graphics g,
javax.swing.JComponent c)
只画Thumb
|
protected void |
paintDecreaseHighlight(java.awt.Graphics g) |
protected void |
paintIncreaseHighlight(java.awt.Graphics g) |
protected void |
paintThumb(java.awt.Graphics g,
javax.swing.JComponent cc,
java.awt.Rectangle thumbBounds) |
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 |
setThumbRollover(boolean active)
Sets whether or not the mouse is currently over the thumb.
|
protected void |
uninstallComponents() |
protected void |
uninstallDefaults() |
protected void |
uninstallKeyboardActions() |
protected void |
uninstallListeners() |
void |
uninstallUI(javax.swing.JComponent c)
重新设置UI
|
protected java.awt.Dimension minimumThumbSize
protected java.awt.Dimension maximumThumbSize
protected java.awt.Color thumbHighlightColor
protected java.awt.Color thumbLightShadowColor
protected java.awt.Color thumbDarkShadowColor
protected java.awt.Color thumbColor
protected java.awt.Color trackColor
protected java.awt.Color trackHighlightColor
protected javax.swing.JScrollBar scrollbar
protected boolean isDragging
protected boolean isPressing
protected UIScrollBarUI.TrackListener trackListener
protected UIScrollBarUI.ModelListener modelListener
protected java.awt.Rectangle thumbRect
protected java.awt.Rectangle trackRect
protected int trackHighlight
protected static final int NO_HIGHLIGHT
protected static final int DECREASE_HIGHLIGHT
protected static final int INCREASE_HIGHLIGHT
protected UIScrollBarUI.ScrollListener scrollListener
protected java.beans.PropertyChangeListener propertyChangeListener
protected javax.swing.Timer scrollTimer
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
c
- protected void configureScrollBarColors()
public void installUI(javax.swing.JComponent c)
installUI
在类中 javax.swing.plaf.ComponentUI
c
- public void uninstallUI(javax.swing.JComponent c)
uninstallUI
在类中 javax.swing.plaf.ComponentUI
c
- 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 UIScrollBarUI.TrackListener createTrackListener()
protected UIScrollBarUI.ModelListener createModelListener()
protected UIScrollBarUI.ScrollListener createScrollListener()
protected java.beans.PropertyChangeListener createPropertyChangeListener()
protected void setThumbRollover(boolean active)
active
- True indicates the thumb is currently active.public boolean isThumbRollover()
public void paint(java.awt.Graphics g, javax.swing.JComponent c)
paint
在类中 javax.swing.plaf.ComponentUI
public java.awt.Dimension getPreferredSize(javax.swing.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
在类中 javax.swing.plaf.ComponentUI
c
- the JScrollBar
that's delegating this method to
usgetMaximumSize(javax.swing.JComponent)
,
ComponentUI.getMinimumSize(javax.swing.JComponent)
public java.awt.Dimension getMaximumSize(javax.swing.JComponent c)
getMaximumSize
在类中 javax.swing.plaf.ComponentUI
c
- The JScrollBar that's delegating this method to us.ComponentUI.getMinimumSize(javax.swing.JComponent)
,
getPreferredSize(javax.swing.JComponent)
protected void paintDecreaseHighlight(java.awt.Graphics g)
protected void paintIncreaseHighlight(java.awt.Graphics g)
protected void paintThumb(java.awt.Graphics g, javax.swing.JComponent cc, java.awt.Rectangle thumbBounds)
protected java.awt.Dimension getMinimumThumbSize()
getMaximumThumbSize()
protected java.awt.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(java.lang.String name, java.awt.Component child)
addLayoutComponent
在接口中 java.awt.LayoutManager
name
- child
- public void removeLayoutComponent(java.awt.Component child)
removeLayoutComponent
在接口中 java.awt.LayoutManager
child
- public java.awt.Dimension preferredLayoutSize(java.awt.Container scrollbarContainer)
preferredLayoutSize
在接口中 java.awt.LayoutManager
scrollbarContainer
- public java.awt.Dimension minimumLayoutSize(java.awt.Container scrollbarContainer)
minimumLayoutSize
在接口中 java.awt.LayoutManager
scrollbarContainer
- protected void layoutVScrollbar(javax.swing.JScrollBar sb)
protected void layoutHScrollbar(javax.swing.JScrollBar sb)
public void layoutContainer(java.awt.Container scrollbarContainer)
layoutContainer
在接口中 java.awt.LayoutManager
scrollbarContainer
- protected void setThumbBounds(int x, int y, int width, int height)
getThumbBounds()
protected java.awt.Rectangle getThumbBounds()
setThumbBounds(int, int, int, int)
protected java.awt.Rectangle getTrackBounds()
layoutContainer(java.awt.Container)
protected void scrollByBlock(int direction)
protected void scrollByUnit(int direction)
public boolean isSupportsAbsolutePositioning()