public class SynthTextFieldUI extends BasicTextFieldUI implements SynthUI
JTextField
。
警告:序列化该类的对象与以后的Swing版本不兼容。当前的序列化支持适用于短期贮藏或RMI运行相同Swing版本的应用程序之间。为1.4,为所有JavaBeans™长期存储的支持已被添加到java.beans
包。请看XMLEncoder
。
BasicTextUI.BasicCaret, BasicTextUI.BasicHighlighter
DEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTED
Constructor and Description |
---|
SynthTextFieldUI() |
Modifier and Type | Method and Description |
---|---|
static ComponentUI |
createUI(JComponent c)
创建一个用户界面的一个文本输入框。
|
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改变。
|
protected void |
uninstallDefaults()
设置组件的属性尚未明确,
null 。
|
void |
update(Graphics g, JComponent c)
通知这个UI代理重新绘制指定的组件。
|
create, getBaseline, getBaselineResizeBehavior, getPropertyPrefix
create, createCaret, createHighlighter, createKeymap, damageRange, damageRange, getComponent, getEditorKit, getKeymapName, getMaximumSize, getMinimumSize, getNextVisualPositionFrom, getPreferredSize, getRootView, getToolTipText, getVisibleEditorRect, installKeyboardActions, installListeners, installUI, modelChanged, modelToView, modelToView, paint, paintSafely, setView, uninstallKeyboardActions, uninstallListeners, uninstallUI, viewToModel, viewToModel
contains, getAccessibleChild, getAccessibleChildrenCount
public static ComponentUI createUI(JComponent c)
c
-文本字段
public SynthContext getContext(JComponent c)
getContext
接口
SynthUI
c
组件请求synthcontext。
public void update(Graphics g, JComponent c)
paint(SynthContext,Graphics)
方法。
在一般情况下,该方法不需要由子类重写。所有的外观和感觉的渲染代码应该在paint
方法。
update
方法重写,继承类
BasicTextUI
g
用于绘画的
Graphics
对象
c
被画的成分
paint(SynthContext,Graphics)
protected void paint(SynthContext context, Graphics g)
这是送给BasicTextUI.paintSafely(java.awt.Graphics)
方法保证模型不改变该线程视图则是渲染下(如果相关的模型是从AbstractDocument
)。这使该模型能够异步更新。
context
-正在绘制的组件上下文
g
用于绘画的
Graphics
对象
update(Graphics,JComponent)
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 paintBackground(Graphics g)
paintBackground
方法重写,继承类
BasicTextUI
g
-图形上下文
protected void propertyChange(PropertyChangeEvent evt)
propertyChange
方法重写,继承类
BasicTextUI
evt
-属性更改事件
protected void installDefaults()
protected void uninstallDefaults()
null
。物业是考虑重写如果其当前值不是一个
UIResource
。
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.