public class SynthSliderUI extends BasicSliderUI implements PropertyChangeListener, SynthUI
JSlider。
BasicSliderUI.ActionScroller, BasicSliderUI.ChangeHandler, BasicSliderUI.ComponentHandler, BasicSliderUI.FocusHandler, BasicSliderUI.PropertyChangeHandler, BasicSliderUI.ScrollListener, BasicSliderUI.TrackListenerchangeListener, componentListener, contentRect, focusInsets, focusListener, focusRect, insetCache, labelRect, leftToRightCache, MAX_SCROLL, MIN_SCROLL, NEGATIVE_SCROLL, POSITIVE_SCROLL, propertyChangeListener, scrollListener, scrollTimer, slider, thumbRect, tickRect, trackBuffer, trackListener, trackRectDEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTED| Modifier | Constructor and Description |
|---|---|
protected |
SynthSliderUI(JSlider c) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
calculateGeometry() |
protected void |
calculateThumbLocation() |
protected BasicSliderUI.TrackListener |
createTrackListener(JSlider s) |
static ComponentUI |
createUI(JComponent c)
为给定组件创建一个新的用户界面对象。
|
int |
getBaseline(JComponent c, int width, int height)
返回基线。
|
SynthContext |
getContext(JComponent c)
返回指定组件的上下文。
|
Dimension |
getMinimumSize(JComponent c)
返回指定组件的最小大小适合的外观和感觉。
|
Dimension |
getPreferredSize(JComponent c)
返回指定组件的首选大小适合的外观和感觉。
|
protected Dimension |
getThumbSize() |
protected void |
installDefaults(JSlider slider) |
protected void |
installListeners(JSlider slider) |
protected void |
layout()
勾画滑块。
|
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 |
recalculateIfInsetsChanged() |
void |
setThumbLocation(int x, int y) |
protected void |
uninstallDefaults(JSlider slider)
卸载默认设置。
|
protected void |
uninstallListeners(JSlider slider) |
void |
update(Graphics g, JComponent c)
通知这个UI代理重新绘制指定的组件。
|
int |
valueForXPosition(int xPos)
返回x位置的值。
|
int |
valueForYPosition(int yPos)
返回在Y位置的值。
|
protected int |
xPositionForValue(int value) |
protected int |
yPositionForValue(int value, int trackY, int trackHeight)
返回指定值的Y位置。
|
calculateContentRect, calculateFocusRect, calculateLabelRect, calculateThumbSize, calculateTickRect, calculateTrackBuffer, calculateTrackRect, createChangeListener, createComponentListener, createFocusListener, createPropertyChangeListener, createScrollListener, drawInverted, getBaselineResizeBehavior, getFocusColor, getHeightOfHighValueLabel, getHeightOfLowValueLabel, getHeightOfTallestLabel, getHighestValue, getHighestValueLabel, getHighlightColor, getLowestValue, getLowestValueLabel, getMaximumSize, getMinimumHorizontalSize, getMinimumVerticalSize, getPreferredHorizontalSize, getPreferredVerticalSize, getShadowColor, getTickLength, getWidthOfHighValueLabel, getWidthOfLowValueLabel, getWidthOfWidestLabel, installKeyboardActions, installUI, isDragging, labelsHaveSameBaselines, paintFocus, paintHorizontalLabel, paintLabels, paintMajorTickForHorizSlider, paintMajorTickForVertSlider, paintMinorTickForHorizSlider, paintMinorTickForVertSlider, paintThumb, paintTicks, paintTrack, paintVerticalLabel, recalculateIfOrientationChanged, scrollByBlock, scrollByUnit, scrollDueToClickInTrack, uninstallKeyboardActions, uninstallUI, yPositionForValuecontains, getAccessibleChild, getAccessibleChildrenCountprotected SynthSliderUI(JSlider c)
public static ComponentUI createUI(JComponent c)
c -组件创建UI对象
protected void installDefaults(JSlider slider)
installDefaults 方法重写,继承类
BasicSliderUI
protected void uninstallDefaults(JSlider slider)
LookAndFeel时卸载。
uninstallDefaults 方法重写,继承类
BasicSliderUI
protected void installListeners(JSlider slider)
installListeners 方法重写,继承类
BasicSliderUI
protected void uninstallListeners(JSlider slider)
uninstallListeners 方法重写,继承类
BasicSliderUI
protected BasicSliderUI.TrackListener createTrackListener(JSlider s)
createTrackListener 方法重写,继承类
BasicSliderUI
public int getBaseline(JComponent c, int width, int height)
getBaseline 方法重写,继承类
BasicSliderUI
c -
JComponent基线被要求
width的宽度得到基线
height -高度得到基线
JComponent.getBaseline(int, int)
public Dimension getPreferredSize(JComponent c)
null返回,首选大小将由组件的布局管理器的计算(这是与一个特定的布局管理器安装任何组件的首选方法)。此方法的默认实现将返回
null。
getPreferredSize 方法重写,继承类
BasicSliderUI
c优先度的被查询的成分;这种说法常常被忽视,但可能如果UI对象是无状态的,共享由多个组件
JComponent.getPreferredSize(),
LayoutManager.preferredLayoutSize(java.awt.Container)
public Dimension getMinimumSize(JComponent c)
null返回,最小尺寸将由组件的布局管理器的计算(这是与一个特定的布局管理器安装任何组件的首选方法)。该方法调用
getPreferredSize和返回值的默认实现。
getMinimumSize 方法重写,继承类
BasicSliderUI
c最小尺寸的是被查询的成分;这种说法常常被忽视,但可能如果UI对象是无状态的,共享由多个组件
Dimension对象或
null
JComponent.getMinimumSize(),
LayoutManager.minimumLayoutSize(java.awt.Container),
ComponentUI.getPreferredSize(javax.swing.JComponent)
protected void calculateGeometry()
calculateGeometry 方法重写,继承类
BasicSliderUI
protected void layout()
protected void calculateThumbLocation()
calculateThumbLocation 方法重写,继承类
BasicSliderUI
public void setThumbLocation(int x,
int y)
setThumbLocation 方法重写,继承类
BasicSliderUI
protected int xPositionForValue(int value)
xPositionForValue 方法重写,继承类
BasicSliderUI
protected int yPositionForValue(int value,
int trackY,
int trackHeight)
trackHeight可能出现不确定的结果是阴性的。
yPositionForValue 方法重写,继承类
BasicSliderUI
value去定位滑块的值
trackY -轨道y-origin
trackHeight -轨道的高度
public int valueForYPosition(int yPos)
yPos超出轨道的底部或顶部,此方法设置值为最小或滑块的最大值,这取决于如果滑块倒不。
valueForYPosition 方法重写,继承类
BasicSliderUI
public int valueForXPosition(int xPos)
xPos超出轨道在左或右,此方法设置值为最小或滑块的最大值,这取决于如果滑块倒不。
valueForXPosition 方法重写,继承类
BasicSliderUI
protected Dimension getThumbSize()
getThumbSize 方法重写,继承类
BasicSliderUI
protected void recalculateIfInsetsChanged()
recalculateIfInsetsChanged 方法重写,继承类
BasicSliderUI
public SynthContext getContext(JComponent c)
getContext 接口
SynthUI
c组件请求synthcontext。
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 方法重写,继承类
BasicSliderUI
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 paintThumb(SynthContext context, Graphics g, Rectangle thumbBounds)
context -正在绘制的组件上下文
g -
Graphics对象用于绘画
thumbBounds包围盒的拇指
protected void paintTrack(SynthContext context, Graphics g, Rectangle trackBounds)
context -正在绘制的组件上下文
g -
Graphics对象用于绘画
trackBounds包围盒的轨道
public void propertyChange(PropertyChangeEvent e)
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.