JavaTM 2 Platform
Standard Ed. 6

javax.swing.text
类 StyledEditorKit.AlignmentAction

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

public static class StyledEditorKit.AlignmentAction
extends StyledEditorKit.StyledTextAction

设置段落对齐的操作。此操作为当前选中的目标 JEditorPane 的范围设置 StyleConstants.Alignment 属性。该操作是通过在与此目标 JEditorPane 相关的样式文档上调用 StyledDocument.setParagraphAttributes 来完成的。

如果目标文本组件被指定为 ActionEvent 的源,则存在一个命令字符串,该命令字符串将被解释为一个整数,该整数应为 StyleConstants.Alignment 属性中的合法值之一。

警告:此类的已序列化对象与以后的 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.AlignmentAction(String nm, int a)
          创建新的 AlignmentAction。
 
方法摘要
 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.AlignmentAction

public StyledEditorKit.AlignmentAction(String nm,
                                       int a)
创建新的 AlignmentAction。

参数:
nm - 操作名
a - 对齐方式,该值 >= 0
方法详细信息

actionPerformed

public void actionPerformed(ActionEvent e)
设置对齐方式。

参数:
e - 操作事件

JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

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