JavaTM Platform
Standard Ed. 6

javax.swing.plaf.basic
类 BasicEditorPaneUI

java.lang.Object
  继承者 javax.swing.plaf.ComponentUI
      继承者 javax.swing.plaf.TextUI
          继承者 javax.swing.plaf.basic.BasicTextUI
              继承者 javax.swing.plaf.basic.BasicEditorPaneUI
所有已实现的接口:
ViewFactory
直接已知子类:
BasicTextPaneUI

public class BasicEditorPaneUI
     
extends BasicTextUI

为 JEditorPane 提供外观。

警告:此类的序列化对象将与以后的 Swing 版本不兼容。当前的序列化支持适用于短期存储或运行相同 Swing 版本的应用程序之间的 RMI。从 1.4 版本开始,已在 java.beans 包中添加了支持所有 JavaBeansTM 长期存储的功能。请参见 XMLEncoder


嵌套类摘要
 
从类 javax.swing.plaf.basic.BasicTextUI 继承的嵌套类/接口
BasicTextUI.BasicCaret, BasicTextUI.BasicHighlighter
 
构造方法摘要
BasicEditorPaneUI()
          创建新的 BasicEditorPaneUI。
 
方法摘要
static ComponentUI createUI(JComponent c)
          创建 JTextPane 的 UI。
 EditorKit getEditorKit(JTextComponent tc)
          获取 UI 的 EditorKit。
protected  String getPropertyPrefix()
          获取用作键以通过 UIManager 查找属性的名称。
 void installUI(JComponent c)
          安装组件的 UI。
protected  void propertyChange(PropertyChangeEvent evt)
          当关联的 JTextComponent 上有一个绑定 (bound) 属性改变时,调用此方法。
 void uninstallUI(JComponent c)
          卸载组件的 UI。
 
从类 javax.swing.plaf.basic.BasicTextUI 继承的方法
create, create, createCaret, createHighlighter, createKeymap, damageRange, damageRange, getComponent, getKeymapName, getMaximumSize, getMinimumSize, getNextVisualPositionFrom, getPreferredSize, getRootView, getToolTipText, getVisibleEditorRect, installDefaults, installKeyboardActions, installListeners, modelChanged, modelToView, modelToView, paint, paintBackground, paintSafely, setView, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, update, viewToModel, viewToModel
 
从类 javax.swing.plaf.ComponentUI 继承的方法
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

BasicEditorPaneUI

public BasicEditorPaneUI()
创建新的 BasicEditorPaneUI。

方法详细信息

createUI

public static ComponentUI createUI(JComponent c)
创建 JTextPane 的 UI。

参数:
c - JTextPane 组件
返回:
UI

getPropertyPrefix

protected String getPropertyPrefix()
获取用作键以通过 UIManager 查找属性的名称。它用作所有标准文本属性的前缀。

指定者:
BasicTextUI 中的 getPropertyPrefix
返回:
名称 ("EditorPane")

installUI

public void installUI(JComponent c)
安装组件的 UI。此方法执行以下操作。
  1. 将关联组件设置为不透明(可以由子类或直接在 JTextComponent 上方便地更改),这种情况是最常见的。此操作将导致绘制组件的背景色。
  2. 将默认的插入符和 highlighter 安装到关联组件中。
  3. 附加到编辑器和模型。如果不存在模型,则创建一个默认模型。
  4. 创建用于表示模型的视图工厂和视图层次结构。

覆盖:
BasicTextUI 中的 installUI
参数:
c - 编辑器组件
从以下版本开始:
1.5
另请参见:
ComponentUI.installUI(javax.swing.JComponent)

uninstallUI

public void uninstallUI(JComponent c)
卸载组件的 UI。此方法移除侦听器、卸载 highlighter、移除视图并将 keymap 全部设为 null。

覆盖:
BasicTextUI 中的 uninstallUI
参数:
c - 编辑器组件
从以下版本开始:
1.5
另请参见:
ComponentUI.uninstallUI(javax.swing.JComponent)

getEditorKit

public EditorKit getEditorKit(JTextComponent tc)
获取 UI 的 EditorKit。它是在关联的 JEditorPane 中的任何当前设置。

覆盖:
BasicTextUI 中的 getEditorKit
参数:
tc - 文本组件,为其安装此 UI
返回:
编辑器功能
另请参见:
TextUI.getEditorKit(javax.swing.text.JTextComponent)

propertyChange

protected void propertyChange(PropertyChangeEvent evt)
当关联的 JTextComponent 上有一个绑定 (bound) 属性改变时,调用此方法。此为一个钩子 (hook),UI 实现可以更改它来反映 UI 显示 JTextComponent 子类的绑定属性的方式。可以通过实现它来基于 EditorKit 更改重新构建 ActionMap。

覆盖:
BasicTextUI 中的 propertyChange
参数:
evt - 属性更改事件

JavaTM Platform
Standard Ed. 6

提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策