public class SynthScrollBarUI extends BasicScrollBarUI implements PropertyChangeListener, SynthUI
JScrollBar。
BasicScrollBarUI.ArrowButtonListener, BasicScrollBarUI.ModelListener, BasicScrollBarUI.PropertyChangeHandler, BasicScrollBarUI.ScrollListener, BasicScrollBarUI.TrackListenerbuttonListener, decrButton, DECREASE_HIGHLIGHT, decrGap, incrButton, INCREASE_HIGHLIGHT, incrGap, isDragging, maximumThumbSize, minimumThumbSize, modelListener, NO_HIGHLIGHT, propertyChangeListener, scrollbar, scrollBarWidth, scrollListener, scrollTimer, thumbColor, thumbDarkShadowColor, thumbHighlightColor, thumbLightShadowColor, thumbRect, trackColor, trackHighlight, trackHighlightColor, trackListener, trackRectDEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTEDBOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST| Constructor and Description |
|---|
SynthScrollBarUI() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
configureScrollBarColors() |
protected JButton |
createDecreaseButton(int orientation) |
protected JButton |
createIncreaseButton(int orientation) |
static ComponentUI |
createUI(JComponent c) |
SynthContext |
getContext(JComponent c)
返回指定组件的上下文。
|
protected Dimension |
getMinimumThumbSize()
返回最小可接受大小的拇指。
|
Dimension |
getPreferredSize(JComponent c)
垂直滚动条的宽度是首选的首选宽度最大(非
null)增/减按钮,和拇指的最小宽度。
|
boolean |
getSupportsAbsolutePositioning()
指示用户是否绝对可以用鼠标手势(通常是鼠标中键)。
|
protected void |
installDefaults() |
protected void |
installListeners() |
void |
paint(Graphics g, JComponent c)
根据外观和感觉绘制指定的组件。
|
protected void |
paint(SynthContext context, Graphics g)
绘制指定的组件。
|
void |
paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)
油漆边界。
|
protected void |
paintThumb(SynthContext context, Graphics g, Rectangle thumbBounds)
把滚动条的拇指。
|
protected void |
paintTrack(SynthContext context, Graphics g, Rectangle trackBounds)
把滚动条轨道。
|
void |
propertyChange(PropertyChangeEvent e)
当改变绑定属性时,这种方法会被调用。
|
protected void |
setThumbRollover(boolean active)
设置是否鼠标当前在拇指上。
|
protected void |
uninstallDefaults() |
protected void |
uninstallListeners() |
void |
update(Graphics g, JComponent c)
通知这个UI代理重新绘制指定的组件。
|
addLayoutComponent, createArrowButtonListener, createModelListener, createPropertyChangeListener, createScrollListener, createTrackListener, getMaximumSize, getMaximumThumbSize, getThumbBounds, getTrackBounds, installComponents, installKeyboardActions, installUI, isThumbRollover, layoutContainer, layoutHScrollbar, layoutVScrollbar, minimumLayoutSize, paintDecreaseHighlight, paintIncreaseHighlight, paintThumb, paintTrack, preferredLayoutSize, removeLayoutComponent, scrollByBlock, scrollByUnit, setThumbBounds, uninstallComponents, uninstallKeyboardActions, uninstallUIcontains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMinimumSizepublic static ComponentUI createUI(JComponent c)
protected void installDefaults()
installDefaults 方法重写,继承类
BasicScrollBarUI
protected void configureScrollBarColors()
configureScrollBarColors 方法重写,继承类
BasicScrollBarUI
protected void installListeners()
installListeners 方法重写,继承类
BasicScrollBarUI
protected void uninstallListeners()
uninstallListeners 方法重写,继承类
BasicScrollBarUI
protected void uninstallDefaults()
uninstallDefaults 方法重写,继承类
BasicScrollBarUI
public SynthContext getContext(JComponent c)
getContext 接口
SynthUI
c组件请求synthcontext。
public boolean getSupportsAbsolutePositioning()
getSupportsAbsolutePositioning 方法重写,继承类
BasicScrollBarUI
public void update(Graphics g, JComponent c)
paint(SynthContext,Graphics)方法。
在一般情况下,该方法不需要由子类重写。所有的外观和感觉的渲染代码应该在paint方法。
update 方法重写,继承类
ComponentUI
g用于绘画的
Graphics对象
c被画的成分
paint(SynthContext,Graphics)
public void paint(Graphics g, JComponent c)
这种方法不使用Synth外观。绘画是由paint(SynthContext,Graphics)方法处理。
paint 方法重写,继承类
BasicScrollBarUI
g用于绘画的
Graphics对象
c被画的成分
paint(SynthContext,Graphics)
protected void paint(SynthContext context, Graphics g)
context -正在绘制的组件上下文
g用于绘画的
Graphics对象
update(Graphics,JComponent)
public void paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)
paintBorder 接口
SynthUI
context -组件上下文
g -
Graphics油漆
x的X坐标
y的Y坐标
w -边框的宽度
h的身高
protected void paintTrack(SynthContext context, Graphics g, Rectangle trackBounds)
context -正在绘制的组件上下文
g -
Graphics对象用于绘画
trackBounds包围盒的轨道
protected void paintThumb(SynthContext context, Graphics g, Rectangle thumbBounds)
context -正在绘制的组件上下文
g -
Graphics对象用于绘画
thumbBounds包围盒的拇指
public Dimension getPreferredSize(JComponent c)
null)增/减按钮,和拇指的最小宽度。优选的高度是同一部件的优选高度的总和。对于一个水平滚动条的首选大小基本相同。
的preferredSize只计算一次,随后调用此方法只返回一个缓存的大小。
getPreferredSize 方法重写,继承类
BasicScrollBarUI
c -
JScrollBar,授权该方法给我们
BasicScrollBarUI.getMaximumSize(javax.swing.JComponent),
ComponentUI.getMinimumSize(javax.swing.JComponent)
protected Dimension getMinimumThumbSize()
警告:此方法返回的值不能被修改,这是一个共享的静态常量。
getMinimumThumbSize 方法重写,继承类
BasicScrollBarUI
BasicScrollBarUI.getMaximumThumbSize()
protected JButton createDecreaseButton(int orientation)
createDecreaseButton 方法重写,继承类
BasicScrollBarUI
protected JButton createIncreaseButton(int orientation)
createIncreaseButton 方法重写,继承类
BasicScrollBarUI
protected void setThumbRollover(boolean active)
setThumbRollover 方法重写,继承类
BasicScrollBarUI
active真表明拇指是目前活跃。
public void propertyChange(PropertyChangeEvent e)
PropertyChangeListener
propertyChange 接口
PropertyChangeListener
e - PropertyChangeEvent对象描述事件源和性质已经改变。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.