Package diva.gui

Class AppContextDelegate

  • All Implemented Interfaces:
    AppContext, javax.swing.RootPaneContainer
    Direct Known Subclasses:
    DesktopContext

    public class AppContextDelegate
    extends java.lang.Object
    implements AppContext
    This class provides basic support for an instance of AppContext which delegates its operation to one of the basic AppContexts (usually an AppContext or an ApplicationContext.) This is similar to an interface adapter, except the default implementation of each method is to call the identical method on the delegate context.
    Version:
    $Id$
    Author:
    Steve Neuendorffer
    • Constructor Summary

      Constructors 
      Constructor Description
      AppContextDelegate​(AppContext context)
      Create a new app context that delegates to the given context.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.Container getContentPane()
      Returns the contentPane of the delegate.
      AppContext getDelegate()
      Return the context delegate.
      javax.swing.Action getExitAction()
      Return the exit action of the delegate.
      java.awt.Component getGlassPane()
      Returns the glassPane of the delegate.
      java.awt.Image getIconImage()
      Return the image icon of the delegate.
      javax.swing.JMenuBar getJMenuBar()
      Return the menu bar of the delegate.
      javax.swing.JLayeredPane getLayeredPane()
      Returns the layeredPane of the delegate.
      javax.swing.JRootPane getRootPane()
      Returns the rootPane of the delegate.
      java.lang.String getTitle()
      Return the title of the context.
      boolean isVisible()
      Invoke the delegate's isvisible().
      java.awt.Component makeComponent()
      Call makeComponent() on the delegate.
      void setContentPane​(java.awt.Container contentPane)
      Set the content pane of the delegate.
      void setExitAction​(javax.swing.Action action)
      Set the exit action of the delegate.
      void setGlassPane​(java.awt.Component glassPane)
      Set the glassPane of the delegate.
      void setIconImage​(java.awt.Image image)
      Set the image icon of the delegate.
      void setJMenuBar​(javax.swing.JMenuBar menu)
      Set the menu bar of the delegate.
      void setLayeredPane​(javax.swing.JLayeredPane layeredPane)
      Set the layered pane of the delegate.
      void setSize​(int w, int h)
      Set the size in the delegate.
      void setTitle​(java.lang.String title)
      Set the title of the context.
      void setVisible​(boolean visible)
      Invoke the delegate's setvisible().
      void showStatus​(java.lang.String status)
      Show the status in the delegate.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AppContextDelegate

        public AppContextDelegate​(AppContext context)
        Create a new app context that delegates to the given context.
    • Method Detail

      • getContentPane

        public java.awt.Container getContentPane()
        Returns the contentPane of the delegate.
        Specified by:
        getContentPane in interface javax.swing.RootPaneContainer
      • getDelegate

        public AppContext getDelegate()
        Return the context delegate.
      • getGlassPane

        public java.awt.Component getGlassPane()
        Returns the glassPane of the delegate.
        Specified by:
        getGlassPane in interface javax.swing.RootPaneContainer
      • getLayeredPane

        public javax.swing.JLayeredPane getLayeredPane()
        Returns the layeredPane of the delegate.
        Specified by:
        getLayeredPane in interface javax.swing.RootPaneContainer
      • getRootPane

        public javax.swing.JRootPane getRootPane()
        Returns the rootPane of the delegate.
        Specified by:
        getRootPane in interface javax.swing.RootPaneContainer
      • getTitle

        public java.lang.String getTitle()
        Return the title of the context.
        Specified by:
        getTitle in interface AppContext
      • setContentPane

        public void setContentPane​(java.awt.Container contentPane)
        Set the content pane of the delegate. The "contentPane" is the primary container for application specific components.
        Specified by:
        setContentPane in interface javax.swing.RootPaneContainer
      • setGlassPane

        public void setGlassPane​(java.awt.Component glassPane)
        Set the glassPane of the delegate. The glassPane is always the first child of the rootPane and the rootPanes layout manager ensures that it's always as big as the rootPane.
        Specified by:
        setGlassPane in interface javax.swing.RootPaneContainer
      • setLayeredPane

        public void setLayeredPane​(javax.swing.JLayeredPane layeredPane)
        Set the layered pane of the delegate. A Container that manages the contentPane and in some cases a menu bar
        Specified by:
        setLayeredPane in interface javax.swing.RootPaneContainer
      • setExitAction

        public void setExitAction​(javax.swing.Action action)
        Set the exit action of the delegate.
        Specified by:
        setExitAction in interface AppContext
      • getExitAction

        public javax.swing.Action getExitAction()
        Return the exit action of the delegate.
        Specified by:
        getExitAction in interface AppContext
      • setIconImage

        public void setIconImage​(java.awt.Image image)
        Set the image icon of the delegate.
        Specified by:
        setIconImage in interface AppContext
      • getIconImage

        public java.awt.Image getIconImage()
        Return the image icon of the delegate.
        Specified by:
        getIconImage in interface AppContext
      • getJMenuBar

        public javax.swing.JMenuBar getJMenuBar()
        Return the menu bar of the delegate.
        Specified by:
        getJMenuBar in interface AppContext
      • setJMenuBar

        public void setJMenuBar​(javax.swing.JMenuBar menu)
        Set the menu bar of the delegate.
        Specified by:
        setJMenuBar in interface AppContext
      • showStatus

        public void showStatus​(java.lang.String status)
        Show the status in the delegate.
        Specified by:
        showStatus in interface AppContext
      • setSize

        public void setSize​(int w,
                            int h)
        Set the size in the delegate.
        Specified by:
        setSize in interface AppContext
      • setTitle

        public void setTitle​(java.lang.String title)
        Set the title of the context. This has no significance in an applet context.
        Specified by:
        setTitle in interface AppContext
      • setVisible

        public void setVisible​(boolean visible)
        Invoke the delegate's setvisible().
        Specified by:
        setVisible in interface AppContext
      • isVisible

        public boolean isVisible()
        Invoke the delegate's isvisible().
        Specified by:
        isVisible in interface AppContext
      • makeComponent

        public java.awt.Component makeComponent()
        Call makeComponent() on the delegate.
        Specified by:
        makeComponent in interface AppContext