public class StateEdit extends AbstractUndoableEdit
stateedit是总编辑,改变对象的状态。正在编辑的对象必须符合stateeditable接口。
这类作品的编辑要求一个对象来存储它的状态表编辑前后发生。在撤消或重做的目的是告诉恢复它的状态从这些Hashtables。
状态编辑的使用方法如下:在对象的“前”状态创建编辑过程stateedit newedit =新stateedit(MyObject);/修改对象somestatemodifyingmethod() MyObject;当你完成修改对象时,“结束”的编辑newedit。();
请注意,当一个stateedit两端,它消除了冗余状态从哈希表-状态哈希表不能保证包含所有的键/值放置到它时,状态存储!
StateEditable
Modifier and Type | Field and Description |
---|---|
protected StateEditable |
object
正在编辑的对象
|
protected Hashtable<Object,Object> |
postState
编辑后的状态信息
|
protected Hashtable<Object,Object> |
preState
编辑前的状态信息
|
protected static String |
RCSID |
protected String |
undoRedoName
撤消/重做演示名称
|
RedoName, UndoName
Constructor and Description |
---|
StateEdit(StateEditable anObject)
创建并返回一个新的stateedit。
|
StateEdit(StateEditable anObject, String name)
创建并返回一个新的stateedit名称介绍。
|
Modifier and Type | Method and Description |
---|---|
void |
end()
得到后编辑的stateeditable对象状态和结束编辑。
|
String |
getPresentationName()
获取此编辑的演示文稿名称
|
protected void |
init(StateEditable anObject, String name) |
void |
redo()
告诉已编辑的对象在编辑后应用状态
|
protected void |
removeRedundantState()
去除多余的键/值状态表。
|
void |
undo()
告诉编辑的对象在编辑之前应用状态
|
addEdit, canRedo, canUndo, die, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, toString
protected static final String RCSID
protected StateEditable object
protected String undoRedoName
public StateEdit(StateEditable anObject)
anObject
-注意状态变化的对象
StateEdit
public StateEdit(StateEditable anObject, String name)
anObject
-注意状态变化的对象
name
-展示的姓名用于编辑
StateEdit
protected void init(StateEditable anObject, String name)
public void end()
public void undo()
undo
接口
UndoableEdit
undo
方法重写,继承类
AbstractUndoableEdit
AbstractUndoableEdit.canUndo()
public void redo()
redo
接口
UndoableEdit
redo
方法重写,继承类
AbstractUndoableEdit
AbstractUndoableEdit.canRedo()
public String getPresentationName()
getPresentationName
接口
UndoableEdit
getPresentationName
方法重写,继承类
AbstractUndoableEdit
AbstractUndoableEdit.getUndoPresentationName()
,
AbstractUndoableEdit.getRedoPresentationName()
protected void removeRedundantState()
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.