ucar.unidata.idv.ui
Class IdvWindow

java.lang.Object
  extended by ucar.unidata.ui.MultiFrame
      extended by ucar.unidata.idv.ui.IdvWindow

public class IdvWindow
extends MultiFrame

The window class used for the IDV. Really need to break this out into a window manager. This listens for window close operations and manages the bottom message bar/memory monitor/spinning wait icon.

Author:
IDV development team

Field Summary
static String GROUP_CHOOSERS
          The chooser components in this window
static String GROUP_TOOLBARS
          The toolbar components in this window
 
Constructor Summary
IdvWindow(String title, IntegratedDataViewer theIdv)
          Create the window
IdvWindow(String title, IntegratedDataViewer theIdv, boolean isAMainWindow)
          Create the window
 
Method Summary
 void addToGroup(Object groupKey, Object comp)
          An IdvWindow can hold a group of objects, identified by the groupKey.
 void addViewManager(ViewManager viewManager)
          _more_
 void destroy()
          Destroy this window.
 void dispose()
          Dispose of this window.
protected  boolean doClose()
          Close this window.
 void endWait()
          Stop spinning
static IdvWindow findWindow(Component contents)
          Find the IdvWindow that contains the window contents
static IdvWindow getActiveWindow()
          Get the current active window
 Object getComponent(String componentName)
          The IdvWindow can hold a number of named components.
 List getComponentGroups()
           
 List getComponents()
          Get the list of components held by the xmlui
 JComponent getContents()
          Get the contents
 List getGroup(Object groupKey)
          Get the list of objects that are in the group.
 boolean getIsAMainWindow()
          Get the IsAMainWindow property.
static List getMainWindows()
          Return the list of main windows currently in use.
 JLabel getMsgLabel()
          Get the JLabel message label.
static ImageIcon getNormalIcon()
          Get the icon used to show normal state
 Object getPersistentComponent(Object key)
          _more_
 Hashtable getPersistentComponents()
          Get the PersistentComponents property.
 String getSkinPath()
          Get the path to the xml skin.
 String getType()
          Get the Type property.
 String getUniqueId()
          Get the UniqueId property.
 List getViewManagers()
          Get the ViewManagers property.
static ImageIcon getWaitIcon()
          Get the icon used to show wait state (the spinning globe)
 JLabel getWaitLabel()
          Get the label that we spin
static ImageIcon getWaitOverIcon()
          Get the icon used when mousing over the label in wait state (the beer bottles)
static boolean getWaitState()
          Get the global wait state
static List getWindows()
          Get all of the current windows.
 IdvXmlUi getXmlUI()
          Get the xmlui object that created the gui in this window.
 boolean hasViewManagers()
          Does this window contain any view managers
 void putPersistentComponent(Object key, Object object)
          _more_
 void setComponent(String componentName, Object component)
          The IdvWindow can hold a number of named components.
 void setContents(JComponent contents)
          Set the contents.
 void setIsAMainWindow(boolean value)
          Set the IsAMainWindow property.
static ImageIcon setNormalIcon(String path)
          Get the icon used to show normal state
 void setPersistentComponents(Hashtable value)
          Set the PersistenceComponents property.
 void setSkinPath(String b)
          Set the path to the xml skin.
 void setTheViewManagers(List value)
          Set the ViewManagers property.
 void setType(String value)
          Set the Type property.
 void setUniqueId(String value)
          Set the UniqueId property.
 void setWaitIcon(Icon icon)
          Set the icon for the wait label.
static ImageIcon setWaitIcon(String path)
          Get the icon used to show wait state (the spinning globe)
static ImageIcon setWaitOverIcon(String path)
          Get the icon used when mousing over the label in wait state (the beer bottles)
