JavaTM 2 Platform
Standard Ed. 6

javax.swing.text
类 StyledEditorKit.ForegroundAction

java.lang.Object
  继承者 javax.swing.AbstractAction
      继承者 javax.swing.text.TextAction
          继承者 javax.swing.text.StyledEditorKit.StyledTextAction
              继承者 javax.swing.text.StyledEditorKit.ForegroundAction
所有已实现的接口:
ActionListener, Serializable, Cloneable, EventListener, Action
正在封闭类:
StyledEditorKit

public static class StyledEditorKit.ForegroundAction
extends StyledEditorKit.StyledTextAction

设置前景色的操作。此操作为当前选中的目标 JEditorPane 的范围设置 StyleConstants.Foreground 属性。该操作通过在与目标 JEditorPane 相关联的样式文档上调用 StyledDocument.setCharacterAttributes 来完成。

如果目标文本组件被指定为 ActionEvent 的源,则存在一个命令字符串,该命令字符串将被解释成为前景色。调用 Color.decode 来解释该字符串,而且因此对该方法而言,它是合法的输入。

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


字段摘要
 
从类 javax.swing.AbstractAction 继承的字段
changeSupport, enabled
 
从接口 javax.swing.Action 继承的字段
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
构造方法摘要
StyledEditorKit.ForegroundAction(String nm, Color fg)
          创建新的 ForegroundAction。
 
方法摘要
 void actionPerformed(ActionEvent e)
          设置前景色。
 
从类 javax.swing.text.StyledEditorKit.StyledTextAction 继承的方法
getEditor, getStyledDocument, getStyledEditorKit, setCharacterAttributes, setParagraphAttributes
 
从类 javax.swing.text.TextAction 继承的方法
augmentList, getFocusedComponent, getTextComponent
 
从类 javax.swing.AbstractAction 继承的方法
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
从类 java.lang.Object 继承的方法
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

StyledEditorKit.ForegroundAction

public StyledEditorKit.ForegroundAction(String nm,
                                        Color fg)
创建新的 ForegroundAction。

参数:
nm - 操作名
fg - 前景色
方法详细信息

actionPerformed

public void actionPerformed(ActionEvent e)
设置前景色。

参数:
e - 操作事件

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only