Package dsto.dfc.swing.undo

Extends Swing undo/redo framework to add generalized support for monitoring user edits and displaying them in a UI.

See:
          Description

Interface Summary
EditExceptionPolicy Interface for components wishing to determine how to react to an exception caused by undoing or redoing an UndoableEdit.
MonitoredEdit An extended undoable edit.
Restorable Some UndoableEdit must execute within a context.
UndoableEditSource An interface for components wishing to generate UndoableEdits.
 

Class Summary
AbstractMonitoredEdit Abstract implementation of the MonitoredEdit interface.
AbstractUndoableCommand Abstract super class for undo and redo commands.
CmdRedo Command to invoke a single redo () on the MonitoredUndoManager.
CmdRedoTo Command class to invoke redoTo () on a MonitoredUndoManager.
CmdUndo Command to invoke a single undo () on the MonitoredUndoManager.
CmdUndoTo Command to invoke undoTo () on a MonitoredUndoManager.
EditExceptionHandler Policy for handling exceptions and interrogating user for options.
EditListModel Implementation of a JList ListModel that stores UndoableEdits, for use by the MonitoredUndoManager.
EditListView List view of an EditListModel, with a custom renderer which highlights not only the UndoableEdit in the list, but also the undo cursor of the MonitoredUndoManager using the edit list.
EditTransferable Facilitates the dragging and dropping of a List of UndoableEdits.
MonitoredEditGroup Groups a number of edits.
MonitoredUndoManager Provides the same functions as the Swing UndoManager, plus provides functionality to skip non-undoable edits in the middle of the history list.
MonitorPanel Hosts list of edits and allows display/selection using a ParametersPanel.
ParametersPanel Shows details of a monitored edit, including its parameters in a table.
PropertyChangeToEditAdapter Class which listens for PropertyChangeEvents and fires PropertyEdits when it hears them.
PropertyEdit Used to undo property changes.
PropertyEditBean Bean PropertyEdit class for Bean serialisation support.
 

Package dsto.dfc.swing.undo Description

Extends Swing undo/redo framework to add generalized support for monitoring user edits and displaying them in a UI. Also provides generic undo and redo commands for use with the dsto.dfc.commands framework.

The MonitoredEdit interface provides hooks for InVision-specific functionality, including Serialisation, cloning support through dsto.dfc.util.DfcCloneable, restoration of context through the Restorable interface, and support for icons through dsto.dfc.ui.Iconic. The AbstractMonitoredEdit provides a default implementation of much of the functionality required by the MonitoredEdit interface.

The MonitoredEditGroup is similar to a CompositeEdit however it manages its component edits as individuals, rather than regarding them as a combined edit. This allows a tree structure of edits to be created which facilitates the introduction of control structures such as conditionals and loops.

The MonitoredUndoManager is an extension of the Swing undo manager which provides a more reliable implementation including exception handling and knowledge of MonitoredEdits and MonitoredEditGroups. Exception handling is delegated to the EditExceptionHandler which uses an EditExceptionPolicy to determine how to handle exceptions. The MonitoredUndoManager listens to UndoableEditSources.

The PropertyEdit is a MonitoredEdit which represents a PropertyChangeEvent. A PropertyEditBean is a JavaBean subclass of a PropertyEdit. It has bean accessor and modifier methods for the properties of the edit. Its purpose is to support bean serialisation.

The EditListView is a subclass of JList which contains only UndoableEdits from a MonitoredUndoManager and listens for cursor changes in that manager. It also incorporates drag'n'drop support for MonitoredEdits which is provided through the EditTransferable class. Its ListModel implementation is the EditListModel. The EditListModel is also used as the edit list in the MonitoredUndoManager.

The MonitorPanel shows an EditListView and a ParametersPanel. The ParametersPanel displays a table of the parameters of the currently selected (selected in the EditListView) edit if it is an instance of a MonitoredEdit. The control panel in the MonitorPanel allows stepping forwards and backwards through the EditListView by use of the CmdUndo and CmdRedo commands. A context menu on the EditListView allows a user to select an edit and then undo to (through use of the CmdUndoTo command) or redo to (through the use of the CmdRedoTo command) that edit from wherever the cursor currently is. These commands all extend AbstractUndoableCommand which contains basic cursor listening and exception handling code.



Copyright © 2008 Commonwealth of Australia