Venice 0.751beta

nz.org.venice.ui
Class DesktopManager

java.lang.Object
  extended byjavax.swing.DefaultDesktopManager
      extended bynz.org.venice.ui.DesktopManager
All Implemented Interfaces:
javax.swing.DesktopManager, java.io.Serializable

public class DesktopManager
extends javax.swing.DefaultDesktopManager
implements java.io.Serializable

This class manages activities to do with internal frames on the desktop

See Also:
Serialized Form

Field Summary
static int ARRANGE
          Arrange windows in a grid.
static int CASCADE
          Cascade windows, resizing based on desktop size
static int HORIZONTAL
          Tile windows horizontally
static int VERTICAL
          Tile windows vertically
 
Constructor Summary
DesktopManager(javax.swing.JDesktopPane desktop)
          Create a new Venice desktop manager to manage the given desktop.
 
Method Summary
 void activateFrame(javax.swing.JInternalFrame frame)
           
 void addModuleListener(ModuleListener moduleListener)
          Add a listener to list for module events.
static void closeAllWindows()
          Closes all open windows.
 void fireModuleRemoved(Module module)
          Inform all the module listeners that this module has been removed.
 void fireModuleRenamed(Module module)
          Inform all the module listneres that this module has been renamed.
static javax.swing.JDesktopPane getDesktop()
          Get the desktop we are managing.
static boolean isDisplayingMessage()
          Return whether we are currently displaying any warning or error messages.
static void minimizeWindows()
          Minimises all windows that are iconifiable.
 ModuleFrame newFrame(Module module)
          Display a new frame upon the current desktop.
 ModuleFrame newFrame(Module module, boolean centre, boolean honourSize, boolean resizable)
          Display a new frame upon the current desktop
 void removeModuleListener(ModuleListener moduleListener)
          Remove a listener of module events.
static void restoreAll()
          Restores all minimised windows.
 void save()
          Call save() on every open module.
static void setDesktop(javax.swing.JDesktopPane desktop)
          Set the desktop we are managing.
static void showErrorMessage(java.lang.String message)
          Show a simple error message to the user.
static void showErrorMessage(java.lang.String title, java.lang.String message)
          Show a simple error message to the user.
static void showWarningMessage(java.lang.String message)
          Show a simple warning message to the user.
static void tileFrames(int style)
          Tiles all the windows in the desktop according to the given style.
 
Methods inherited from class javax.swing.DefaultDesktopManager
beginDraggingFrame, beginResizingFrame, closeFrame, deactivateFrame, deiconifyFrame, dragFrame, endDraggingFrame, endResizingFrame, getBoundsForIconOf, getPreviousBounds, iconifyFrame, maximizeFrame, minimizeFrame, openFrame, removeIconFor, resizeFrame, setBoundsForFrame, setPreviousBounds, setWasIcon, wasIcon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HORIZONTAL

public static final int HORIZONTAL
Tile windows horizontally

See Also:
Constant Field Values

VERTICAL

public static final int VERTICAL
Tile windows vertically

See Also:
Constant Field Values

CASCADE

public static final int CASCADE
Cascade windows, resizing based on desktop size

See Also:
Constant Field Values

ARRANGE

public static final int ARRANGE
Arrange windows in a grid.

See Also:
Constant Field Values
Constructor Detail

DesktopManager

public DesktopManager(javax.swing.JDesktopPane desktop)
Create a new Venice desktop manager to manage the given desktop.

Parameters:
desktop - the desktop to manage.
Method Detail

setDesktop

public static void setDesktop(javax.swing.JDesktopPane desktop)
Set the desktop we are managing.

Parameters:
desktop - the desktop to manage.

getDesktop

public static javax.swing.JDesktopPane getDesktop()
Get the desktop we are managing.

Returns:
the desktop we are managing.

addModuleListener

public void addModuleListener(ModuleListener moduleListener)
Add a listener to list for module events.

Parameters:
moduleListener - the object to be informed about module events.

removeModuleListener

public void removeModuleListener(ModuleListener moduleListener)
Remove a listener of module events.

Parameters:
moduleListener - the object to no longer be informed about module events.

fireModuleRemoved

public void fireModuleRemoved(Module module)
Inform all the module listeners that this module has been removed.

Parameters:
module - that has been removed.

fireModuleRenamed

public void fireModuleRenamed(Module module)
Inform all the module listneres that this module has been renamed.

Parameters:
module - that has been renamed.

showWarningMessage

public static void showWarningMessage(java.lang.String message)
Show a simple warning message to the user. Unlike the show error message dialog, this will not cancel the current thread. Use this if the operation is not totally unsuccessful.

Parameters:
message - the warning message to display

showErrorMessage

public static void showErrorMessage(java.lang.String message)
Show a simple error message to the user. This will also cancel the current thread if the progress dialog is up.

Parameters:
message - the error message to display

showErrorMessage

public static void showErrorMessage(java.lang.String title,
                                    java.lang.String message)
Show a simple error message to the user. This will also cancel the current thread if the progress dialog is up.

Parameters:
title - the title of the dialog to display
message - the error message to display

isDisplayingMessage

public static boolean isDisplayingMessage()
Return whether we are currently displaying any warning or error messages.

Returns:
true if we are displaying a message, false otherwise.

tileFrames

public static void tileFrames(int style)
Tiles all the windows in the desktop according to the given style.

Parameters:
style - one of HORIZONTAL, VERTICAL, CASCADE or ARRANGE

minimizeWindows

public static void minimizeWindows()
Minimises all windows that are iconifiable.


restoreAll

public static void restoreAll()
Restores all minimised windows.


closeAllWindows

public static void closeAllWindows()
Closes all open windows.


newFrame

public ModuleFrame newFrame(Module module)
Display a new frame upon the current desktop. Frame will be displayed at (0,0) and not centred.

Parameters:
module - the module to render in the frame
Returns:
module frame

newFrame

public ModuleFrame newFrame(Module module,
                            boolean centre,
                            boolean honourSize,
                            boolean resizable)
Display a new frame upon the current desktop

Parameters:
module - the module to render in the frame
centre - should the frame be centred?
honourSize - should we honour the frame's preferred size?
resizable - is the frame allowed to be resized?
Returns:
module frame

activateFrame

public void activateFrame(javax.swing.JInternalFrame frame)
Specified by:
activateFrame in interface javax.swing.DesktopManager

save

public void save()
Call save() on every open module. This will save all the modules' preferences data.


Venice 0.751beta