Class VMManager

All Implemented Interfaces:
ActionListener, EventListener, IdvConstants

public class VMManager extends IdvManager
This class manages the set of ViewManagers. It handles initializing them after unpersistence, managing the set of view manager states (this is where you can save off the state of a view manager and then reapply it. So you can save projection, map, etc., name it and use it later.)
Author:
IDV development team
  • Constructor Details

    • VMManager

      public VMManager(IntegratedDataViewer idv)
      Construct this manager with the given idv.
      Parameters:
      idv - The IDV
  • Method Details

    • getViewManagers

      public List<ViewManager> getViewManagers()
      Get the list of active ViewManagers
      Returns:
      List of view managers.
    • getViewManagers

      public List getViewManagers(Class c)
      Get all of the view managers of the given class
      Parameters:
      c - ViewManager class
      Returns:
      List of ViewManagers
    • captureAll

      public void captureAll()
      Capture an image for all ViewManagers
    • applyPreferences

      public void applyPreferences()
      Apply the user preferences to all ViewManagers
    • setLastActiveViewManager

      public void setLastActiveViewManager(ViewManager viewManager)
      Set the ViewManager whose window was last active.
      Parameters:
      viewManager - The last active view manager
    • haveMoreThanOneMainViewManager

      public boolean haveMoreThanOneMainViewManager()
      Is there currently more than one possibly active viewmanager
      Returns:
      More than one active view managers
    • getLastActiveViewManager

      public ViewManager getLastActiveViewManager()
      Get the ViewManager whose window was last active.
      Returns:
      The last active view manager
    • findViewManager

      public ViewManager findViewManager(ViewDescriptor viewDescriptor)
      Find the view manager identified by the given view descriptor
      Parameters:
      viewDescriptor - The id of the VM
      Returns:
      The VM or null if none found
    • findViewManagerInList

      public static ViewManager findViewManagerInList(ViewDescriptor viewDescriptor, List vms)
      Find the view manager in the given list that is defined by the given view descriptor.
      Parameters:
      viewDescriptor - The view descriptor
      vms - List of ViewManagers
      Returns:
      The view manager or null if none found
    • transectViewsChanged

      public void transectViewsChanged()
      Be notified that a transect view manager has changed. This may be from a zoom, etc. Notify any TransectDrawingControls.
    • findTransectDrawingControls

      public List findTransectDrawingControls()
      Find a TDC
      Returns:
      The TDC
    • updateAllLegends

      public void updateAllLegends()
      _more_
    • writeVMState

      public void writeVMState()
      Write the viewpoints list
    • getVMState

      public List getVMState()
      Instantiates (if needed) and returns the list of TwoFacedObjects that is the set of saved viewpoints
      Returns:
      List that holds the viewpoints
    • saveViewManagerState

      protected void saveViewManagerState(ViewManager vm)
      Popup a dialog asking the user for the name of the saved ViewManager. If provided, add a new TwoFacedObject to the list of saved ViewManagers and write the list to disk.
      Parameters:
      vm - The view manager to save
    • addViewManager

      public void addViewManager(ViewManager newViewManager)
      Add the new view manager into the list if we don't have one with the ViewDescriptor of the new view manager already.
      Parameters:
      newViewManager - The new view manager
    • addViewManagers

      public void addViewManagers(List newVms)
      Add the view managers in the list
      Parameters:
      newVms - New view managers
    • removeAllViewManagers

      public void removeAllViewManagers()
      Remove all view managers
    • removeAllViewManagers

      public void removeAllViewManagers(boolean andDestroyThem)
      Remove all view managers
      Parameters:
      andDestroyThem - If true then also call destroy
    • removeViewManager

      public void removeViewManager(ViewManager viewManager)
      Remove the given view manager from the list.
      Parameters:
      viewManager - The view manager to be removed.
    • showProjectionManager

      public void showProjectionManager()
      Find the first ViewManager in the list and have it show its @[link ucar.unidata.view.geoloc.ProjectionManager}.
    • unpersistViewManagers

      public void unpersistViewManagers(List newViewManagers)
      Do the initialization of the unpersisted ViewManager.
      Parameters:
      newViewManagers - List of view managers to unpersist
    • setDisplayMastersActive

      public void setDisplayMastersActive()
      Iterate through all of the ViewManager-s and tell each on to setMasterActive
    • setDisplayMastersInactive

      public void setDisplayMastersInactive()
      Iterate through all of the ViewManager-s and tell each on to setMasterInactive
    • findOrCreateViewManager

      public ViewManager findOrCreateViewManager(ViewDescriptor viewDescriptor, String properties)
      As the name implies find the view manager identified by the given viewDescriptor or create a new one.
      Parameters:
      viewDescriptor - The id to look for
      properties - Properties to pass if we create one.
      Returns:
      The found or created ViewManager
    • createViewManager

      public ViewManager createViewManager(ViewDescriptor viewDescriptor, String properties)
      Create the given ViewManager
      Parameters:
      viewDescriptor - Identifies the VM
      properties - Property string to pass
      Returns:
      The new one
    • center

      public void center(EarthLocation el) throws VisADException, RemoteException
      Center all of the MapViewManager-s at the given point
      Parameters:
      el - The point
      Throws:
      RemoteException - On badness
      VisADException - On badness
    • center

      public void center(EarthLocation el, List viewManagers) throws VisADException, RemoteException
      Center the view managers in the list to the given point
      Parameters:
      el - Point to center to
      viewManagers - ViewManagers to center
      Throws:
      RemoteException - On badness
      VisADException - On badness
    • center

      public void center(MapProjection mp) throws VisADException, RemoteException
      Center all of the MapViewManager-s at the given point
      Parameters:
      mp - Set all view managers projection to the
      Throws:
      RemoteException - On badness
      VisADException - On badness
    • center

      public void center(MapProjection mp, List viewManagers) throws VisADException, RemoteException
      Center all of the MapViewManager-s at the given point
      Parameters:
      mp - new projection
      viewManagers - ViewManagers to center
      Throws:
      RemoteException - On badness
      VisADException - On badness
    • center

      public void center(ucar.unidata.geoloc.ProjectionRect pr) throws VisADException, RemoteException
      Zoom and center all of the MapViewManager-s at the given rect
      Parameters:
      pr - The projection rect to zoom and center to
      Throws:
      RemoteException - On badness
      VisADException - On badness
    • center

      public void center(ucar.unidata.geoloc.ProjectionRect pr, List viewManagers) throws VisADException, RemoteException
      Zoom and center all of the MapViewManager-s at the given rect
      Parameters:
      pr - The projection rect to zoom and center to
      viewManagers - ViewManagers to center
      Throws:
      RemoteException - On badness
      VisADException - On badness
    • center

      public void center() throws VisADException, RemoteException
      Set the projection on all MapViewManagers to be the projection of the first display.
      Throws:
      RemoteException - On badness
      VisADException - On badness
    • center

      public void center(List viewManagers) throws VisADException, RemoteException
      Set the projection on all MapViewManagers to be the projection of the first display.
      Parameters:
      viewManagers - ViewManagers to center
      Throws:
      RemoteException - On badness
      VisADException - On badness
    • setTransect

      public void setTransect(Transect transect)
      Set the Transect used for all TransectViewManagers
      Parameters:
      transect - The transect