Class Undo
java.lang.Object
org.opensourcephysics.cabrillo.tracker.Undo
A class to handle undo/redo operations for Tracker.
- Author:
- Douglas Brown
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
A class to undo/redo a pair of UndoableEdits.protected class
A class to undo/redo coords changes.protected class
A class to undo/redo filter clearing.protected class
A class to undo/redo filter deletion.protected class
A class to undo/redo filter edit.protected class
A class to undo/redo image video edits.protected class
A class to undo/redo step changes.protected class
A class to undo/redo stepset changes.protected class
A class to undo/redo changes to objects associated with a TrackerPanel.protected class
A class to undo/redo clearing tracks.protected class
A class to undo/redo track deletion.protected class
A class to undo/redo footprint, color and name changes.protected class
A class to undo/redo track changes.protected class
A class to undo/redo video replacements. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.opensourcephysics.cabrillo.tracker.Undo.MyUndoManager
protected UndoableEditSupport
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
canRedo
(TrackerPanel panel) Reports whether an undoable edit is available for the specified panel.static boolean
canUndo
(TrackerPanel panel) Reports whether an undoable edit is available for the specified panel.static String
getRedoDescription
(TrackerPanel panel) Gets the redoable edit description for the specified panel.static String
getUndoDescription
(TrackerPanel panel) Gets the undoable edit description for the specified panel.static XMLControl
getXMLControl
(VideoClip clip) Returns XMLControl for a VideoClip after adding absolutePath of videoprotected TrackerPanel
panel()
protected static void
postCoordsEdit
(TrackerPanel panel, XMLControl control) Posts an undoable edit for a changed coordinate system.protected static void
postFilterClear
(TrackerPanel panel, List<String> xml) Posts an undoable edit for a TrackerPanel cleared of video filters.protected static void
postFilterDelete
(TrackerPanel panel, Filter filter) Posts an undoable edit for a video filter deletion.protected static void
postFilterEdit
(TrackerPanel panel, Filter filter, XMLControl control) Posts an undoable edit for a change to a video filter.protected static void
postImageVideoEdit
(TrackerPanel panel, String[] paths, int index, int step, boolean added) Posts an undoable edit for an edited image video.protected static void
postMultiTrackEdit
(ArrayList<Object[]> tracksAndXMLControls) Posts an undoable edit for multiple changed tracks.protected static void
postStepEdit
(Step step, XMLControl control) Posts an undoable edit for a changed step.protected static void
postStepSetEdit
(StepSet steps, XMLControl control) Posts an undoable edit for a changed StepSet.protected static void
postTrackAndCoordsEdit
(TTrack track, XMLControl trackControl, XMLControl coordsControl) Posts a compound undoable edit for tracks that control the coords.protected static void
postTrackClear
(TrackerPanel panel, List<String> xml) Posts an undoable edit for a TrackerPanel cleared of tracks.protected static void
postTrackDelete
(TTrack track) Posts an undoable edit for a deleted track.protected static void
postTrackDisplayEdit
(TTrack track, XMLControl control) Posts an undoable edit for a footprint, name or color change.protected static void
postTrackEdit
(TTrack track, XMLControl control) Posts an undoable edit for a changed track.protected static void
postVideoReplace
(TrackerPanel panel, XMLControl control) Posts an undoable edit for a replaced video clip.static void
redo
(TrackerPanel panel) Redoes the most recently undone edit for the specified panel.static void
undo
(TrackerPanel panel) Undoes the most recently posted edit for the specified panel.
-
Field Details
-
undomap
-
undoSupport
-
undoManager
protected org.opensourcephysics.cabrillo.tracker.Undo.MyUndoManager undoManager
-
-
Method Details
-
canUndo
Reports whether an undoable edit is available for the specified panel.- Parameters:
panel
- the TrackerPanel- Returns:
- true if an undoable edit is available
-
getUndoDescription
Gets the undoable edit description for the specified panel.- Parameters:
panel
- the TrackerPanel- Returns:
- the undoable edit description
-
undo
Undoes the most recently posted edit for the specified panel.- Parameters:
panel
- the TrackerPanel
-
canRedo
Reports whether an undoable edit is available for the specified panel.- Parameters:
panel
- the TrackerPanel- Returns:
- true if an undoable edit is available
-
getRedoDescription
Gets the redoable edit description for the specified panel.- Parameters:
panel
- the TrackerPanel- Returns:
- the redoable edit description
-
redo
Redoes the most recently undone edit for the specified panel.- Parameters:
panel
- the TrackerPanel
-
postTrackDelete
Posts an undoable edit for a deleted track.- Parameters:
track
- the track
-
postTrackClear
Posts an undoable edit for a TrackerPanel cleared of tracks.- Parameters:
panel
- the TrackerPanel that has been clearedxml
- a list of XML strings describing the cleared tracks
-
postTrackEdit
Posts an undoable edit for a changed track.- Parameters:
track
- the changed trackcontrol
- an XMLControl with the previous state of the track
-
postMultiTrackEdit
Posts an undoable edit for multiple changed tracks.- Parameters:
tracksAndXMLControls
- list of array elements, each element = {track, track's previous state}
-
postStepEdit
Posts an undoable edit for a changed step.- Parameters:
step
- the changed stepcontrol
- an XMLControl with the previous state of the track
-
postStepSetEdit
Posts an undoable edit for a changed StepSet.- Parameters:
steps
- the changed StepSetcontrol
- an XMLControl with the previous state of the StepSet
-
postCoordsEdit
Posts an undoable edit for a changed coordinate system.- Parameters:
panel
- the TrackerPanel with the changed coordscontrol
- an XMLControl with the previous state of the coords
-
postTrackAndCoordsEdit
protected static void postTrackAndCoordsEdit(TTrack track, XMLControl trackControl, XMLControl coordsControl) Posts a compound undoable edit for tracks that control the coords.- Parameters:
track
- the changed tracktrackControl
- an XMLControl with the previous state of the trackcoordsControl
- an XMLControl with the previous state of the coords
-
postImageVideoEdit
protected static void postImageVideoEdit(TrackerPanel panel, String[] paths, int index, int step, boolean added) Posts an undoable edit for an edited image video.- Parameters:
panel
- the TrackerPanel with the new video clippaths
- paths to the video filesindex
- step number at which edit occuredstep
- step number after edit occuredadded
- true if a frame was added
-
postVideoReplace
Posts an undoable edit for a replaced video clip.- Parameters:
panel
- the TrackerPanel with the new video clipcontrol
- an XMLControl describing the previous video clip
-
postFilterDelete
Posts an undoable edit for a video filter deletion.- Parameters:
panel
- the TrackerPanel with the new video clipfilter
- the deleted filter
-
postFilterEdit
Posts an undoable edit for a change to a video filter.- Parameters:
panel
- the TrackerPanel with the new video clipfilter
- the filtercontrol
- an XMLControl with the previous state of the filter
-
postFilterClear
Posts an undoable edit for a TrackerPanel cleared of video filters.- Parameters:
panel
- the TrackerPanel that has been clearedxml
- a list of XML strings describing the cleared tracks
-
postTrackDisplayEdit
Posts an undoable edit for a footprint, name or color change.- Parameters:
track
- the track with the changed propertycontrol
- an XMLControl with the previous state of the footprint
-
getXMLControl
Returns XMLControl for a VideoClip after adding absolutePath of video -
panel
-