Class FrameApplication

java.lang.Object
xal.extension.application.Application
xal.extension.application.FrameApplication
All Implemented Interfaces:
XalDocumentListener
Direct Known Subclasses:
AcceleratorApplication

public class FrameApplication extends Application implements XalDocumentListener
Application subclass for JFrame based applications.
  • Constructor Details

    • FrameApplication

      protected FrameApplication(ApplicationAdaptor adaptor)
      Constructor
      Parameters:
      adaptor - The application adaptor used for customization.
    • FrameApplication

      protected FrameApplication(ApplicationAdaptor adaptor, URL[] urls)
      Constructor
      Parameters:
      adaptor - The application adaptor used for customization.
      urls - An array of document URLs to open upon startup.
  • Method Details

    • setup

      protected void setup(URL[] urls)
      Initialize the Application and open the documents specified by the URL array. If the URL array is empty, then create one empty document.
      Specified by:
      setup in class Application
      Parameters:
      urls - An array of document URLs to open.
    • produceDocument

      public void produceDocument(xal.extension.application.XalAbstractDocument document, boolean makeVisible)
      Add a new document to this application and if makeVisible is true, show it
      Specified by:
      produceDocument in class Application
      Parameters:
      document - the document to produce
      makeVisible - make the document visible
    • newDocument

      protected void newDocument()
      Create and open a new empty document.
      Specified by:
      newDocument in class Application
    • newDocument

      protected void newDocument(String type)
      Create and open a new empty document of the specified type.
      Specified by:
      newDocument in class Application
      Parameters:
      type - the type of document to create.
    • revertToSaved

      protected void revertToSaved(xal.extension.application.XalAbstractDocument document)
      Handle the "Revert To Saved" action by reverting the specified document to that of its source file.
      Overrides:
      revertToSaved in class Application
      Parameters:
      document - The document to revert.
    • closeAllDocuments

      protected void closeAllDocuments()
      Handle the "Close All" action by closing all open documents and opening a new empty document.
      Overrides:
      closeAllDocuments in class Application
    • titleChanged

      public void titleChanged(XalDocument document, String newTitle)
      Implement XalDocumentListener. Empty implementation.
      Specified by:
      titleChanged in interface XalDocumentListener
      Parameters:
      document - The document whose title changed.
      newTitle - The new document title.
    • hasChangesChanged

      public void hasChangesChanged(XalDocument document, boolean newHasChangesStatus)
      Implement XalDocumentListener. Empty implementation.
      Specified by:
      hasChangesChanged in interface XalDocumentListener
      Parameters:
      document - The document whose change status changed
      newHasChangesStatus - The new "hasChanges" status of the document.
    • documentWillClose

      public void documentWillClose(XalDocument document)
      Implement XalDocumentListener. Empty implementation.
      Specified by:
      documentWillClose in interface XalDocumentListener
      Parameters:
      document - The document that will close.
    • documentHasClosed

      public void documentHasClosed(XalDocument document)
      Implement XalDocumentListener. When a document has closed, the application receives this event and removes the document from its open documents list. If there are no documents remaining, the application quits.
      Specified by:
      documentHasClosed in interface XalDocumentListener
      Parameters:
      document - The document that has closed.
    • launch

      public static void launch(ApplicationAdaptor adaptor, URL[] urls)
      Handle the launching of the application by creating the application instance and performing application initialization.
      Parameters:
      adaptor - The custom application adaptor.
      urls - The URLs of documents to open upon launching the application