ti.chimera.service
Class WindowManager

java.lang.Object
  extended byti.chimera.Service
      extended byti.chimera.service.WindowManager

public abstract class WindowManager
extends Service

The window manager service provides a way for other parts of the system to display dialogs/docks, toolbars, and menubar entries.

Version:
0.1
Author:
Rob Clark

Nested Class Summary
static class WindowManager.DialogNotClosableException
          This exception type is used to abort closing a dialog, if it is not closable for whatever reason.
 
Constructor Summary
WindowManager()
          Class Constructor.
 
Method Summary
abstract  void addDock(Dock dock)
           
abstract  void addMenuBarItem(java.lang.String path, javax.swing.Action a)
          Add a menu bar item.
abstract  void addToolBar(javax.swing.JToolBar toolBar)
          Add a tool-bar.
abstract  void dockUpdated(Dock dock)
           
abstract  Dialog getDialog(java.lang.String title)
          Get a dialog with the specified title.
abstract  boolean isVisible()
          Show or hide the user interface.
abstract  void removeDock(Dock dock)
           
abstract  void removeMenuBarItem(java.lang.String path, javax.swing.Action a)
          Remove a menu bar item.
abstract  void removeToolBar(javax.swing.JToolBar toolBar)
          Remove a tool-bar.
abstract  void setLookAndFeel(java.lang.String lnfName)
          Set the Look & Feel.
abstract  void setMode(WindowMode mode)
          Set the mode.
abstract  void setVisible(boolean b)
          Show or hide the user interface.
 
Methods inherited from class ti.chimera.Service
getName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WindowManager

public WindowManager()
Class Constructor.

Method Detail

setMode

public abstract void setMode(WindowMode mode)
Set the mode. The mode implements the actual display of the user interface to the user.

Parameters:
mode - the service implementing the mode which realizes the display of dialogs/toolbars/menubar

setLookAndFeel

public abstract void setLookAndFeel(java.lang.String lnfName)
Set the Look & Feel. Swing supports multiple look&feels, depending on the platform. (For example: Metal, Motif, Windows, MacOSX, plus any 3rd party L&F that the user has installed.)

Parameters:
lnfName - the full name of the class implementing the L&F

getDialog

public abstract Dialog getDialog(java.lang.String title)
Get a dialog with the specified title. This method should be used, rather than creating a JDialog, because this will behave properly if the window manager is in DESKTOP_MODE.

Parameters:
title - the title of the dialog
Returns:
a dialog

addDock

public abstract void addDock(Dock dock)

removeDock

public abstract void removeDock(Dock dock)

dockUpdated

public abstract void dockUpdated(Dock dock)

addToolBar

public abstract void addToolBar(javax.swing.JToolBar toolBar)
Add a tool-bar.

Parameters:
toolBar - the tool-bar to add

removeToolBar

public abstract void removeToolBar(javax.swing.JToolBar toolBar)
Remove a tool-bar.

Parameters:
toolBar - the tool-bar to remove

addMenuBarItem

public abstract void addMenuBarItem(java.lang.String path,
                                    javax.swing.Action a)
Add a menu bar item. The path of the action is "/" seperated "path" of the action, such as "/File/Open". Multiple actions with the same path and name can exist, in which case when the user selects that entry from the pull-down menus, the actionPerformed methods will be in the order that the actions where added. If the action is null, a separator will be added.

Parameters:
path - which sub-menu the item should go under
a - the menu bar action to add.
See Also:
removeMenuBarItem(java.lang.String, javax.swing.Action)

removeMenuBarItem

public abstract void removeMenuBarItem(java.lang.String path,
                                       javax.swing.Action a)
Remove a menu bar item.

Parameters:
path - which sub-menu the item should go under
a - the menu bar action to remove.
See Also:
addMenuBarItem(java.lang.String, javax.swing.Action)

setVisible

public abstract void setVisible(boolean b)
Show or hide the user interface.

Parameters:
b - true to show the user interface, or false to hide it

isVisible

public abstract boolean isVisible()
Show or hide the user interface.