java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ScrollBarUI
javax.swing.plaf.basic.BasicScrollBarUI
- 所有已实现的接口:
LayoutManager,SwingConstants
- 已知子类:
MetalScrollBarUI,SynthScrollBarUI
实现基本外观的 ScrollBarUI
-
内部类总结
内部类修饰符和类型类描述protected class光标键的监听。protected class监听模型更改的监听。class属性更改处理程序protected classScrollPane中启动的滚动事件的监听器。protected class跟踪鼠标拖动。 -
字段摘要
字段修饰符和类型Field描述protected BasicScrollBarUI.ArrowButtonListener按钮监听protected JButton递减按钮protected static final int减少高光protected int减量按钮和轨道之间的距离。protected JButton增量按钮protected static final int增加高光protected int增量按钮和轨道之间的距离。protected boolean拖动protected Dimension最大拇指尺寸protected Dimension最小拇指大小protected BasicScrollBarUI.ModelListener模型监听protected static final int无亮点protected PropertyChangeListener属性变化监听protected JScrollBarScrollbarprotected int提示宽度(垂直时)或高度(水平时)应该是多少。protected BasicScrollBarUI.ScrollListener滚动监听protected Timer滚动计时器protected Color拇指颜色protected Color拇指深色阴影颜色protected Color拇指高亮颜色protected Color拇指光影颜色protected RectangleThumb 矩形protected Color赛道颜色protected int曲目亮点protected Color轨迹高亮颜色protected BasicScrollBarUI.TrackListener跟踪监听protected RectangleTrack 矩形在接口 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 -
构造方法总结
构造方法 -
方法总结
修饰符和类型方法描述voidaddLayoutComponent(String name, Component child) 如果布局管理器使用每个组件字符串,则将组件comp添加到布局中,将其与name指定的字符串相关联。protected void配置滚动条颜色。protected BasicScrollBarUI.ArrowButtonListener创建一个箭头按钮监听。protected JButtoncreateDecreaseButton(int orientation) 创建一个减少按钮。protected JButtoncreateIncreaseButton(int orientation) 创建一个增加按钮。protected BasicScrollBarUI.ModelListener创建模型监听。protected PropertyChangeListener创建属性更改监听。protected BasicScrollBarUI.ScrollListener创建滚动监听。protected BasicScrollBarUI.TrackListener创建一个轨道监听。static ComponentUI创建用户界面。返回适合外观的指定组件的最大尺寸。protected Dimension返回 thumb 可接受的最大尺寸。protected Dimension返回拇指可接受的最小尺寸。垂直滚动条的首选宽度是(非null)增量/减量按钮的首选宽度的最大值,以及拇指的最小宽度。boolean指示用户是否可以使用鼠标手势(通常是鼠标中键)绝对定位拇指。protected Rectangle返回拇指的当前大小/位置。protected Rectangle返回轨道的当前边界,即递增和递减按钮之间的空间,减去insets。protected void安装组件。protected void安装默认值。protected void安装键盘操作。protected void安装监听。void安装用户界面。boolean如果鼠标当前位于拇指上方,则返回 true。voidlayoutContainer(Container scrollbarContainer) 布置指定的容器。protected void布置一个水平滚动条。protected void布置一个垂直滚动条。minimumLayoutSize(Container scrollbarContainer) 给定容器包含的组件,计算指定容器的最小尺寸。protected void绘制减少高光。protected void绘制增加高光。protected voidpaintThumb(Graphics g, JComponent c, Rectangle thumbBounds) 画拇指。protected voidpaintTrack(Graphics g, JComponent c, Rectangle trackBounds) 绘制轨道。preferredLayoutSize(Container scrollbarContainer) 给定容器包含的组件,计算指定容器的首选尺寸。voidremoveLayoutComponent(Component child) 从布局中移除指定的组件。protected voidscrollByBlock(int direction) 按块滚动。protected voidscrollByUnit(int direction) 按单位滚动。protected voidsetThumbBounds(int x, int y, int width, int height) 设置拇指的边界并强制重新绘制包括旧的 thumbBounds 和新的。protected voidsetThumbRollover(boolean active) 设置鼠标当前是否在拇指上方。protected void卸载组件。protected void卸载默认值。protected void卸载键盘操作。protected void卸载监听。void卸载用户界面。在类 javax.swing.plaf.ComponentUI 中声明的方法
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMinimumSize, paint, update
-
字段详细信息
-
minimumThumbSize
最小拇指大小 -
maximumThumbSize
最大拇指尺寸 -
thumbHighlightColor
拇指高亮颜色 -
thumbLightShadowColor
拇指光影颜色 -
thumbDarkShadowColor
拇指深色阴影颜色 -
thumbColor
拇指颜色 -
trackColor
赛道颜色 -
trackHighlightColor
轨迹高亮颜色 -
scrollbar
Scrollbar -
incrButton
增量按钮 -
decrButton
递减按钮 -
isDragging
protected boolean isDragging拖动 -
trackListener
跟踪监听 -
buttonListener
按钮监听 -
modelListener
模型监听 -
thumbRect
Thumb 矩形 -
trackRect
Track 矩形 -
trackHighlight
protected int trackHighlight曲目亮点 -
NO_HIGHLIGHT
protected static final int NO_HIGHLIGHT无亮点- 参见:
-
DECREASE_HIGHLIGHT
protected static final int DECREASE_HIGHLIGHT减少高光- 参见:
-
INCREASE_HIGHLIGHT
protected static final int INCREASE_HIGHLIGHT增加高光- 参见:
-
scrollListener
滚动监听 -
propertyChangeListener
属性变化监听 -
scrollTimer
滚动计时器 -
scrollBarWidth
protected int scrollBarWidth提示宽度(垂直时)或高度(水平时)应该是多少。- 自从:
- 1.7
-
incrGap
protected int incrGap增量按钮和轨道之间的距离。这可能是一个负数。如果为负值,则按钮和轨道之间会发生重叠,这对异形按钮很有用。- 自从:
- 1.7
-
decrGap
protected int decrGap减量按钮和轨道之间的距离。这可能是一个负数。如果为负值,则按钮和轨道之间会发生重叠,这对异形按钮很有用。- 自从:
- 1.7
-
-
构造方法详细信息
-
BasicScrollBarUI
public BasicScrollBarUI()构造一个BasicScrollBarUI
-
-
方法详情
-
createUI
创建用户界面。- 参数:
c- 组件- 返回:
- 用户界面
-
configureScrollBarColors
protected void configureScrollBarColors()配置滚动条颜色。 -
installUI
安装用户界面。- 重写:
installUI在类ComponentUI中- 参数:
c- 组件- 参见:
-
uninstallUI
卸载用户界面。- 重写:
uninstallUI在类ComponentUI中- 参数:
c- 组件- 参见:
-
installDefaults
protected void installDefaults()安装默认值。 -
installComponents
protected void installComponents()安装组件。 -
uninstallComponents
protected void uninstallComponents()卸载组件。 -
installListeners
protected void installListeners()安装监听。 -
installKeyboardActions
protected void installKeyboardActions()安装键盘操作。 -
uninstallKeyboardActions
protected void uninstallKeyboardActions()卸载键盘操作。 -
uninstallListeners
protected void uninstallListeners()卸载监听。 -
uninstallDefaults
protected void uninstallDefaults()卸载默认值。 -
createTrackListener
创建一个轨道监听。- 返回:
- 轨道听众
-
createArrowButtonListener
创建一个箭头按钮监听。- 返回:
- 箭头按钮监听
-
createModelListener
创建模型监听。- 返回:
- 模范听众
-
createScrollListener
创建滚动监听。- 返回:
- 滚动监听
-
createPropertyChangeListener
创建属性更改监听。- 返回:
- 属性更改监听
-
setThumbRollover
protected void setThumbRollover(boolean active) 设置鼠标当前是否在拇指上方。- 参数:
active- True 表示拇指当前处于活动状态。- 自从:
- 1.5
-
isThumbRollover
public boolean isThumbRollover()如果鼠标当前位于拇指上方,则返回 true。- 返回:
- 如果拇指当前处于活动状态则为真
- 自从:
- 1.5
-
getPreferredSize
垂直滚动条的首选宽度是(非null)增量/减量按钮的首选宽度的最大值,以及拇指的最小宽度。优选高度是相同部件的优选高度之和。水平滚动条的首选大小的基础是相似的。preferredSize仅计算一次,对该方法的后续调用仅返回缓存大小。- 重写:
getPreferredSize在类ComponentUI中- 参数:
c- 将此方法委托给我们的JScrollBar- 返回:
- Basic JScrollBar 的首选大小
- 参见:
-
getMaximumSize
从类复制的描述:ComponentUI返回适合外观的指定组件的最大尺寸。如果返回null,则最大尺寸将由组件的布局管理器计算(这是安装了特定布局管理器的任何组件的首选方法)。此方法的默认实现调用getPreferredSize并返回该值。- 重写:
getMaximumSize在类ComponentUI中- 参数:
c- 将此方法委托给我们的 JScrollBar。- 返回:
- 新维度(整数.MAX_VALUE,整数.MAX_VALUE);
- 参见:
-
createDecreaseButton
创建一个减少按钮。- 参数:
orientation- 方向- 返回:
- 一个减少按钮
-
createIncreaseButton
创建一个增加按钮。- 参数:
orientation- 方向- 返回:
- 增加按钮
-
paintDecreaseHighlight
绘制减少高光。- 参数:
g- 图形
-
paintIncreaseHighlight
绘制增加高光。- 参数:
g- 图形
-
paintTrack
绘制轨道。- 参数:
g- 图形c- 组件trackBounds- 轨道边界
-
paintThumb
画拇指。- 参数:
g- 图形c- 组件thumbBounds- 拇指边界
-
getMinimumThumbSize
返回拇指可接受的最小尺寸。如果滚动条变得太小以至于无法使用此尺寸,则缩略图将被隐藏。警告:不应修改此方法返回的值,它是一个共享静态常量。
- 返回:
- 拇指可接受的最小尺寸。
- 参见:
-
getMaximumThumbSize
返回 thumb 可接受的最大尺寸。要创建固定大小的拇指,请使此方法和getMinimumThumbSize返回相同的值。警告:不应修改此方法返回的值,它是一个共享静态常量。
- 返回:
- 拇指可接受的最大尺寸。
- 参见:
-
addLayoutComponent
从接口LayoutManager复制的描述如果布局管理器使用每个组件字符串,则将组件comp添加到布局中,将其与name指定的字符串相关联。- 指定者:
addLayoutComponent在接口LayoutManager中- 参数:
name- 要与组件关联的字符串child- 要添加的组件
-
removeLayoutComponent
从接口LayoutManager复制的描述从布局中移除指定的组件。- 指定者:
removeLayoutComponent在接口LayoutManager中- 参数:
child- 要删除的组件
-
preferredLayoutSize
从接口LayoutManager复制的描述给定容器包含的组件,计算指定容器的首选尺寸。- 指定者:
preferredLayoutSize在接口LayoutManager中- 参数:
scrollbarContainer- 要布置的容器- 返回:
- 容器的首选尺寸
- 参见:
-
minimumLayoutSize
从接口LayoutManager复制的描述给定容器包含的组件,计算指定容器的最小尺寸。- 指定者:
minimumLayoutSize在接口LayoutManager中- 参数:
scrollbarContainer- 要布局的组件- 返回:
- 容器的最小尺寸
- 参见:
-
layoutVScrollbar
布置一个垂直滚动条。- 参数:
sb- 滚动条
-
layoutHScrollbar
布置一个水平滚动条。- 参数:
sb- 滚动条
-
layoutContainer
从接口LayoutManager复制的描述布置指定的容器。- 指定者:
layoutContainer在接口LayoutManager中- 参数:
scrollbarContainer- 要布置的容器
-
setThumbBounds
protected void setThumbBounds(int x, int y, int width, int height) 设置拇指的边界并强制重新绘制包括旧的 thumbBounds 和新的。- 参数:
x- 设置拇指的 x 位置y- 设置拇指的 y 位置width- 设置拇指的宽度height- 设置拇指的高度- 参见:
-
getThumbBounds
返回拇指的当前大小/位置。警告:不应修改此方法返回的值,它是对实际矩形的引用,而不是副本。
- 返回:
- 拇指的当前大小/位置。
- 参见:
-
getTrackBounds
返回轨道的当前边界,即递增和递减按钮之间的空间,减去insets。每次滚动条布局(验证)时,此方法返回的值都会更新。警告:不应修改此方法返回的值,它是对实际矩形的引用,而不是副本。
- 返回:
- 滚动条轨道的当前边界
- 参见:
-
scrollByBlock
protected void scrollByBlock(int direction) 按块滚动。- 参数:
direction- 滚动方向
-
scrollByUnit
protected void scrollByUnit(int direction) 按单位滚动。- 参数:
direction- 滚动方向
-
getSupportsAbsolutePositioning
public boolean getSupportsAbsolutePositioning()指示用户是否可以使用鼠标手势(通常是鼠标中键)绝对定位拇指。- 返回:
- 如果鼠标手势可以绝对定位拇指,则为真
- 自从:
- 1.5
-