Class MDIApplication

  • All Implemented Interfaces:
    Application
    Direct Known Subclasses:
    MDIApplicationTutorial

    public abstract class MDIApplication
    extends AbstractApplication
    An abstract superclass for applications that use an MDI (multiple document interface) style of presentation. This class manages the interaction between documents of the application, and the frame that they are displayed in. For example, keeping documents and views in sync, handling focus changes, and so on. The context must implement MDIContext for this to work properly. Note: this application only manages one view per document. If you have multiple views per document, you will need to implement the view-document mapping yourself.
    Version:
    $Id$
    Author:
    John Reekie
    • Constructor Detail

      • MDIApplication

        public MDIApplication​(MDIContext context)
        Create an MDI application in the given MDI context
    • Method Detail

      • addView

        public void addView​(View v)
        Description copied from class: AbstractApplication
        Add a view to the list of views currently known by this application. Fire a view list event to registered listeners. Throw an exception if the view is already in the list of views.
        Specified by:
        addView in interface Application
        Overrides:
        addView in class AbstractApplication
      • createView

        public abstract View createView​(Document d)
        Given a document, create a new view which displays that document. Subclasses must implement this method to create, initialize, and then return a View object that wraps a JComponent.
        Specified by:
        createView in interface Application
        Specified by:
        createView in class AbstractApplication
      • getMDIContext

        public MDIContext getMDIContext()
        Get the MDI frame -- type-specific version of getApplicationFrame().
      • getView

        public View getView​(javax.swing.JComponent c)
        Get the Document displayed by the given component.
      • removeView

        public void removeView​(View v)
        Remove a view from the list of view currently known by this application. Fire a document list event to registered listeners. Throw an exception if the document is not known. This method assumes that setCurrentView will be called subsequently on another view.
        Specified by:
        removeView in interface Application
        Overrides:
        removeView in class AbstractApplication