Class IdvWindow

java.lang.Object
ucar.unidata.ui.MultiFrame
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 Details

  • Constructor Details

    • 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 Details

    • 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
    • getHasBeenDisposed

      public boolean getHasBeenDisposed()
      _more_
      Returns:
      _more_
    • 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
    • addRemovable

      public void addRemovable(Removable removable)
      _more_
      Parameters:
      removable - _more_
    • 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<IdvComponentGroup> getComponentGroups()
      _more_
      Returns:
      _more_
    • 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
    • enableFullScreenMode

      public static void enableFullScreenMode(Window window)
      Enable full screen mode in the context of mac osx (>=10.7) Special thanks to http://saipullabhotla.blogspot.com/2012/05/enabling-full-screen-mode-for-java.html
      Parameters:
      window - The window to which you wish to add the full screen option