org.jcreme.swing.workspace
Class FrameWorkspace

java.lang.Object
  extended byorg.jcreme.swing.workspace.BaseWorkspace
      extended byorg.jcreme.swing.workspace.FrameWorkspace
All Implemented Interfaces:
Workspace

public class FrameWorkspace
extends BaseWorkspace

This class enables to handle workspaces made of Frame objects. The composition of a workspace can be freely modified as Frames can be added and removed. Subclasses may provide a different FrameMemento factory method or they can restrict the modifications of the workspace by overloading the addFrame and removeFrame methods.

Version:
$Revision: 1.3 $
Author:
$Author: dbregeon $

Constructor Summary
protected FrameWorkspace(java.lang.Object o)
          Creates new Workspace
 
Method Summary
 void addFrame(FrameMemento view)
          This method adds a Frame to be handled as part of the workspace.
 void display()
          This method makes a Workspace to display itself.
protected  FrameMemento getFrameMemento(java.awt.Frame frame)
          Provides access to the Memento of a specific Frame.
 FrameMemento[] getFrameMementos()
          This method gives access to the FrameMementos that store the Frames in the Workspace.
 void hide()
          This method makes a Workspace to hide itself.
 void removeFrame(FrameMemento view)
          This method enables to remove a Frame from the Workspace.
protected  void showView(java.awt.Frame view, boolean enable)
          This method shows or hide a Frame.
 
Methods inherited from class org.jcreme.swing.workspace.BaseWorkspace
getIdentifier
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FrameWorkspace

protected FrameWorkspace(java.lang.Object o)
                  throws java.lang.IllegalArgumentException
Creates new Workspace

Parameters:
o - the workspace identifier.
Throws:
java.lang.IllegalArgumentException - when o is null.
Method Detail

addFrame

public void addFrame(FrameMemento view)
              throws java.lang.IllegalArgumentException
This method adds a Frame to be handled as part of the workspace.

Parameters:
view - the new FrameMemento that stores the Frame to add.
Throws:
java.lang.IllegalArgumentException - if this Workspace is not able to handle the view.

removeFrame

public void removeFrame(FrameMemento view)
                 throws java.lang.IllegalArgumentException
This method enables to remove a Frame from the Workspace.

Parameters:
view - the FrameMemento that stores the Frame to be removed from the Workspace.
Throws:
java.lang.IllegalArgumentException - if the Frame cannot be removed from the Workspace.

showView

protected void showView(java.awt.Frame view,
                        boolean enable)
This method shows or hide a Frame. When hidden, its previous state is saved to a FrameMemento. When shown, its previous state is restored from a FrameMemento.

Parameters:
view - the Frame to show or hide.
enable - true if the view is to be displayed, false otherwise.

display

public void display()
This method makes a Workspace to display itself.


hide

public void hide()
This method makes a Workspace to hide itself.


getFrameMementos

public FrameMemento[] getFrameMementos()
This method gives access to the FrameMementos that store the Frames in the Workspace.

Returns:
the FrameMementos used in the Workspace.

getFrameMemento

protected FrameMemento getFrameMemento(java.awt.Frame frame)
Provides access to the Memento of a specific Frame.

Parameters:
frame - the Frame for which we want the Memento.
Returns:
the Memento associated to the Frame or null if this Frame is not in this Workspace.


Copyright 2006 null. All Rights Reserved.