public class SynthViewportUI extends ViewportUI implements PropertyChangeListener, SynthUI
JViewport。
DEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTED| Constructor and Description |
|---|
SynthViewportUI() |
| Modifier and Type | Method and Description |
|---|---|
static ComponentUI |
createUI(JComponent c)
为给定组件创建一个新的用户界面对象。
|
SynthContext |
getContext(JComponent c)
返回指定组件的上下文。
|
protected void |
installDefaults(JComponent c)
安装默认的视口。
|
protected void |
installListeners(JComponent c)
安装听众视口。
|
void |
installUI(JComponent c)
配置指定的组件适当的外观和感觉。
|
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)
油漆边界。
|
void |
propertyChange(PropertyChangeEvent e)
当改变绑定属性时,这种方法会被调用。
|
protected void |
uninstallDefaults(JComponent c)
卸载默认值从一个视窗。
|
protected void |
uninstallListeners(JComponent c)
卸载听众从视口。
|
void |
uninstallUI(JComponent c)
逆转形态,完成指定的组件在
installUI。
|
void |
update(Graphics g, JComponent c)
通知这个UI代理重新绘制指定的组件。
|
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSizepublic static ComponentUI createUI(JComponent c)
c -组件创建UI对象
public void installUI(JComponent c)
ComponentUI实例被安装在指定组件的UI代理。这种方法应该完全配置的组件外观和感觉,包括以下内容:
LayoutManager组件上的必要。PropertyChangeListener变化适当。installUI 方法重写,继承类
ComponentUI
c -组件,UI代理被安装
ComponentUI.uninstallUI(javax.swing.JComponent),
JComponent.setUI(javax.swing.plaf.ComponentUI),
JComponent.updateUI()
public void uninstallUI(JComponent c)
installUI。这个方法被调用时,这个
UIComponent实例被作为指定组件的UI代理删除。这种方法应该撤消配置进行
installUI,小心留下的
JComponent实例在干净的状态(没有多余的听众,外观和感觉的特定属性的对象,等)。这应包括以下几个方面:
uninstallUI 方法重写,继承类
ComponentUI
c -从这个UI代理被删除的组件;这种说法常常被忽视,但可能如果UI对象是无状态的,共享由多个组件
ComponentUI.installUI(javax.swing.JComponent),
JComponent.updateUI()
protected void installDefaults(JComponent c)
c -
JViewport对象
protected void installListeners(JComponent c)
c -
JViewport对象
protected void uninstallListeners(JComponent c)
c -
JViewport对象
protected void uninstallDefaults(JComponent c)
c -
JViewport对象
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 paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)
JViewport类不支持边境。这种实现什么都不做。
paintBorder 接口
SynthUI
context -组件上下文
g -
Graphics油漆
x的X坐标
y的Y坐标
w -边框的宽度
h的身高
public void paint(Graphics g, JComponent c)
这种方法不使用Synth外观。绘画是由paint(SynthContext,Graphics)方法处理。
paint 方法重写,继承类
ComponentUI
g用于绘画的
Graphics对象
c被画的成分
paint(SynthContext,Graphics)
protected void paint(SynthContext context, Graphics g)
context -正在绘制的组件上下文
g用于绘画的
Graphics对象
update(Graphics,JComponent)
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.