gov.sns.xal.smf.application
Class AcceleratorDocument

java.lang.Object
  |
  +--gov.sns.application.XalDocument
        |
        +--gov.sns.xal.smf.application.AcceleratorDocument
All Implemented Interfaces:
java.awt.print.Pageable
Direct Known Subclasses:
DemoDocument

public abstract class AcceleratorDocument
extends XalDocument

AcceleratorDocument is a subclass of XalDocument for accelerator based applications.


Field Summary
protected  Accelerator accelerator
           
protected  java.lang.String acceleratorFilePath
           
protected  AcceleratorSeq selectedSequence
           
protected  java.util.List selectedSequenceList
           
 
Fields inherited from class gov.sns.application.XalDocument
documentListenerProxy, hasChanges, mainWindow, messageCenter, NO_OPTION, source, title, YES_OPTION
 
Fields inherited from interface java.awt.print.Pageable
UNKNOWN_NUMBER_OF_PAGES
 
Constructor Summary
AcceleratorDocument()
          Creates a new instance of AcceleratorDocument
 
Method Summary
 void acceleratorChanged()
          Hook for handling the accelerator change event.
 void acceleratorFilePathChanged()
          Hook for handling the accelerator file path change event.
 Accelerator getAccelerator()
          Get the accelerator managed by this document.
 java.lang.String getAcceleratorFilePath()
          Get the path to the xml file of the accelerator managed by this document.
 AcceleratorWindow getAcceleratorWindow()
          Get the accelerator window managed by this document
 AcceleratorSeq getSelectedSequence()
          Get the selected accelerator sequence managed by this document.
 java.util.List getSelectedSequenceList()
          Get the selected sequence list
protected  boolean loadDefaultAccelerator()
          Attempt to load the user's default accelerator.
 void selectedSequenceChanged()
          Hook for handling the selected sequence change event.
 void setAccelerator(Accelerator newAccelerator, java.lang.String newPath)
          Set the accelerator managed by the document.
 void setAcceleratorFilePath(java.lang.String newPath)
          Set the accelerator file path.
 void setSelectedSequence(AcceleratorSeq selection)
          Set the selected accelerator sequence managed by this document.
 void setSelectedSequenceList(java.util.List seqList)
          Set a list of selected sequences
 
Methods inherited from class gov.sns.application.XalDocument
addXalDocumentListener, closeDocument, customizeCommands, displayConfirmDialog, displayError, displayError, displayError, displayWarning, displayWarning, displayWarning, freeCustomResources, freeResources, generateDocumentTitle, getCustomMenuDefinitionPath, getDisplayFilePath, getEmptyDocumentPath, getMainWindow, getNumberOfPages, getPageFormat, getPrintable, getSource, getTitle, hasChanges, hideDocument, isEmpty, makeMainWindow, registerEvents, removeXalDocumentListener, saveDocument, saveDocumentAs, setHasChanges, setSource, setTitle, showDocument, warnUserOfUnsavedChangesWhenClosing, willClose, writableDocumentTypes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

accelerator

protected Accelerator accelerator

selectedSequence

protected AcceleratorSeq selectedSequence

acceleratorFilePath

protected java.lang.String acceleratorFilePath

selectedSequenceList

protected java.util.List selectedSequenceList
Constructor Detail

AcceleratorDocument

public AcceleratorDocument()
Creates a new instance of AcceleratorDocument

Method Detail

getAcceleratorWindow

public AcceleratorWindow getAcceleratorWindow()
Get the accelerator window managed by this document

Returns:
this document's accelerator window

setAccelerator

public void setAccelerator(Accelerator newAccelerator,
                           java.lang.String newPath)
Set the accelerator managed by the document. Every document manages one accelerator (or possibly null).

Parameters:
newAccelerator - The accelerator managed by this document.
newPath - The path to the accelerator managed by this document.

getAccelerator

public Accelerator getAccelerator()
Get the accelerator managed by this document.

Returns:
The accelerator managed by this document.

setAcceleratorFilePath

public void setAcceleratorFilePath(java.lang.String newPath)
Set the accelerator file path. Every document manages one accelerator (or possibly null).

Parameters:
newPath - The path to the accelerator managed by this document.

getAcceleratorFilePath

public java.lang.String getAcceleratorFilePath()
Get the path to the xml file of the accelerator managed by this document.

Returns:
path to the xml file of the accelerator managed by this document.

loadDefaultAccelerator

protected boolean loadDefaultAccelerator()
Attempt to load the user's default accelerator. If no default accelerator is specified, then prompt the user to specify the default optics path. The document's accelerator file is set to the user's default accelerator.

Returns:
true if the default accelerator was successfully loaded

setSelectedSequence

public void setSelectedSequence(AcceleratorSeq selection)
Set the selected accelerator sequence managed by this document.

Parameters:
selection - The accelerator sequence to be managed by this document.

setSelectedSequenceList

public void setSelectedSequenceList(java.util.List seqList)
Set a list of selected sequences

Parameters:
seqList - The list of selected sequences

getSelectedSequence

public AcceleratorSeq getSelectedSequence()
Get the selected accelerator sequence managed by this document.

Returns:
The sequence managed by this document.

getSelectedSequenceList

public java.util.List getSelectedSequenceList()
Get the selected sequence list

Returns:
the selected sequence list

acceleratorChanged

public void acceleratorChanged()
Hook for handling the accelerator change event. Subclasses should override this method to provide custom handling. The default handler does nothing.


selectedSequenceChanged

public void selectedSequenceChanged()
Hook for handling the selected sequence change event. Subclasses should override this method to provide custom handling. The default handler does nothing.


acceleratorFilePathChanged

public void acceleratorFilePathChanged()
Hook for handling the accelerator file path change event. Subclasses should override this method to provide custom handling. The default handler does nothing.