org.jhotdraw.beans
Class PropertyChangeEdit
- java.lang.Object
-
- javax.swing.undo.AbstractUndoableEdit
-
- org.jhotdraw.beans.PropertyChangeEdit
-
- All Implemented Interfaces:
- java.io.Serializable, javax.swing.undo.UndoableEdit
public class PropertyChangeEdit extends javax.swing.undo.AbstractUndoableEditAnUndoableEditevent which can undo a change of a JavaBeans property.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description PropertyChangeEdit(java.lang.Object source, java.lang.String propertyName, boolean oldValue, boolean newValue)Creates a new PropertyChangeEdit.PropertyChangeEdit(java.lang.Object source, java.lang.String propertyName, char oldValue, char newValue)Creates a new PropertyChangeEdit.PropertyChangeEdit(java.lang.Object source, java.lang.String propertyName, java.lang.Class<T> type, T oldValue, T newValue)Creates a new PropertyChangeEdit.PropertyChangeEdit(java.lang.Object source, java.lang.String propertyName, double oldValue, double newValue)Creates a new PropertyChangeEdit.PropertyChangeEdit(java.lang.Object source, java.lang.String propertyName, float oldValue, float newValue)Creates a new PropertyChangeEdit.PropertyChangeEdit(java.lang.Object source, java.lang.String propertyName, int oldValue, int newValue)Creates a new PropertyChangeEdit.PropertyChangeEdit(java.lang.Object source, java.lang.String propertyName, long oldValue, long newValue)Creates a new PropertyChangeEdit.PropertyChangeEdit(java.lang.Object source, java.lang.String propertyName, java.lang.String oldValue, java.lang.String newValue)Creates a new PropertyChangeEdit.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleanaddEdit(javax.swing.undo.UndoableEdit anEdit)Adds the specified edit to this one, if it is aPropertyChangeEditfrom the same owner and the same property.java.lang.StringgetPresentationName()Returns the presentation name of the undoable edit.voidredo()Redoes the change.voidsetPresentationName(java.lang.String presentationName)Sets the presentation name of the undoable edit.java.lang.StringtoString()Returns a string representation of this object useful for debugging.voidundo()Undoes the change.
-
-
-
Constructor Detail
-
PropertyChangeEdit
public PropertyChangeEdit(java.lang.Object source, java.lang.String propertyName, java.lang.Class<T> type, T oldValue, T newValue)Creates a new PropertyChangeEdit.
-
PropertyChangeEdit
public PropertyChangeEdit(java.lang.Object source, java.lang.String propertyName, boolean oldValue, boolean newValue)Creates a new PropertyChangeEdit.
-
PropertyChangeEdit
public PropertyChangeEdit(java.lang.Object source, java.lang.String propertyName, int oldValue, int newValue)Creates a new PropertyChangeEdit.
-
PropertyChangeEdit
public PropertyChangeEdit(java.lang.Object source, java.lang.String propertyName, long oldValue, long newValue)Creates a new PropertyChangeEdit.
-
PropertyChangeEdit
public PropertyChangeEdit(java.lang.Object source, java.lang.String propertyName, float oldValue, float newValue)Creates a new PropertyChangeEdit.
-
PropertyChangeEdit
public PropertyChangeEdit(java.lang.Object source, java.lang.String propertyName, double oldValue, double newValue)Creates a new PropertyChangeEdit.
-
PropertyChangeEdit
public PropertyChangeEdit(java.lang.Object source, java.lang.String propertyName, char oldValue, char newValue)Creates a new PropertyChangeEdit.
-
PropertyChangeEdit
public PropertyChangeEdit(java.lang.Object source, java.lang.String propertyName, java.lang.String oldValue, java.lang.String newValue)Creates a new PropertyChangeEdit.
-
-
Method Detail
-
undo
public void undo() throws javax.swing.undo.CannotRedoExceptionUndoes the change.- Specified by:
undoin interfacejavax.swing.undo.UndoableEdit- Overrides:
undoin classjavax.swing.undo.AbstractUndoableEdit- Throws:
javax.swing.undo.CannotRedoException
-
redo
public void redo() throws javax.swing.undo.CannotRedoExceptionRedoes the change.- Specified by:
redoin interfacejavax.swing.undo.UndoableEdit- Overrides:
redoin classjavax.swing.undo.AbstractUndoableEdit- Throws:
javax.swing.undo.CannotRedoException
-
getPresentationName
public java.lang.String getPresentationName()
Returns the presentation name of the undoable edit. This is the same as the property name, unless you have set a different presentation name.- Specified by:
getPresentationNamein interfacejavax.swing.undo.UndoableEdit- Overrides:
getPresentationNamein classjavax.swing.undo.AbstractUndoableEdit
-
setPresentationName
public void setPresentationName(java.lang.String presentationName)
Sets the presentation name of the undoable edit.
-
addEdit
public boolean addEdit(javax.swing.undo.UndoableEdit anEdit)
Adds the specified edit to this one, if it is aPropertyChangeEditfrom the same owner and the same property.- Specified by:
addEditin interfacejavax.swing.undo.UndoableEdit- Overrides:
addEditin classjavax.swing.undo.AbstractUndoableEdit- Parameters:
anEdit- Edit to be added.- Returns:
- True if added.
-
toString
public java.lang.String toString()
Returns a string representation of this object useful for debugging.- Overrides:
toStringin classjavax.swing.undo.AbstractUndoableEdit
-
-
DataMelt 3.0 © DataMelt by jWork.ORG