org.opa.window
Class OPADefaultWindowManager

java.lang.Object
  extended byorg.opa.window.OPADefaultWindowManager
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.InternalFrameListener, OPAManager, OPAWindowManager, java.awt.event.WindowFocusListener, java.awt.event.WindowListener, java.awt.event.WindowStateListener

public class OPADefaultWindowManager
extends java.lang.Object
implements OPAWindowManager, java.awt.event.WindowListener, java.awt.event.WindowStateListener, java.awt.event.WindowFocusListener, javax.swing.event.InternalFrameListener

The class OPADefaultWindowManager implements OPAWindowManager interface to show Dialogs/Internal Dialogs and dock splitPanes/Internal Frames into panels.


Field Summary
static java.lang.String INTERNAL_DIALOG
           
static java.lang.String REGULAR_DIALOG
           
 
Constructor Summary
OPADefaultWindowManager()
          Creates a new instance of OPADefaultWindowManager where waitingPanels and activeDialogs are created waitingPanels is an empty LinkedHashMap created using an anonymous inner class
 
Method Summary
 void addDisplayBuilder(OPADisplayBuilder builder)
          Adds an OPADisplayBuilder to the instance of OPAWindowManager.
 void dockPanel(java.lang.String opaPanelName, java.lang.String position)
          Docks an OPAPanel to the main application window.
 javax.swing.JDesktopPane getDesktop()
          Returns the desktop
 javax.swing.JFrame getFrame()
          Returns the frame
 java.lang.String getName()
          Returns the name
 int getPanelCacheSize()
          Returns the size of panelCache
 void internalFrameActivated(javax.swing.event.InternalFrameEvent e)
           
 void internalFrameClosed(javax.swing.event.InternalFrameEvent e)
           
 void internalFrameClosing(javax.swing.event.InternalFrameEvent e)
           
 void internalFrameDeactivated(javax.swing.event.InternalFrameEvent e)
           
 void internalFrameDeiconified(javax.swing.event.InternalFrameEvent e)
           
 void internalFrameIconified(javax.swing.event.InternalFrameEvent e)
           
 void internalFrameOpened(javax.swing.event.InternalFrameEvent e)
           
 void load()
          Loads the application
 void saveDialogs(java.util.HashMap hash)
           
 void showDialog(java.lang.String name, int positionX, int positionY, java.lang.Object[] obj, java.lang.String min, java.lang.String max, java.lang.String dialogType)
          Shows the specified OPADialog/internal frame type loaded with the panel specified by name, position, object and window minimized/maximized.
 void showInternal(java.lang.String name, int positionX, int positionY, java.lang.Object[] obj, java.lang.String min, java.lang.String max)
          Shows the specified dialog type loaded with the panel specified by name, position, object and window minimized/maximized.
 void showInternal(java.lang.String name, java.lang.Object[] obj)
          Shows OPADialog with the specified name and object and remaining parameters at default values
 void showInternal(java.lang.String name, java.lang.Object[] obj, java.lang.String type)
           
 void showInternalDialog(java.lang.String name, int positionX, int positionY, java.lang.Object[] obj, java.lang.String min, java.lang.String max)
          Shows the specified internal frame type loaded with the panel specified by name, position, object and window minimized/maximized.
 void showInternalDialog(java.lang.String name, java.lang.Object[] obj)
          Shows OPAInternalDialog with the specified name and object and sets remaining parameters with default values
 void signalClose(OPADefaultDialog dialog)
          Closes the OPADefaultDialog
 void signalClose(OPAInternalDialog dialog)
          Closes the OPAInternalDialog
 void signalClose(OPAPanel panel)
          Closes the OPAPanel
 void start()
          starts the OPADefaultWindowManager GUI is built in this method
 void stop()
          Stops the application and saves the Window state Window state includes the windows/dialogs that are open, their position on the screen,the args that were used to open them.
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
           
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowGainedFocus(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowLostFocus(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 void windowStateChanged(java.awt.event.WindowEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTERNAL_DIALOG

public static final java.lang.String INTERNAL_DIALOG
See Also:
Constant Field Values

REGULAR_DIALOG

public static final java.lang.String REGULAR_DIALOG
See Also:
Constant Field Values
Constructor Detail

OPADefaultWindowManager

public OPADefaultWindowManager()
Creates a new instance of OPADefaultWindowManager where waitingPanels and activeDialogs are created waitingPanels is an empty LinkedHashMap created using an anonymous inner class

Method Detail

start

public void start()
starts the OPADefaultWindowManager GUI is built in this method

Specified by:
start in interface OPAManager

load

public void load()
Loads the application

Specified by:
load in interface OPAManager

stop

public void stop()
Stops the application and saves the Window state Window state includes the windows/dialogs that are open, their position on the screen,the args that were used to open them. Window State is represented by an inner class WindowRequest

Specified by:
stop in interface OPAManager

getDesktop

public javax.swing.JDesktopPane getDesktop()
Returns the desktop

Returns:
desktop instance
See Also:
JDesktopPane

getFrame

public javax.swing.JFrame getFrame()
Returns the frame

Returns:
frame instance

getName

public java.lang.String getName()
Returns the name

Returns:
name of the object

getPanelCacheSize

public int getPanelCacheSize()
Returns the size of panelCache

Returns:
cache size for the panels

showInternal

public void showInternal(java.lang.String name,
                         int positionX,
                         int positionY,
                         java.lang.Object[] obj,
                         java.lang.String min,
                         java.lang.String max)
Shows the specified dialog type loaded with the panel specified by name, position, object and window minimized/maximized. The name must match the name of the panel class file otherwise an error is returned.

Specified by:
showInternal in interface OPAWindowManager
Parameters:
name -
positionX - the X position from the window's origin
positionY - the Y position from the window's origin

showInternal

public void showInternal(java.lang.String name,
                         java.lang.Object[] obj)
Shows OPADialog with the specified name and object and remaining parameters at default values

Specified by:
showInternal in interface OPAWindowManager
Parameters:
name - panel's name

showInternal

public void showInternal(java.lang.String name,
                         java.lang.Object[] obj,
                         java.lang.String type)

showInternalDialog

public void showInternalDialog(java.lang.String name,
                               int positionX,
                               int positionY,
                               java.lang.Object[] obj,
                               java.lang.String min,
                               java.lang.String max)
Shows the specified internal frame type loaded with the panel specified by name, position, object and window minimized/maximized. The name must match the name of the panel class file otherwise an error is returned.

Specified by:
showInternalDialog in interface OPAWindowManager
Parameters:
name -
positionX - the X position from the window's origin
positionY - the Y position from the window's origin

showInternalDialog

public void showInternalDialog(java.lang.String name,
                               java.lang.Object[] obj)
Shows OPAInternalDialog with the specified name and object and sets remaining parameters with default values

Specified by:
showInternalDialog in interface OPAWindowManager
Parameters:
name - panel's name

showDialog

public void showDialog(java.lang.String name,
                       int positionX,
                       int positionY,
                       java.lang.Object[] obj,
                       java.lang.String min,
                       java.lang.String max,
                       java.lang.String dialogType)
Shows the specified OPADialog/internal frame type loaded with the panel specified by name, position, object and window minimized/maximized. A window request instance is used to save the state of the window

Parameters:
name -
positionX - the X position from the window's origin
positionY - the Y position from the window's origin
dialogType - if the dialog should be a regular dialog/InternalDialog
See Also:
OPADialog, OPAInternalDialog

signalClose

public void signalClose(OPAPanel panel)
Closes the OPAPanel

Specified by:
signalClose in interface OPAWindowManager
Parameters:
panel -

signalClose

public void signalClose(OPAInternalDialog dialog)
Closes the OPAInternalDialog

Specified by:
signalClose in interface OPAWindowManager

signalClose

public void signalClose(OPADefaultDialog dialog)
Closes the OPADefaultDialog

Specified by:
signalClose in interface OPAWindowManager

addDisplayBuilder

public void addDisplayBuilder(OPADisplayBuilder builder)
Adds an OPADisplayBuilder to the instance of OPAWindowManager. OPAWindowManager implementations would typically use it to create application menubar, toolbars and popupmenu. The OPADisplayBuilder should be loaded with OPAActionBundles BEFORE it is passed to OPAWindowManager. This is typically done by an implementation of OPAActionManager. OPAWindowManager implementations would most likely use the OPADisplayBuilder when start() is called. Therefore there is no obvious reason why this method would be used AFTER the OPAWindowManager has started.

Specified by:
addDisplayBuilder in interface OPAWindowManager

dockPanel

public void dockPanel(java.lang.String opaPanelName,
                      java.lang.String position)
Docks an OPAPanel to the main application window. This is done using multiple Java Slide Pane. As each request is taken, the new OPAPanel is nested into the existing display.

Specified by:
dockPanel in interface OPAWindowManager

saveDialogs

public void saveDialogs(java.util.HashMap hash)

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Specified by:
windowClosing in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowGainedFocus

public void windowGainedFocus(java.awt.event.WindowEvent e)
Specified by:
windowGainedFocus in interface java.awt.event.WindowFocusListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowLostFocus

public void windowLostFocus(java.awt.event.WindowEvent e)
Specified by:
windowLostFocus in interface java.awt.event.WindowFocusListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

windowStateChanged

public void windowStateChanged(java.awt.event.WindowEvent e)
Specified by:
windowStateChanged in interface java.awt.event.WindowStateListener

internalFrameActivated

public void internalFrameActivated(javax.swing.event.InternalFrameEvent e)
Specified by:
internalFrameActivated in interface javax.swing.event.InternalFrameListener

internalFrameClosed

public void internalFrameClosed(javax.swing.event.InternalFrameEvent e)
Specified by:
internalFrameClosed in interface javax.swing.event.InternalFrameListener

internalFrameClosing

public void internalFrameClosing(javax.swing.event.InternalFrameEvent e)
Specified by:
internalFrameClosing in interface javax.swing.event.InternalFrameListener

internalFrameDeactivated

public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent e)
Specified by:
internalFrameDeactivated in interface javax.swing.event.InternalFrameListener

internalFrameDeiconified

public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent e)
Specified by:
internalFrameDeiconified in interface javax.swing.event.InternalFrameListener

internalFrameIconified

public void internalFrameIconified(javax.swing.event.InternalFrameEvent e)
Specified by:
internalFrameIconified in interface javax.swing.event.InternalFrameListener

internalFrameOpened

public void internalFrameOpened(javax.swing.event.InternalFrameEvent e)
Specified by:
internalFrameOpened in interface javax.swing.event.InternalFrameListener