FreeHEP API
Version current

org.freehep.swing.undo
Class AnimatedEdit

java.lang.Object
  extended byjavax.swing.undo.AbstractUndoableEdit
      extended byorg.freehep.swing.undo.AbstractDoableEdit
          extended byorg.freehep.swing.undo.AnimatedEdit
All Implemented Interfaces:
DoableEdit, LinkableEdit, Serializable, UndoableEdit

public abstract class AnimatedEdit
extends AbstractDoableEdit
implements LinkableEdit

Extension of DoableEdit which allows the Edit to animate a shape before doing the redoEdit or undoEdit. Subclasses of this class should override redoEdit() and undoEdit().

Version:
$Id: AnimatedEdit.java,v 1.5 2004/04/30 23:37:24 duns Exp $
Author:
Mark Donszelmann
See Also:
Serialized Form
Source Code:
AnimatedEdit.java

Field Summary
 
Fields inherited from class org.freehep.swing.undo.AbstractDoableEdit
firstTimeDone
 
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
 
Constructor Summary
AnimatedEdit(int frames)
          Creates an animated edit with given number of frames.
 
Method Summary
 Shape createTransformedShape(Component component, Shape shape)
          Returns a transformed shape, from the given shape and component.
protected abstract  void endAnimation()
          Ends the animation.
 int getFrames()
          Returns number of frames.
 LinkableEdit getNextEdit()
          Returns the next edit.
 LinkableEdit getParent()
          Returns the parent.
 LinkableEdit getPreviousEdit()
          Returns the previous edit.
 void redo()
          Called when the edit is (re)done.
protected abstract  void redoEdit()
          (Re)does the edit.
 void setNextEdit(LinkableEdit edit)
          Connects to the next edit.
 void setParent(LinkableEdit parent)
          Sets the parent, can only be called once.
 void setPreviousEdit(LinkableEdit edit)
          Connext to the previous edit.
protected abstract  void showAnimation(int frameNo)
          Show frameNo of animation.
protected abstract  void startAnimation(boolean redo)
          Starts the animation for redo or undo.
 String toString()
           
 void undo()
          Called when the edit is undone.
protected abstract  void undoEdit()
          Undoes the edit.
 
Methods inherited from class org.freehep.swing.undo.AbstractDoableEdit
canRedo, canUndo
 
Methods inherited from class javax.swing.undo.AbstractUndoableEdit
addEdit, die, getPresentationName, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.swing.undo.UndoableEdit
addEdit, canRedo, canUndo, die, getPresentationName, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit
 

Constructor Detail

AnimatedEdit

public AnimatedEdit(int frames)
Creates an animated edit with given number of frames.

Method Detail

getParent

public LinkableEdit getParent()
Description copied from interface: LinkableEdit
Returns the parent.

Specified by:
getParent in interface LinkableEdit

setParent

public void setParent(LinkableEdit parent)
Description copied from interface: LinkableEdit
Sets the parent, can only be called once.

Specified by:
setParent in interface LinkableEdit

getNextEdit

public LinkableEdit getNextEdit()
Description copied from interface: LinkableEdit
Returns the next edit.

Specified by:
getNextEdit in interface LinkableEdit

getPreviousEdit

public LinkableEdit getPreviousEdit()
Description copied from interface: LinkableEdit
Returns the previous edit.

Specified by:
getPreviousEdit in interface LinkableEdit

setNextEdit

public void setNextEdit(LinkableEdit edit)
Description copied from interface: LinkableEdit
Connects to the next edit.

Specified by:
setNextEdit in interface LinkableEdit

setPreviousEdit

public void setPreviousEdit(LinkableEdit edit)
Description copied from interface: LinkableEdit
Connext to the previous edit.

Specified by:
setPreviousEdit in interface LinkableEdit

redo

public void redo()
          throws CannotRedoException
Called when the edit is (re)done. Do not override, use redoEdit instead.

Specified by:
redo in interface UndoableEdit
Overrides:
redo in class AbstractDoableEdit
Throws:
CannotRedoException

undo

public void undo()
          throws CannotUndoException
Called when the edit is undone. Do not override, use undoEdit instead.

Specified by:
undo in interface UndoableEdit
Throws:
CannotUndoException

getFrames

public int getFrames()
Returns number of frames.


toString

public String toString()

redoEdit

protected abstract void redoEdit()
(Re)does the edit.


undoEdit

protected abstract void undoEdit()
Undoes the edit.


startAnimation

protected abstract void startAnimation(boolean redo)
Starts the animation for redo or undo.


showAnimation

protected abstract void showAnimation(int frameNo)
Show frameNo of animation.


endAnimation

protected abstract void endAnimation()
Ends the animation.


createTransformedShape

public Shape createTransformedShape(Component component,
                                    Shape shape)
Returns a transformed shape, from the given shape and component.


FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.