project35.desktopDeployment
Class WindowRegistry

java.lang.Object
  extended by project35.desktopDeployment.WindowRegistry

public class WindowRegistry
extends java.lang.Object

Keeps track of which files are currently open. WindowRegistry keeps track of window name - dialog associations, and helps determine the name of new windows that haven't been populated with a file.


Copyright (c) 2008 Kevin Garwood for Project35. The original code was developed by Kevin Garwood for the University of Manchester. Revisions have been made for Project35, a project that is independent of that institution. This code is licensed under the Academic Free License version 3.0. The code attribution for the original code is included here:

Copyright (c) Kevin Garwood and University of Manchester 2007. All rights reserved. Licensed under the Academic Free License version 3.0. For more information on the terms and conditions, please see the file "LICENSE" that is included in this distribution.


Version:
1.0
Author:
Kevin Garwood (kgarwood@users.sourceforge.net)

Constructor Summary
WindowRegistry()
           
 
Method Summary
 void activateWindow(java.lang.String windowName)
          make target window the active window, bringing it to the front of a stack of windows.
 void deregisterWindow(Project35Dialog dialog)
          removes dialog from the active list of windows; used when a file is closed
 java.util.ArrayList getActiveWindows()
           
 Project35Dialog getWindowForFile(java.io.File file)
           
 boolean isFirstWindow()
           
 void registerWindowWithExistingFile(Project35Dialog dialog)
           
 void registerWindowWithNewFile(Project35Dialog dialog)
          creates a name of the format: "Untitled + n" where n is the nth dialog created during the session.
 void setFirstWindow(boolean isFirstWindow)
           
 void updateWindow(Project35Dialog dialog)
          used to update the window menus in files when the name of the file in the target dialog changes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WindowRegistry

public WindowRegistry()
Method Detail

activateWindow

public void activateWindow(java.lang.String windowName)
make target window the active window, bringing it to the front of a stack of windows.

Parameters:
windowName - identifier for an open Project35Dialog window

deregisterWindow

public void deregisterWindow(Project35Dialog dialog)
removes dialog from the active list of windows; used when a file is closed

Parameters:
dialog - the dialog to be deregistered

registerWindowWithExistingFile

public void registerWindowWithExistingFile(Project35Dialog dialog)

setFirstWindow

public void setFirstWindow(boolean isFirstWindow)
Parameters:
isFirstWindow - true if the first window has been created

registerWindowWithNewFile

public void registerWindowWithNewFile(Project35Dialog dialog)
creates a name of the format: "Untitled + n" where n is the nth dialog created during the session. All other open windows are updated to reflect the creation of the new dialog showing the file


updateWindow

public void updateWindow(Project35Dialog dialog)
used to update the window menus in files when the name of the file in the target dialog changes

Parameters:
dialog - the target dialog

getActiveWindows

public java.util.ArrayList getActiveWindows()
Returns:
the list of active windows

getWindowForFile

public Project35Dialog getWindowForFile(java.io.File file)
Parameters:
file - the data file viewed in some dialog
Returns:
the window associated with a file; null if the file has no association with any open window.

isFirstWindow

public boolean isFirstWindow()
Returns:
true if the registry has created the first window yet