public class SynthProgressBarUI extends BasicProgressBarUI implements SynthUI, PropertyChangeListener
JProgressBar
。
BasicProgressBarUI.ChangeHandler
boxRect, changeListener, progressBar
DEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTED
Constructor and Description |
---|
SynthProgressBarUI() |
Modifier and Type | Method and Description |
---|---|
static ComponentUI |
createUI(JComponent x)
为给定组件创建一个新的用户界面对象。
|
int |
getBaseline(JComponent c, int width, int height)
返回基线。
|
protected Rectangle |
getBox(Rectangle r)
商店的位置和大小的弹跳框会画目前动画指数
r 返回
r 。
|
SynthContext |
getContext(JComponent c)
返回指定组件的上下文。
|
Dimension |
getPreferredSize(JComponent c)
返回指定组件的首选大小适合的外观和感觉。
|
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 |
paintText(SynthContext context, Graphics g, String title)
绘制组件的文本。
|
void |
propertyChange(PropertyChangeEvent e)
当改变绑定属性时,这种方法会被调用。
|
protected void |
setAnimationIndex(int newValue)
设置为指定的值并要求进度条被重画当前动画帧的索引。
|
protected void |
uninstallDefaults() |
protected void |
uninstallListeners()
移除此对象安装的所有侦听器。
|
void |
update(Graphics g, JComponent c)
通知这个UI代理重新绘制指定的组件。
|
getAmountFull, getAnimationIndex, getBaselineResizeBehavior, getBoxLength, getCellLength, getCellSpacing, getFrameCount, getMaximumSize, getMinimumSize, getPreferredInnerHorizontal, getPreferredInnerVertical, getSelectionBackground, getSelectionForeground, getStringPlacement, incrementAnimationIndex, installUI, paintDeterminate, paintIndeterminate, paintString, setCellLength, setCellSpacing, startAnimationTimer, stopAnimationTimer, uninstallUI
contains, getAccessibleChild, getAccessibleChildrenCount
public static ComponentUI createUI(JComponent x)
x
-组件创建UI对象
protected void installListeners()
installListeners
方法重写,继承类
BasicProgressBarUI
protected void uninstallListeners()
uninstallListeners
方法重写,继承类
BasicProgressBarUI
protected void installDefaults()
installDefaults
方法重写,继承类
BasicProgressBarUI
protected void uninstallDefaults()
uninstallDefaults
方法重写,继承类
BasicProgressBarUI
public SynthContext getContext(JComponent c)
getContext
接口
SynthUI
c
组件请求synthcontext。
public int getBaseline(JComponent c, int width, int height)
getBaseline
方法重写,继承类
BasicProgressBarUI
c
-
JComponent
基线被要求
width
的宽度得到基线
height
-高度得到基线
JComponent.getBaseline(int, int)
protected Rectangle getBox(Rectangle r)
r
返回
r
当前动画索引大小的位置。子类添加到绘画中
paintIndeterminate
这类的执行进行在弹跳框勾出一个轮廓,例如,可以使用此方法得到的弹盒,只是画的位置。通过重写此方法,你的弹跳框的大小和位置的完全控制,而无需重新实现
paintIndeterminate
。
getBox
方法重写,继承类
BasicProgressBarUI
r
-矩形实例进行修改;可以
null
null
如果没有盒子应该画;否则,返回传入的矩形(如果非空)或一个新的矩形
BasicProgressBarUI.setAnimationIndex(int)
protected void setAnimationIndex(int newValue)
repaint
方法被调用的方法。
setAnimationIndex
方法重写,继承类
BasicProgressBarUI
newValue
-新动画指数;没有检查是对其价值进行
BasicProgressBarUI.incrementAnimationIndex()
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
方法重写,继承类
BasicProgressBarUI
g
用于绘画的
Graphics
对象
c
被画的成分
paint(SynthContext,Graphics)
protected void paint(SynthContext context, Graphics g)
context
-正在绘制的组件上下文
g
用于绘画的
Graphics
对象
update(Graphics,JComponent)
protected void paintText(SynthContext context, Graphics g, String title)
context
-正在绘制的组件上下文
g
-
Graphics
对象用于绘画
title
-画文本
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
的身高
public void propertyChange(PropertyChangeEvent e)
propertyChange
接口
PropertyChangeListener
e
- PropertyChangeEvent对象描述事件源和性质已经改变。
public Dimension getPreferredSize(JComponent c)
null
返回,首选大小将由组件的布局管理器的计算(这是与一个特定的布局管理器安装任何组件的首选方法)。此方法的默认实现将返回
null
。
getPreferredSize
方法重写,继承类
BasicProgressBarUI
c
优先度的被查询的成分;这种说法常常被忽视,但可能如果UI对象是无状态的,共享由多个组件
JComponent.getPreferredSize()
,
LayoutManager.preferredLayoutSize(java.awt.Container)
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.