JHotDraw 7.4.1

org.jhotdraw.draw.event
Class TransformEdit

java.lang.Object
  extended by javax.swing.undo.AbstractUndoableEdit
      extended by org.jhotdraw.draw.event.TransformEdit
All Implemented Interfaces:
java.io.Serializable, javax.swing.undo.UndoableEdit

public class TransformEdit
extends javax.swing.undo.AbstractUndoableEdit

An UndoableEdit event which can undo a lossless transform of Figures by applying the inverse of the transform to the figures.

This object is useful for undoing lossless transformations, such as the translation of figures.

If a lossy transforms is performed, such as rotation, scaling or shearing, then undos should be performed with TransformRestoreEdit instead.

Version:
$Id: TransformEdit.java 604 2010-01-09 12:00:29Z rawcoder $
Author:
Werner Randelshofer
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
 
Constructor Summary
TransformEdit(java.util.Collection<Figure> figures, java.awt.geom.AffineTransform tx)
           
TransformEdit(Figure figure, java.awt.geom.AffineTransform tx)
          Creates a new instance.
 
Method Summary
 boolean addEdit(javax.swing.undo.UndoableEdit anEdit)
           
 java.lang.String getPresentationName()
           
 void redo()
           
 boolean replaceEdit(javax.swing.undo.UndoableEdit anEdit)
           
 java.lang.String toString()
           
 void undo()
           
 
Methods inherited from class javax.swing.undo.AbstractUndoableEdit
canRedo, canUndo, die, getRedoPresentationName, getUndoPresentationName, isSignificant
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TransformEdit

public TransformEdit(Figure figure,
                     java.awt.geom.AffineTransform tx)
Creates a new instance.


TransformEdit

public TransformEdit(java.util.Collection<Figure> figures,
                     java.awt.geom.AffineTransform tx)
Method Detail

getPresentationName

public java.lang.String getPresentationName()
Specified by:
getPresentationName in interface javax.swing.undo.UndoableEdit
Overrides:
getPresentationName in class javax.swing.undo.AbstractUndoableEdit

addEdit

public boolean addEdit(javax.swing.undo.UndoableEdit anEdit)
Specified by:
addEdit in interface javax.swing.undo.UndoableEdit
Overrides:
addEdit in class javax.swing.undo.AbstractUndoableEdit

replaceEdit

public boolean replaceEdit(javax.swing.undo.UndoableEdit anEdit)
Specified by:
replaceEdit in interface javax.swing.undo.UndoableEdit
Overrides:
replaceEdit in class javax.swing.undo.AbstractUndoableEdit

redo

public void redo()
          throws javax.swing.undo.CannotRedoException
Specified by:
redo in interface javax.swing.undo.UndoableEdit
Overrides:
redo in class javax.swing.undo.AbstractUndoableEdit
Throws:
javax.swing.undo.CannotRedoException

undo

public void undo()
          throws javax.swing.undo.CannotUndoException
Specified by:
undo in interface javax.swing.undo.UndoableEdit
Overrides:
undo in class javax.swing.undo.AbstractUndoableEdit
Throws:
javax.swing.undo.CannotUndoException

toString

public java.lang.String toString()
Overrides:
toString in class javax.swing.undo.AbstractUndoableEdit

Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.