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.ContainergetContentPane()Returns the contentPane of the delegate.AppContextgetDelegate()Return the context delegate.javax.swing.ActiongetExitAction()Return the exit action of the delegate.java.awt.ComponentgetGlassPane()Returns the glassPane of the delegate.java.awt.ImagegetIconImage()Return the image icon of the delegate.javax.swing.JMenuBargetJMenuBar()Return the menu bar of the delegate.javax.swing.JLayeredPanegetLayeredPane()Returns the layeredPane of the delegate.javax.swing.JRootPanegetRootPane()Returns the rootPane of the delegate.java.lang.StringgetTitle()Return the title of the context.booleanisVisible()Invoke the delegate's isvisible().java.awt.ComponentmakeComponent()Call makeComponent() on the delegate.voidsetContentPane(java.awt.Container contentPane)Set the content pane of the delegate.voidsetExitAction(javax.swing.Action action)Set the exit action of the delegate.voidsetGlassPane(java.awt.Component glassPane)Set the glassPane of the delegate.voidsetIconImage(java.awt.Image image)Set the image icon of the delegate.voidsetJMenuBar(javax.swing.JMenuBar menu)Set the menu bar of the delegate.voidsetLayeredPane(javax.swing.JLayeredPane layeredPane)Set the layered pane of the delegate.voidsetSize(int w, int h)Set the size in the delegate.voidsetTitle(java.lang.String title)Set the title of the context.voidsetVisible(boolean visible)Invoke the delegate's setvisible().voidshowStatus(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:
getContentPanein 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:
getGlassPanein interfacejavax.swing.RootPaneContainer
-
getLayeredPane
public javax.swing.JLayeredPane getLayeredPane()
Returns the layeredPane of the delegate.- Specified by:
getLayeredPanein interfacejavax.swing.RootPaneContainer
-
getRootPane
public javax.swing.JRootPane getRootPane()
Returns the rootPane of the delegate.- Specified by:
getRootPanein interfacejavax.swing.RootPaneContainer
-
getTitle
public java.lang.String getTitle()
Return the title of the context.- Specified by:
getTitlein 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:
setContentPanein 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:
setGlassPanein 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:
setLayeredPanein interfacejavax.swing.RootPaneContainer
-
setExitAction
public void setExitAction(javax.swing.Action action)
Set the exit action of the delegate.- Specified by:
setExitActionin interfaceAppContext
-
getExitAction
public javax.swing.Action getExitAction()
Return the exit action of the delegate.- Specified by:
getExitActionin interfaceAppContext
-
setIconImage
public void setIconImage(java.awt.Image image)
Set the image icon of the delegate.- Specified by:
setIconImagein interfaceAppContext
-
getIconImage
public java.awt.Image getIconImage()
Return the image icon of the delegate.- Specified by:
getIconImagein interfaceAppContext
-
getJMenuBar
public javax.swing.JMenuBar getJMenuBar()
Return the menu bar of the delegate.- Specified by:
getJMenuBarin interfaceAppContext
-
setJMenuBar
public void setJMenuBar(javax.swing.JMenuBar menu)
Set the menu bar of the delegate.- Specified by:
setJMenuBarin interfaceAppContext
-
showStatus
public void showStatus(java.lang.String status)
Show the status in the delegate.- Specified by:
showStatusin interfaceAppContext
-
setSize
public void setSize(int w, int h)Set the size in the delegate.- Specified by:
setSizein 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:
setTitlein interfaceAppContext
-
setVisible
public void setVisible(boolean visible)
Invoke the delegate's setvisible().- Specified by:
setVisiblein interfaceAppContext
-
isVisible
public boolean isVisible()
Invoke the delegate's isvisible().- Specified by:
isVisiblein interfaceAppContext
-
makeComponent
public java.awt.Component makeComponent()
Call makeComponent() on the delegate.- Specified by:
makeComponentin interfaceAppContext
-
-