public class SynthTextAreaUI extends BasicTextAreaUI implements SynthUI
警告:此类的序列化对象与将来的Swing版本不兼容。 当前的序列化支持适用于运行相同版本的Swing的应用程序之间的短期存储或RMI。 从1.4开始,对所有JavaBeans的长期存储的支持已经添加到java.beans包中。 请参阅XMLEncoder 。
BasicTextUI.BasicCaret, BasicTextUI.BasicHighlighterDEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTED| Constructor and Description |
|---|
SynthTextAreaUI() |
| Modifier and Type | Method and Description |
|---|---|
static ComponentUI |
createUI(JComponent ta)
为JTextArea创建一个UI对象。
|
SynthContext |
getContext(JComponent c)
返回指定组件的上下文。
|
protected void |
installDefaults()
初始化组件属性,如字体,前景,背景,插入符号颜色,选择颜色,选定的文本颜色,禁用的文本颜色和边框颜色。
|
protected void |
paint(SynthContext context, Graphics g)
绘制指定的组件。
|
protected void |
paintBackground(Graphics g)
绘制视图的背景。
|
void |
paintBorder(SynthContext context, Graphics g, int x, int y, int w, int h)
画边框
|
protected void |
propertyChange(PropertyChangeEvent evt)
当在关联的JTextComponent上更改bound属性时,将调用此方法。
|
protected void |
uninstallDefaults()
将未明确覆盖的组件属性设置为
null 。
|
void |
update(Graphics g, JComponent c)
通知此UI代理重新绘制指定的组件。
|
create, getBaseline, getBaselineResizeBehavior, getMinimumSize, getPreferredSize, getPropertyPrefixcreate, createCaret, createHighlighter, createKeymap, damageRange, damageRange, getComponent, getEditorKit, getKeymapName, getMaximumSize, getNextVisualPositionFrom, getRootView, getToolTipText, getVisibleEditorRect, installKeyboardActions, installListeners, installUI, modelChanged, modelToView, modelToView, paint, paintSafely, setView, uninstallKeyboardActions, uninstallListeners, uninstallUI, viewToModel, viewToModelcontains, getAccessibleChild, getAccessibleChildrenCountpublic static ComponentUI createUI(JComponent ta)
ta - 一个文本区域
protected void installDefaults()
protected void uninstallDefaults()
null 。
如果某个属性的当前值不是UIResource被UIResource 。
public SynthContext getContext(JComponent c)
getContext在接口
SynthUI
c - 组件请求SynthContext。
public void update(Graphics g, JComponent c)
paint(SynthContext,Graphics)方法。
通常,此方法不需要被子类覆盖。 所有Look和Feel渲染代码应该位于paint方法中。
update在
BasicTextUI类
g - 用于绘画的
Graphics对象
c - 正在涂漆的组件
paint(SynthContext,Graphics)
protected void paint(SynthContext context, Graphics g)
context - 正在绘制的组件的上下文
g - 用于绘画的
Graphics对象
update(Graphics,JComponent)
protected void paintBackground(Graphics g)
paintBackground在
BasicTextUI
g - 图形上下文
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 propertyChange(PropertyChangeEvent evt)
propertyChange在
BasicTextAreaUI
evt - 物业变更事件
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.