JHotDraw 6.0b1

org.jhotdraw.util
Class UndoRedoActivity

java.lang.Object
  extended by org.jhotdraw.util.UndoRedoActivity
All Implemented Interfaces:
Undoable

public class UndoRedoActivity
extends java.lang.Object
implements Undoable

An UndoRedoActivity can be used to turn a UndoActivity into a RedoActivity. In this case, the redo() method of an encapsulated activity is called when the undo() is executed, and undo() when redo() is executed.


Constructor Summary
protected UndoRedoActivity(Undoable newReversedActivity)
           
 
Method Summary
static Undoable createUndoRedoActivity(Undoable toBeReversed)
           
 FigureEnumeration getAffectedFigures()
           
 int getAffectedFiguresCount()
           
 DrawingView getDrawingView()
           
 Undoable getReversedActivity()
           
 boolean isRedoable()
          Dispatch to isUndoable of the activity to be reversed.
 boolean isUndoable()
          Dispatch to isRedoable of the activity to be reversed.
 boolean redo()
           
 void release()
          Releases all resources related to an undoable activity
 void setAffectedFigures(FigureEnumeration newAffectedFigures)
           
 void setRedoable(boolean newIsRedoable)
          Dispatch to setUndoable of the activity to be reversed.
protected  void setReversedActivity(Undoable newReversedActivity)
           
 void setUndoable(boolean newIsUndoable)
          Dispatch to setRedoable of the activity to be reversed.
 boolean undo()
          Undo the activity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UndoRedoActivity

protected UndoRedoActivity(Undoable newReversedActivity)
Method Detail

undo

public boolean undo()
Undo the activity

Specified by:
undo in interface Undoable
Returns:
true if the activity could be undone, false otherwise

redo

public boolean redo()
Specified by:
redo in interface Undoable

isUndoable

public boolean isUndoable()
Dispatch to isRedoable of the activity to be reversed.

Specified by:
isUndoable in interface Undoable

setUndoable

public void setUndoable(boolean newIsUndoable)
Dispatch to setRedoable of the activity to be reversed.

Specified by:
setUndoable in interface Undoable

isRedoable

public boolean isRedoable()
Dispatch to isUndoable of the activity to be reversed.

Specified by:
isRedoable in interface Undoable

setRedoable

public void setRedoable(boolean newIsRedoable)
Dispatch to setUndoable of the activity to be reversed.

Specified by:
setRedoable in interface Undoable

setAffectedFigures

public void setAffectedFigures(FigureEnumeration newAffectedFigures)
Specified by:
setAffectedFigures in interface Undoable

getAffectedFigures

public FigureEnumeration getAffectedFigures()
Specified by:
getAffectedFigures in interface Undoable

getAffectedFiguresCount

public int getAffectedFiguresCount()
Specified by:
getAffectedFiguresCount in interface Undoable

getDrawingView

public DrawingView getDrawingView()
Specified by:
getDrawingView in interface Undoable

release

public void release()
Description copied from interface: Undoable
Releases all resources related to an undoable activity

Specified by:
release in interface Undoable

setReversedActivity

protected void setReversedActivity(Undoable newReversedActivity)

getReversedActivity

public Undoable getReversedActivity()

createUndoRedoActivity

public static Undoable createUndoRedoActivity(Undoable toBeReversed)

JHotDraw 6.0b1