gov.sns.xal.smf.application.demo
Class DemoDocument

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

public class DemoDocument
extends AcceleratorDocument

DemoDocument is a custom AcceleratorDocument for the demo application. Each document instance manages a single plain text document. The document manages the data that is displayed in the window. In this example we display information about the accelerator or the selected sequence as appropriate based on the most recent user action.


Field Summary
protected  javax.swing.text.PlainDocument textDocument
          The document for the text pane in the main window.
 
Fields inherited from class gov.sns.xal.smf.application.AcceleratorDocument
accelerator, acceleratorFilePath, selectedSequence, 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
DemoDocument()
          Create a new empty document
DemoDocument(java.net.URL url)
          Create a new document loaded from the URL file
 
Method Summary
 void acceleratorChanged()
          Handle the accelerator changed event by displaying the elements of the accelerator in the main window.
 void makeMainWindow()
          Make a main window by instantiating the my custom window.
 void saveDocumentAs(java.net.URL url)
          Save the document to the specified URL.
 void selectedSequenceChanged()
          Handle the selected sequence changed event by displaying the elements of the selected sequence in the main window.
 
Methods inherited from class gov.sns.xal.smf.application.AcceleratorDocument
acceleratorFilePathChanged, getAccelerator, getAcceleratorFilePath, getAcceleratorWindow, getSelectedSequence, getSelectedSequenceList, loadDefaultAccelerator, setAccelerator, setAcceleratorFilePath, setSelectedSequence, setSelectedSequenceList
 
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, registerEvents, removeXalDocumentListener, saveDocument, 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

textDocument

protected javax.swing.text.PlainDocument textDocument
The document for the text pane in the main window.

Constructor Detail

DemoDocument

public DemoDocument()
Create a new empty document


DemoDocument

public DemoDocument(java.net.URL url)
Create a new document loaded from the URL file

Parameters:
url - The URL of the file to load into the new document.
Method Detail

makeMainWindow

public void makeMainWindow()
Make a main window by instantiating the my custom window. Set the text pane to use the textDocument variable as its document.

Specified by:
makeMainWindow in class XalDocument

saveDocumentAs

public void saveDocumentAs(java.net.URL url)
Save the document to the specified URL.

Specified by:
saveDocumentAs in class XalDocument
Parameters:
url - The URL to which the document should be saved.

acceleratorChanged

public void acceleratorChanged()
Handle the accelerator changed event by displaying the elements of the accelerator in the main window.

Overrides:
acceleratorChanged in class AcceleratorDocument

selectedSequenceChanged

public void selectedSequenceChanged()
Handle the selected sequence changed event by displaying the elements of the selected sequence in the main window.

Overrides:
selectedSequenceChanged in class AcceleratorDocument