diva.gui
Class AppContextDelegate

java.lang.Object
  extended by diva.gui.AppContextDelegate
All Implemented Interfaces:
AppContext, RootPaneContainer
Direct Known Subclasses:
DesktopContext

public class AppContextDelegate
extends 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:
$Revision: 1.2 $
Author:
Steve Neuendorffer (neuendor@eecs.berkeley.edu)

Constructor Summary
AppContextDelegate(AppContext context)
          Create a new app context that delegates to the given context.
 
Method Summary
 Container getContentPane()
          Returns the contentPane of the delegate.
 AppContext getDelegate()
          Return the context delegate.
 Action getExitAction()
          Return the exit action of the delegate.
 Component getGlassPane()
          Returns the glassPane of the delegate.
 Image getIconImage()
          Return the image icon of the delegate.
 JMenuBar getJMenuBar()
          Return the menu bar of the delegate.
 JLayeredPane getLayeredPane()
          Returns the layeredPane of the delegate.
 JRootPane getRootPane()
          Returns the rootPane of the delegate.
 String getTitle()
          Return the title of the context.
 boolean isVisible()
          Invoke the delegate's isvisible().
 Component makeComponent()
          Call makeComponent() on the delegate.
 void setContentPane(Container contentPane)
          Set the content pane of the delegate.
 void setExitAction(Action action)
          Set the exit action of the delegate.
 void setGlassPane(Component glassPane)
          Set the glassPane of the delegate.
 void setIconImage(Image image)
          Set the image icon of the delegate.
 void setJMenuBar(JMenuBar menu)
          Set the menu bar of the delegate.
 void setLayeredPane(JLayeredPane layeredPane)
          Set the layerd pane of the delegate.
 void setSize(int w, int h)
          Set the size in the delegate.
 void setTitle(String title)
          Set the title of the context.
 void setVisible(boolean visible)
          Invoke the delegate's setvisible().
 void showStatus(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 Container getContentPane()
Returns the contentPane of the delegate.

Specified by:
getContentPane in interface RootPaneContainer

getDelegate

public AppContext getDelegate()
Return the context delegate.


getGlassPane

public Component getGlassPane()
Returns the glassPane of the delegate.

Specified by:
getGlassPane in interface RootPaneContainer

getLayeredPane

public JLayeredPane getLayeredPane()
Returns the layeredPane of the delegate.

Specified by:
getLayeredPane in interface RootPaneContainer

getRootPane

public JRootPane getRootPane()
Returns the rootPane of the delegate.

Specified by:
getRootPane in interface RootPaneContainer

getTitle

public String getTitle()
Return the title of the context.

Specified by:
getTitle in interface AppContext

setContentPane

public void setContentPane(Container contentPane)
Set the content pane of the delegate. The "contentPane" is the primary container for application specific components.

Specified by:
setContentPane in interface RootPaneContainer

setGlassPane

public void setGlassPane(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 RootPaneContainer

setLayeredPane

public void setLayeredPane(JLayeredPane layeredPane)
Set the layerd pane of the delegate. A Container that manages the contentPane and in some cases a menu bar

Specified by:
setLayeredPane in interface RootPaneContainer

setExitAction

public void setExitAction(Action action)
Set the exit action of the delegate.

Specified by:
setExitAction in interface AppContext

getExitAction

public Action getExitAction()
Return the exit action of the delegate.

Specified by:
getExitAction in interface AppContext

setIconImage

public void setIconImage(Image image)
Set the image icon of the delegate.

Specified by:
setIconImage in interface AppContext

getIconImage

public Image getIconImage()
Return the image icon of the delegate.

Specified by:
getIconImage in interface AppContext

getJMenuBar

public JMenuBar getJMenuBar()
Return the menu bar of the delegate.

Specified by:
getJMenuBar in interface AppContext

setJMenuBar

public void setJMenuBar(JMenuBar menu)
Set the menu bar of the delegate.

Specified by:
setJMenuBar in interface AppContext

showStatus

public void showStatus(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(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 Component makeComponent()
Call makeComponent() on the delegate.

Specified by:
makeComponent in interface AppContext


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.