public class SynthScrollBarUI extends BasicScrollBarUI implements PropertyChangeListener, SynthUI
JScrollBar
。
BasicScrollBarUI.ArrowButtonListener, BasicScrollBarUI.ModelListener, BasicScrollBarUI.PropertyChangeHandler, BasicScrollBarUI.ScrollListener, BasicScrollBarUI.TrackListener
buttonListener, 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, trackRect
DEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTED
BOTTOM, 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, uninstallUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMinimumSize
public static ComponentUI createUI(JComponent c)
protected void installDefaults()
protected void configureScrollBarColors()
protected void installListeners()
protected void uninstallListeners()
protected void uninstallDefaults()
public SynthContext getContext(JComponent c)
getContext
在界面
SynthUI
c
- 组件请求SynthContext。
public boolean getSupportsAbsolutePositioning()
getSupportsAbsolutePositioning
在
BasicScrollBarUI
public void update(Graphics g, JComponent c)
paint(SynthContext,Graphics)
方法。
通常,此方法不需要被子类覆盖。 所有Look和Feel渲染代码应该在paint
方法中。
update
在
ComponentUI
g
- 用于绘画的
Graphics
对象
c
- 正在涂漆的组件
paint(SynthContext,Graphics)
public void paint(Graphics g, JComponent c)
Synth Look and Feel不使用此方法。 绘画由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)
protected JButton createIncreaseButton(int orientation)
protected void setThumbRollover(boolean active)
setThumbRollover
在
BasicScrollBarUI
active
- True表示缩略图当前处于活动状态。
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.