static void setWaitState(boolean waiting)
          Set the global waitState flag
 void setWindowBounds(Rectangle r)
          set the bounds of the window
 void setXmlUI(IdvXmlUi xmlUI)
          Set the xmlui skin object
 void show()
          Show the window if its ok.
 void showNormalCursor()
          Show the normal cursor
 void showWaitCursor()
          Show the wait cursor
 void startWait()
          Start spinning
 String toString()
          Override toString
 
Methods inherited from class ucar.unidata.ui.MultiFrame
addWindowListener, getBounds, getComponent, getContainer, getContentPane, getFrame, getInternalFrame, getLocation, getSize, getState, getTitle, getWindow, isShowing, isVisible, pack, removeWindowListener, setBounds, setCursor, setDefaultCloseOperation, setIconImage, setJMenuBar, setLocation, setSize, setState, setTitle, setVisible, toFront, useDesktopPane
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

GROUP_CHOOSERS

public static final String GROUP_CHOOSERS
The chooser components in this window

See Also:
Constant Field Values

GROUP_TOOLBARS

public static final String GROUP_TOOLBARS
The toolbar components in this window

See Also:
Constant Field Values
Constructor Detail

IdvWindow

public IdvWindow(String title,
                 IntegratedDataViewer theIdv)
Create the window

Parameters:
title - The window title
theIdv - The IDV

IdvWindow

public IdvWindow(String title,
                 IntegratedDataViewer theIdv,
                 boolean isAMainWindow)
Create the window

Parameters:
title - The window title
theIdv - The IDV
isAMainWindow - Is this a main window
Method Detail

getActiveWindow

public static IdvWindow getActiveWindow()
Get the current active window

Returns:
active window

setWaitState

public static void setWaitState(boolean waiting)
Set the global waitState flag

Parameters:
waiting - waiting value

getWaitState

public static boolean getWaitState()
Get the global wait state

Returns:
waiting value

getContents

public JComponent getContents()
Get the contents

Returns:
window contents

setContents

public void setContents(JComponent contents)
Set the contents. Add the contents into the content pane and pack.

Parameters:
contents - window contents

setWindowBounds

public void setWindowBounds(Rectangle r)
set the bounds of the window

Parameters:
r - window bounds

findWindow

public static IdvWindow findWindow(Component contents)
Find the IdvWindow that contains the window contents

Parameters:
contents - Contents to look for
Returns:
The IdvWindow that holds the contents

setXmlUI

public void setXmlUI(IdvXmlUi xmlUI)
Set the xmlui skin object

Parameters:
xmlUI - The xmlui skin object

getXmlUI

public IdvXmlUi getXmlUI()
Get the xmlui object that created the gui in this window. May be null.

Returns:
The xmlui.

getSkinPath

public String getSkinPath()
Get the path to the xml skin.

Returns:
The xml skin.

setSkinPath

public void setSkinPath(String b)
Set the path to the xml skin.

Parameters:
b - The skin path

toString

public String toString()
Override toString

Overrides:
toString in class Object
Returns:
The string

getWaitIcon

public static ImageIcon getWaitIcon()
Get the icon used to show wait state (the spinning globe)

Returns:
The wait icon.

setWaitIcon

public static ImageIcon setWaitIcon(String path)
Get the icon used to show wait state (the spinning globe)

Parameters:
path - Set the wait icon to use
Returns:
The wait icon.

show

public void show()
Show the window if its ok.

Overrides:
show in class MultiFrame

getNormalIcon

public static ImageIcon getNormalIcon()
Get the icon used to show normal state

Returns:
The normal icon.

setNormalIcon

public static ImageIcon setNormalIcon(String path)
Get the icon used to show normal state

Parameters:
path - The path to the normal icon to use
Returns:
The normal icon.

getWaitOverIcon

public static ImageIcon getWaitOverIcon()
Get the icon used when mousing over the label in wait state (the beer bottles)

Returns:
The mouse over wait icon.

setWaitOverIcon

public static ImageIcon setWaitOverIcon(String path)
Get the icon used when mousing over the label in wait state (the beer bottles)

