java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ScrollBarUI
javax.swing.plaf.basic.BasicScrollBarUI
javax.swing.plaf.synth.SynthScrollBarUI
- 所有已实现的接口:
-
LayoutManager
,PropertyChangeListener
,EventListener
,SynthConstants
,SynthUI
,SwingConstants
为
JScrollBar
提供Synth L&F UI代理。
- 自:
- 1.7
-
Nested Class Summary
Nested classes/interfaces declared in class javax.swing.plaf.basic.BasicScrollBarUI
BasicScrollBarUI.ArrowButtonListener, BasicScrollBarUI.ModelListener, BasicScrollBarUI.PropertyChangeHandler, BasicScrollBarUI.ScrollListener, BasicScrollBarUI.TrackListener
-
Field Summary
Fields declared in class javax.swing.plaf.basic.BasicScrollBarUI
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
Fields declared in interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
Fields declared in interface javax.swing.plaf.synth.SynthConstants
DEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTED
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ComponentUI
返回一个UI。返回指定组件的上下文。垂直滚动条的首选宽度是(非null
)增量/减量按钮的首选宽度的最大值,以及拇指的最小宽度。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
当绑定属性更改时调用此方法。void
update
(Graphics g, JComponent c) 通知此UI代理重新绘制指定的组件。Methods declared in class javax.swing.plaf.basic.BasicScrollBarUI
addLayoutComponent, configureScrollBarColors, createArrowButtonListener, createDecreaseButton, createIncreaseButton, createModelListener, createPropertyChangeListener, createScrollListener, createTrackListener, getMaximumSize, getMaximumThumbSize, getMinimumThumbSize, getSupportsAbsolutePositioning, getThumbBounds, getTrackBounds, installComponents, installDefaults, installKeyboardActions, installListeners, installUI, isThumbRollover, layoutContainer, layoutHScrollbar, layoutVScrollbar, minimumLayoutSize, paintDecreaseHighlight, paintIncreaseHighlight, paintThumb, paintTrack, preferredLayoutSize, removeLayoutComponent, scrollByBlock, scrollByUnit, setThumbBounds, setThumbRollover, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI
Methods declared in class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMinimumSize
-
Constructor Details
-
SynthScrollBarUI
public SynthScrollBarUI()构造一个SynthScrollBarUI
。
-
-
Method Details
-
createUI
返回一个UI。- 参数:
-
c
- 一个组件 - 返回:
- 一个UI
-
getContext
返回指定组件的上下文。- 指定者:
-
getContext
在接口SynthUI
中 - 参数:
-
c
- 请求SynthContext的组件 - 返回:
- 描述组件的SynthContext
-
update
通知此UI代理重新绘制指定的组件。此方法绘制组件背景,然后调用paint(SynthContext,Graphics)
方法。一般来说,子类不需要覆盖此方法。所有外观和感觉渲染代码应该驻留在
paint
方法中。- 覆盖:
-
update
在类ComponentUI
中 - 参数:
-
g
- 用于绘制的Graphics
对象 -
c
- 正在绘制的组件 - 参见:
-
paint
根据外观和感觉绘制指定的组件。此方法不被Synth外观和感觉使用。绘制由
paint(SynthContext,Graphics)
方法处理。- 覆盖:
-
paint
在类ComponentUI
中 - 参数:
-
g
- 用于绘制的Graphics
对象 -
c
- 正在绘制的组件 - 参见:
-
paint
绘制指定的组件。- 参数:
-
context
- 正在绘制的组件的上下文 -
g
- 用于绘制的Graphics
对象 - 参见:
-
paintBorder
绘制边框。- 指定者:
-
paintBorder
在接口SynthUI
中 - 参数:
-
context
- 一个组件上下文 -
g
- 要绘制的Graphics
-
x
- X坐标 -
y
- Y坐标 -
w
- 边框的宽度 -
h
- 边框的高度
-
paintTrack
绘制滚动条轨道。- 参数:
-
context
- 正在绘制的组件的上下文 -
g
- 用于绘制的Graphics
对象 -
trackBounds
- 轨道的边界框
-
paintThumb
绘制滚动条拇指。- 参数:
-
context
- 正在绘制的组件的上下文 -
g
- 用于绘制的Graphics
对象 -
thumbBounds
- 拇指的边界框
-
getPreferredSize
垂直滚动条的首选宽度是(非null
)增量/减量按钮的首选宽度的最大值,以及拇指的最小宽度。首选高度是相同部分的首选高度之和。水平滚动条的首选大小基本相似。preferredSize
仅计算一次,随后调用此方法只返回缓存的大小。- 覆盖:
-
getPreferredSize
在类BasicScrollBarUI
中 - 参数:
-
c
- 委托此方法给我们的JScrollBar
- 返回:
- 基本JScrollBar的首选大小
- 参见:
-
propertyChange
从接口复制的描述:PropertyChangeListener
当绑定属性更改时调用此方法。- 指定者:
-
propertyChange
在接口PropertyChangeListener
中 - 参数:
-
e
- 描述事件源和已更改属性的PropertyChangeEvent对象
-