Package diva.gui
Class AppContextDelegate
- java.lang.Object
-
- diva.gui.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.
-
-
-
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 interfacejavax.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 interfacejavax.swing.RootPaneContainer
-
getLayeredPane
public javax.swing.JLayeredPane getLayeredPane()
Returns the layeredPane of the delegate.- Specified by:
getLayeredPane
in interfacejavax.swing.RootPaneContainer
-
getRootPane
public javax.swing.JRootPane getRootPane()
Returns the rootPane of the delegate.- Specified by:
getRootPane
in interfacejavax.swing.RootPaneContainer
-
getTitle
public java.lang.String getTitle()
Return the title of the context.- Specified by:
getTitle
in interfaceAppContext
-
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 interfacejavax.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 interfacejavax.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 interfacejavax.swing.RootPaneContainer
-
setExitAction
public void setExitAction(javax.swing.Action action)
Set the exit action of the delegate.- Specified by:
setExitAction
in interfaceAppContext
-
getExitAction
public javax.swing.Action getExitAction()
Return the exit action of the delegate.- Specified by:
getExitAction
in interfaceAppContext
-
setIconImage
public void setIconImage(java.awt.Image image)
Set the image icon of the delegate.- Specified by:
setIconImage
in interfaceAppContext
-
getIconImage
public java.awt.Image getIconImage()
Return the image icon of the delegate.- Specified by:
getIconImage
in interfaceAppContext
-
getJMenuBar
public javax.swing.JMenuBar getJMenuBar()
Return the menu bar of the delegate.- Specified by:
getJMenuBar
in interfaceAppContext
-
setJMenuBar
public void setJMenuBar(javax.swing.JMenuBar menu)
Set the menu bar of the delegate.- Specified by:
setJMenuBar
in interfaceAppContext
-
showStatus
public void showStatus(java.lang.String status)
Show the status in the delegate.- Specified by:
showStatus
in interfaceAppContext
-
setSize
public void setSize(int w, int h)
Set the size in the delegate.- Specified by:
setSize
in interfaceAppContext
-
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 interfaceAppContext
-
setVisible
public void setVisible(boolean visible)
Invoke the delegate's setvisible().- Specified by:
setVisible
in interfaceAppContext
-
isVisible
public boolean isVisible()
Invoke the delegate's isvisible().- Specified by:
isVisible
in interfaceAppContext
-
makeComponent
public java.awt.Component makeComponent()
Call makeComponent() on the delegate.- Specified by:
makeComponent
in interfaceAppContext
-
-