artofillusion
Class UndoRecord

java.lang.Object
  extended by artofillusion.UndoRecord

public class UndoRecord
extends java.lang.Object

The UndoRecord class records a series of commands, allowing the user to undo a previous action.


Field Summary
static int ADD_OBJECT
           
static int ADD_TO_GROUP
           
static int COPY_COORDS
           
static int COPY_OBJECT
           
static int COPY_OBJECT_INFO
           
static int COPY_SKELETON
           
static int COPY_TRACK
           
static int COPY_VERTEX_POSITIONS
           
static int DELETE_OBJECT
           
static int REMOVE_FROM_GROUP
           
static int RENAME_OBJECT
           
static int SET_GROUP_CONTENTS
           
static int SET_MESH_SELECTION
           
static int SET_OBJECT
           
static int SET_SCENE_SELECTION
           
static int SET_TRACK
           
static int SET_TRACK_LIST
           
 
Constructor Summary
UndoRecord(EditingWindow win, boolean isRedo)
          Create a new UndoRecord.
UndoRecord(EditingWindow win, boolean isRedo, int theCommand, java.lang.Object[] commandData)
          Create a new UndoRecord whose script contains a single command.
 
Method Summary
 void addCommand(int theCommand, java.lang.Object[] commandData)
          Add a command to the end of this record's script.
 void addCommandAtBeginning(int theCommand, java.lang.Object[] commandData)
          Add a command to the beginning of this record's script.
 UndoRecord execute()
          Execute the record's script.
 java.util.List<java.lang.Integer> getCommands()
          Get the list of commands in this record's script.
 boolean isRedo()
          Get whether this record represents "redoing" a previously undone operation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPY_OBJECT

public static final int COPY_OBJECT
See Also:
Constant Field Values

COPY_COORDS

public static final int COPY_COORDS
See Also:
Constant Field Values

COPY_OBJECT_INFO

public static final int COPY_OBJECT_INFO
See Also:
Constant Field Values

SET_OBJECT

public static final int SET_OBJECT
See Also:
Constant Field Values

ADD_OBJECT

public static final int ADD_OBJECT
See Also:
Constant Field Values

DELETE_OBJECT

public static final int DELETE_OBJECT
See Also:
Constant Field Values

RENAME_OBJECT

public static final int RENAME_OBJECT
See Also:
Constant Field Values

ADD_TO_GROUP

public static final int ADD_TO_GROUP
See Also:
Constant Field Values

REMOVE_FROM_GROUP

public static final int REMOVE_FROM_GROUP
See Also:
Constant Field Values

SET_GROUP_CONTENTS

public static final int SET_GROUP_CONTENTS
See Also:
Constant Field Values

SET_TRACK

public static final int SET_TRACK
See Also:
Constant Field Values

SET_TRACK_LIST

public static final int SET_TRACK_LIST
See Also:
Constant Field Values

COPY_TRACK

public static final int COPY_TRACK
See Also:
Constant Field Values

COPY_VERTEX_POSITIONS

public static final int COPY_VERTEX_POSITIONS
See Also:
Constant Field Values

COPY_SKELETON

public static final int COPY_SKELETON
See Also:
Constant Field Values

SET_MESH_SELECTION

public static final int SET_MESH_SELECTION
See Also:
Constant Field Values

SET_SCENE_SELECTION

public static final int SET_SCENE_SELECTION
See Also:
Constant Field Values
Constructor Detail

UndoRecord

public UndoRecord(EditingWindow win,
                  boolean isRedo)
Create a new UndoRecord. Initially it represents an empty script. Commands can be added by calling addCommand() or addCommandAtBeginning().

Parameters:
win - the EditingWindow this record belongs to
isRedo - whether this record represents "redoing" a previously undone operation

UndoRecord

public UndoRecord(EditingWindow win,
                  boolean isRedo,
                  int theCommand,
                  java.lang.Object[] commandData)
Create a new UndoRecord whose script contains a single command. Additional commands can be added by calling addCommand() or addCommandAtBeginning().

Parameters:
win - the EditingWindow this record belongs to
isRedo - whether this record represents "redoing" a previously undone operation
theCommand - the command to add to the script
commandData - data to include as arguments to the command
Method Detail

isRedo

public boolean isRedo()
Get whether this record represents "redoing" a previously undone operation.


getCommands

public java.util.List<java.lang.Integer> getCommands()
Get the list of commands in this record's script.


addCommand

public void addCommand(int theCommand,
                       java.lang.Object[] commandData)
Add a command to the end of this record's script.

Parameters:
theCommand - the command to add to the script
commandData - data to include as arguments to the command

addCommandAtBeginning

public void addCommandAtBeginning(int theCommand,
                                  java.lang.Object[] commandData)
Add a command to the beginning of this record's script.

Parameters:
theCommand - the command to add to the script
commandData - data to include as arguments to the command

execute

public UndoRecord execute()
Execute the record's script.



Copyright © 1999-2011 by Peter Eastman.