uk.ac.essex.common.gui
Class ViewerImpl

java.lang.Object
  extended by uk.ac.essex.common.gui.ViewerImpl
All Implemented Interfaces:
Viewer
Direct Known Subclasses:
ImageViewer, OpViewer

public class ViewerImpl
extends java.lang.Object
implements Viewer


Date: 15-Jul-2002


Field Summary
protected  ApplicationFrame applicationFrame
           
protected  EditHandler editHandler
           
protected  FileHandler fileHandler
           
protected  HelpHandler helpHandler
           
protected  OptionsHandler optionsHandler
           
 
Constructor Summary
ViewerImpl()
           
 
Method Summary
 ApplicationFrame getApplicationFrame()
           
 EditHandler getEditHandler()
           
 FileHandler getFileHandler()
           
 HelpHandler getHelpHandler()
           
 OptionsHandler getOptionsHandler()
           
 void restoreSession()
          This loads the GUI into the users prefered state
 void restoreSessionFiles(java.lang.String fileListKey, java.lang.String currentFileKey, FileOpImpl fileOp)
          Restore a users session files.
protected  void saveOpenFiles(java.util.List<ApplicationFile> openFiles, java.lang.Object messageIfNotSaved)
           
protected  void saveSessionFiles(java.util.List<ApplicationFile> openFiles, java.util.prefs.Preferences preferences, java.lang.String fileListKey, java.lang.String currentFileKey)
          If any file has not been saved it will not be appended to the file list // TODO: Save position of file windows (x,y)
protected  boolean shouldRestoreSession(java.lang.String restoreSessionKey)
           
 void shutDown()
          Called to shut the Viewer down, this allows it to save open files etc.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileHandler

protected FileHandler fileHandler

editHandler

protected EditHandler editHandler

helpHandler

protected HelpHandler helpHandler

optionsHandler

protected OptionsHandler optionsHandler

applicationFrame

protected ApplicationFrame applicationFrame
Constructor Detail

ViewerImpl

public ViewerImpl()
Method Detail

restoreSessionFiles

public void restoreSessionFiles(java.lang.String fileListKey,
                                java.lang.String currentFileKey,
                                FileOpImpl fileOp)
Restore a users session files. This is all open files on the last invocation. // TODO: Make this restore windows to their last position (x,y)

Parameters:
fileListKey - - The preference key containing the list of open files
currentFileKey - - The file that should be set to be current
fileOp - - The file op to handle loading the files

getFileHandler

public FileHandler getFileHandler()
Specified by:
getFileHandler in interface Viewer
Returns:

getEditHandler

public EditHandler getEditHandler()
Specified by:
getEditHandler in interface Viewer
Returns:

getHelpHandler

public HelpHandler getHelpHandler()
Specified by:
getHelpHandler in interface Viewer
Returns:

getOptionsHandler

public OptionsHandler getOptionsHandler()
Specified by:
getOptionsHandler in interface Viewer
Returns:

getApplicationFrame

public ApplicationFrame getApplicationFrame()
Specified by:
getApplicationFrame in interface Viewer
Returns:

shutDown

public void shutDown()
              throws ShutdownCancelledException
Called to shut the Viewer down, this allows it to save open files etc.

Specified by:
shutDown in interface Viewer
Throws:
ShutdownCancelledException

restoreSession

public void restoreSession()
This loads the GUI into the users prefered state

Specified by:
restoreSession in interface Viewer

saveOpenFiles

protected void saveOpenFiles(java.util.List<ApplicationFile> openFiles,
                             java.lang.Object messageIfNotSaved)
                      throws ShutdownCancelledException
Parameters:
openFiles -
messageIfNotSaved -
Throws:
ShutdownCancelledException

saveSessionFiles

protected void saveSessionFiles(java.util.List<ApplicationFile> openFiles,
                                java.util.prefs.Preferences preferences,
                                java.lang.String fileListKey,
                                java.lang.String currentFileKey)
If any file has not been saved it will not be appended to the file list // TODO: Save position of file windows (x,y)

Parameters:
openFiles - - The list of files currently open
preferences -

shouldRestoreSession

protected boolean shouldRestoreSession(java.lang.String restoreSessionKey)
Parameters:
restoreSessionKey - - The preference key for whether to restore the users session
Returns:
boolean - true if the users session should be restored, false otherwise