Package org.opensourcephysics.tools
Class FunctionEditor.DefaultEdit
java.lang.Object
javax.swing.undo.AbstractUndoableEdit
org.opensourcephysics.tools.FunctionEditor.DefaultEdit
- All Implemented Interfaces:
Serializable
,UndoableEdit
- Enclosing class:
- FunctionEditor
A class to undo/redo edits.
- See Also:
-
Field Summary
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultEdit
(int type, Object newVal, int newRow, int newCol, Object prevVal, int prevRow, int prevCol, String name) A class to undo/redo edits. -
Method Summary
Methods inherited from class javax.swing.undo.AbstractUndoableEdit
addEdit, canRedo, canUndo, die, getRedoPresentationName, getUndoPresentationName, isSignificant, replaceEdit, toString
-
Constructor Details
-
DefaultEdit
public DefaultEdit(int type, Object newVal, int newRow, int newCol, Object prevVal, int prevRow, int prevCol, String name) A class to undo/redo edits.- Parameters:
type
- may be ADD_EDIT, REMOVE_EDIT, NAME_EDIT, or EXPRESSION_EDITnewVal
- the new object, name or expressionnewRow
- the row selectednewCol
- the col selectedprevVal
- the previous object, name or expressionprevRow
- the previous row selectedprevCol
- the previous col selectedname
- the name of the edited object
-
-
Method Details
-
undo
- Specified by:
undo
in interfaceUndoableEdit
- Overrides:
undo
in classAbstractUndoableEdit
- Throws:
CannotUndoException
-
redo
- Specified by:
redo
in interfaceUndoableEdit
- Overrides:
redo
in classAbstractUndoableEdit
- Throws:
CannotUndoException
-
getPresentationName
- Specified by:
getPresentationName
in interfaceUndoableEdit
- Overrides:
getPresentationName
in classAbstractUndoableEdit
-
isNew
public boolean isNew()Return true if this is a new undoable edit.- Returns:
- true if new
-
getEditType
public int getEditType()Gets the edit type- Returns:
- ADD_EDIT, REMOVE_EDIT, NAME_EDIT or EXPRESSION_EDIT
-