Parameters:
path - The path to the wait over icon to use
Returns:
The mouse over wait icon.

getMsgLabel

public JLabel getMsgLabel()
Get the JLabel message label.

Returns:
The JLabel for messages

startWait

public void startWait()
Start spinning


endWait

public void endWait()
Stop spinning


setWaitIcon

public void setWaitIcon(Icon icon)
Set the icon for the wait label.

Parameters:
icon - The wait icon.

getWaitLabel

public JLabel getWaitLabel()
Get the label that we spin

Returns:
The wait label

doClose

protected boolean doClose()
Close this window. If it is the last main window then ask to exit

Returns:
Was closed

dispose

public void dispose()
Dispose of this window.

Overrides:
dispose in class MultiFrame

destroy

public void destroy()
Destroy this window. This just empties out the contents.


getMainWindows

public static List getMainWindows()
Return the list of main windows currently in use.

Returns:
List of main windows

setComponent

public void setComponent(String componentName,
                         Object component)
The IdvWindow can hold a number of named components. e.g., This could be a toolbar, etc.

Parameters:
componentName - The name or id
component - The component

putPersistentComponent

public void putPersistentComponent(Object key,
                                   Object object)
_more_

Parameters:
key - _more_
object - _more_

getPersistentComponent

public Object getPersistentComponent(Object key)
_more_

Parameters:
key - _more_
Returns:
_more_

getComponentGroups

public List getComponentGroups()

addToGroup

public void addToGroup(Object groupKey,
                       Object comp)
An IdvWindow can hold a group of objects, identified by the groupKey. We use this to store the choosers that are in an window

Parameters:
groupKey - The group key. Usually a String name
comp - The object (ususally a Component) to add to the group

getGroup

public List getGroup(Object groupKey)
Get the list of objects that are in the group. If none found return null

Parameters:
groupKey - The group key
Returns:
List of objects in group or null

getComponents

public List getComponents()
Get the list of components held by the xmlui

Returns:
components

getComponent

public Object getComponent(String componentName)
The IdvWindow can hold a number of named components. e.g., This could be a toolbar, etc.

Parameters:
componentName - The name or id
Returns:
The component

getWindows

public static List getWindows()
Get all of the current windows.

Returns:
List of IdvWindow objects

hasViewManagers

public boolean hasViewManagers()
Does this window contain any view managers

Returns:
Contains view managers

setTheViewManagers

public void setTheViewManagers(List value)
Set the ViewManagers property.

Parameters:
value - The new value for ViewManagers

addViewManager

public void addViewManager(ViewManager viewManager)
_more_

Parameters:
viewManager - _more_

getViewManagers

public List getViewManagers()
Get the ViewManagers property.

Returns:
The ViewManagers

setUniqueId

public void setUniqueId(String value)
Set the UniqueId property.

Parameters:
value - The new value for UniqueId

getUniqueId

public String getUniqueId()
Get the UniqueId property.

Returns:
The UniqueId

setIsAMainWindow

public void setIsAMainWindow(boolean value)
Set the IsAMainWindow property.

Parameters:
value - The new value for IsAMainWindow

getIsAMainWindow

public boolean getIsAMainWindow()
Get the IsAMainWindow property.

Returns:
The IsAMainWindow

showWaitCursor

public void showWaitCursor()
Show the wait cursor


showNormalCursor

public void showNormalCursor()
Show the normal cursor


setType

public void setType(String value)
Set the Type property.

Parameters:
value - The new value for Type

getType

public String getType()
Get the Type property.

Returns:
The Type

setPersistentComponents

public void setPersistentComponents(Hashtable value)
Set the PersistenceComponents property.

Parameters:
value - The new value for PersistenceComponents

getPersistentComponents

public Hashtable getPersistentComponents()
Get the PersistentComponents property.

Returns:
The PersistentComponents