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
一个用于设置段落对齐的操作。这将为目标JEditorPane当前选定范围设置
StyleConstants.Alignment
属性。这是通过在与目标JEditorPane关联的样式文档上调用StyledDocument.setParagraphAttributes
来完成的。
如果将目标文本组件指定为ActionEvent的源并且有一个命令字符串,则命令字符串将被解释为应该是StyleConstants.Alignment
属性的合法值之一的整数。
警告: 该类的序列化对象将不兼容未来的Swing版本。当前的序列化支持适用于短期存储或在运行相同Swing版本的应用程序之间的RMI。从1.4开始,已将所有JavaBeans的长期存储支持添加到java.beans
包中。请参阅XMLEncoder
。
-
Field Summary
Fields declared in class javax.swing.AbstractAction
changeSupport, enabled
Fields declared in interface 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
-
Constructor Summary
-
Method Summary
Methods declared in class javax.swing.text.StyledEditorKit.StyledTextAction
getEditor, getStyledDocument, getStyledEditorKit, setCharacterAttributes, setParagraphAttributes
Methods declared in class javax.swing.text.TextAction
augmentList, getFocusedComponent, getTextComponent
Methods declared in class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Constructor Details
-
AlignmentAction
创建一个新的AlignmentAction。- 参数:
-
nm
- 操作名称 -
a
- 对齐方式 >= 0
-
-
Method Details
-
actionPerformed
设置对齐方式。- 参数:
-
e
- 操作事件
-