org.opensourcephysics.tools
Class LauncherUndo

java.lang.Object
  extended by javax.swing.undo.AbstractUndoableEdit
      extended by javax.swing.undo.CompoundEdit
          extended by javax.swing.undo.UndoManager
              extended by org.opensourcephysics.tools.LauncherUndo
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, javax.swing.event.UndoableEditListener, javax.swing.undo.UndoableEdit

public class LauncherUndo
extends javax.swing.undo.UndoManager

This provides undo support for Launcher.

Author:
Douglas Brown
See Also:
Serialized Form

Nested Class Summary
protected  class LauncherUndo.LoadEdit
          A class to undo/redo a node link, open file or new tabset action.
protected  class LauncherUndo.NavEdit
          A class to undo/redo a hyperlink or user navigation action.
 
Field Summary
 
Fields inherited from class javax.swing.undo.CompoundEdit
edits
 
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
 
Constructor Summary
LauncherUndo(Launcher launcher)
          Constructor.
 
Method Summary
 boolean canReload()
          Returns true if pending edit is a link edit.
 java.lang.String[] getLauncherState()
          Gets the current launcher state.
 void setLauncher(Launcher launcher)
          Sets the launcher.
 
Methods inherited from class javax.swing.undo.UndoManager
addEdit, canRedo, canUndo, canUndoOrRedo, discardAllEdits, editToBeRedone, editToBeUndone, end, getLimit, getRedoPresentationName, getUndoOrRedoPresentationName, getUndoPresentationName, redo, redoTo, setLimit, toString, trimEdits, trimForLimit, undo, undoableEditHappened, undoOrRedo, undoTo
 
Methods inherited from class javax.swing.undo.CompoundEdit
die, getPresentationName, isInProgress, isSignificant, lastEdit
 
Methods inherited from class javax.swing.undo.AbstractUndoableEdit
replaceEdit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LauncherUndo

public LauncherUndo(Launcher launcher)
Constructor.

Parameters:
launcher - the Launcher to undo/redo
Method Detail

setLauncher

public void setLauncher(Launcher launcher)
Sets the launcher.

Parameters:
launcher - the Launcher to undo/redo

canReload

public boolean canReload()
Returns true if pending edit is a link edit.

Returns:
true if pending edit is a link edit

getLauncherState

public java.lang.String[] getLauncherState()
Gets the current launcher state. Returns null if launcher is empty or if the current filename does not refer to an existing file.

Returns:
String array [0] = file name [1] = selected node path