|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.undo.AbstractUndoableEdit
com.threerings.tudey.tools.EntryEdit
public class EntryEdit
Represents an edit to the scene's entries (and paint).
| Field Summary | |
|---|---|
protected Map<Object,TudeySceneModel.Entry> |
_added
The entries added in this edit. |
protected int |
_id
The edit id, which determines which edits we can merge. |
protected int |
_layer
The layer to which this edit applies. |
protected Map<Coord,TudeySceneModel.Paint> |
_paint
The paint set or cleared in this edit. |
protected Map<Object,TudeySceneModel.Entry> |
_removed
The entries removed in this edit. |
protected TudeySceneModel |
_scene
The affected scene. |
protected Map<Object,TudeySceneModel.Entry> |
_updated
The entries updated in this edit. |
| Fields inherited from class javax.swing.undo.AbstractUndoableEdit |
|---|
RedoName, UndoName |
| Constructor Summary | |
|---|---|
EntryEdit(TudeySceneModel scene,
int id,
int layer,
Rectangle region,
TudeySceneModel.Paint paint)
Creates and applies a new paint edit. |
|
EntryEdit(TudeySceneModel scene,
int id,
int layer,
TudeySceneModel.Entry[] add,
TudeySceneModel.Entry[] update,
Object[] remove)
Creates and applies a new entry edit. |
|
| Method Summary | |
|---|---|
boolean |
addEdit(UndoableEdit edit)
|
void |
redo()
|
protected void |
swap(Map<Object,TudeySceneModel.Entry> removed,
Map<Object,TudeySceneModel.Entry> added)
Performs the actual undo or redo operation. |
void |
undo()
|
| Methods inherited from class javax.swing.undo.AbstractUndoableEdit |
|---|
canRedo, canUndo, die, getPresentationName, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected TudeySceneModel _scene
protected int _id
protected int _layer
protected Map<Object,TudeySceneModel.Entry> _added
protected Map<Object,TudeySceneModel.Entry> _updated
protected Map<Object,TudeySceneModel.Entry> _removed
protected Map<Coord,TudeySceneModel.Paint> _paint
| Constructor Detail |
|---|
public EntryEdit(TudeySceneModel scene,
int id,
int layer,
TudeySceneModel.Entry[] add,
TudeySceneModel.Entry[] update,
Object[] remove)
public EntryEdit(TudeySceneModel scene,
int id,
int layer,
Rectangle region,
TudeySceneModel.Paint paint)
| Method Detail |
|---|
public boolean addEdit(UndoableEdit edit)
addEdit in interface UndoableEditaddEdit in class AbstractUndoableEdit
public void undo()
throws CannotUndoException
undo in interface UndoableEditundo in class AbstractUndoableEditCannotUndoException
public void redo()
throws CannotRedoException
redo in interface UndoableEditredo in class AbstractUndoableEditCannotRedoException
protected void swap(Map<Object,TudeySceneModel.Entry> removed,
Map<Object,TudeySceneModel.Entry> added)
removed - the map containing the entries to add.added - the map containing the entries to remove.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||