public class MetalSliderUI extends BasicSliderUI
警告:此类的序列化对象与将来的Swing版本不兼容。 当前的序列化支持适用于运行相同版本的Swing的应用程序之间的短期存储或RMI。 从1.4版本开始,所有JavaBeans的长期存储支持已被添加到java.beans
包中。 请参阅XMLEncoder
。
Modifier and Type | Class and Description |
---|---|
protected class |
MetalSliderUI.MetalPropertyListener |
BasicSliderUI.ActionScroller, BasicSliderUI.ChangeHandler, BasicSliderUI.ComponentHandler, BasicSliderUI.FocusHandler, BasicSliderUI.PropertyChangeHandler, BasicSliderUI.ScrollListener, BasicSliderUI.TrackListener
Modifier and Type | Field and Description |
---|---|
protected static Color |
darkShadowColor |
protected boolean |
filledSlider |
protected static Color |
highlightColor |
protected static Icon |
horizThumbIcon
默认的水平拇指
Icon 。
|
protected String |
SLIDER_FILL |
protected static Color |
thumbColor |
protected int |
TICK_BUFFER |
protected static int |
tickLength |
protected static int |
trackWidth |
protected static Icon |
vertThumbIcon
默认垂直拇指
Icon 。
|
changeListener, componentListener, contentRect, focusInsets, focusListener, focusRect, insetCache, labelRect, leftToRightCache, MAX_SCROLL, MIN_SCROLL, NEGATIVE_SCROLL, POSITIVE_SCROLL, propertyChangeListener, scrollListener, scrollTimer, slider, thumbRect, tickRect, trackBuffer, trackListener, trackRect
Constructor and Description |
---|
MetalSliderUI() |
Modifier and Type | Method and Description |
---|---|
protected PropertyChangeListener |
createPropertyChangeListener(JSlider slider) |
static ComponentUI |
createUI(JComponent c) |
protected int |
getThumbOverhang()
返回拇指经过滑动条的量。
|
protected Dimension |
getThumbSize() |
int |
getTickLength()
获取水平滑块的刻度区域的高度以及垂直滑块的刻度区域的宽度。
|
protected int |
getTrackLength()
返回滑动条的较长尺寸。
|
protected int |
getTrackWidth()
返回轨道的较短尺寸。
|
void |
installUI(JComponent c)
适当地配置指定的组件的外观和感觉。
|
void |
paintFocus(Graphics g) |
protected void |
paintMajorTickForHorizSlider(Graphics g, Rectangle tickBounds, int x) |
protected void |
paintMajorTickForVertSlider(Graphics g, Rectangle tickBounds, int y) |
protected void |
paintMinorTickForHorizSlider(Graphics g, Rectangle tickBounds, int x) |
protected void |
paintMinorTickForVertSlider(Graphics g, Rectangle tickBounds, int y) |
void |
paintThumb(Graphics g) |
void |
paintTrack(Graphics g) |
protected void |
scrollDueToClickInTrack(int dir)
当在轨道中检测到mousePressed时,而不是在缩略图中调用此函数。
|
calculateContentRect, calculateFocusRect, calculateGeometry, calculateLabelRect, calculateThumbLocation, calculateThumbSize, calculateTickRect, calculateTrackBuffer, calculateTrackRect, createChangeListener, createComponentListener, createFocusListener, createScrollListener, createTrackListener, drawInverted, getBaseline, getBaselineResizeBehavior, getFocusColor, getHeightOfHighValueLabel, getHeightOfLowValueLabel, getHeightOfTallestLabel, getHighestValue, getHighestValueLabel, getHighlightColor, getLowestValue, getLowestValueLabel, getMaximumSize, getMinimumHorizontalSize, getMinimumSize, getMinimumVerticalSize, getPreferredHorizontalSize, getPreferredSize, getPreferredVerticalSize, getShadowColor, getWidthOfHighValueLabel, getWidthOfLowValueLabel, getWidthOfWidestLabel, installDefaults, installKeyboardActions, installListeners, isDragging, labelsHaveSameBaselines, paint, paintHorizontalLabel, paintLabels, paintTicks, paintVerticalLabel, recalculateIfInsetsChanged, recalculateIfOrientationChanged, scrollByBlock, scrollByUnit, setThumbLocation, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI, valueForXPosition, valueForYPosition, xPositionForValue, yPositionForValue, yPositionForValue
contains, getAccessibleChild, getAccessibleChildrenCount, update
protected final int TICK_BUFFER
protected boolean filledSlider
protected static Color thumbColor
protected static Color highlightColor
protected static Color darkShadowColor
protected static int trackWidth
protected static int tickLength
protected static Icon horizThumbIcon
Icon
。
此字段可能不会被使用。
要改变Icon
通过该委托使用使用直接设置它Slider.horizontalThumbIcon
UIManager的财产。
protected static Icon vertThumbIcon
Icon
。
此字段可能不会被使用。
要改变Icon
通过该委托使用使用直接设置它Slider.verticalThumbIcon
UIManager的财产。
protected final String SLIDER_FILL
public static ComponentUI createUI(JComponent c)
public void installUI(JComponent c)
ComponentUI
ComponentUI
实例作为指定组件上的UI委托时,将调用此方法。
该方法应该完全配置组件的外观,包括以下内容:
LayoutManager
上安装LayoutManager。 PropertyChangeListener
上创建/安装PropertyChangeListener,以便适当地检测和响应组件属性更改。 installUI
在
BasicSliderUI
c
- 正在安装此UI代理的组件
ComponentUI.uninstallUI(javax.swing.JComponent)
,
JComponent.setUI(javax.swing.plaf.ComponentUI)
,
JComponent.updateUI()
protected PropertyChangeListener createPropertyChangeListener(JSlider slider)
public void paintThumb(Graphics g)
paintThumb
在
BasicSliderUI
public void paintTrack(Graphics g)
paintTrack
在
BasicSliderUI
public void paintFocus(Graphics g)
paintFocus
在
BasicSliderUI
protected Dimension getThumbSize()
getThumbSize
在
BasicSliderUI
类
public int getTickLength()
protected int getTrackWidth()
protected int getTrackLength()
protected int getThumbOverhang()
protected void scrollDueToClickInTrack(int dir)
BasicSliderUI
protected void paintMinorTickForHorizSlider(Graphics g, Rectangle tickBounds, int x)
protected void paintMajorTickForHorizSlider(Graphics g, Rectangle tickBounds, int x)
protected void paintMinorTickForVertSlider(Graphics g, Rectangle tickBounds, int y)
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.