Class MapDisplayControl

All Implemented Interfaces:
ActionListener, ItemListener, PropertyChangeListener, EventListener, HyperlinkListener, Sharable, DataChangeListener, DisplayControl, Prototypable, ControlListener, DisplayListener

public class MapDisplayControl extends DisplayControlImpl
A control for displaying map lines.
Version:
$Revision: 1.95 $
Author:
IDV Development Team
  • Field Details

    • DEFAULT_MAP_COLOR

      public static final Color DEFAULT_MAP_COLOR
      default map color
  • Constructor Details

    • MapDisplayControl

      public MapDisplayControl()
      Default Constructor.
    • MapDisplayControl

      public MapDisplayControl(MapViewManager mapViewManager, MapInfo mapInfo)
      Special constructor for creating a map display for a particular MapViewManager
      Parameters:
      mapViewManager - The map view manager this map display is the default map for
      mapInfo - Holds the map info
    • MapDisplayControl

      public MapDisplayControl(MapData mapData)
      Special constructor for creating a map display for a particular MapData
      Parameters:
      mapData - The mapData may be null. If null, then the user is prompted to choose a map.
  • Method Details

    • xxxshouldAddControlListener

      protected boolean xxxshouldAddControlListener()
      Should we add a control listener
      Returns:
      true if we should
    • xxxviewpointChanged

      public void xxxviewpointChanged()
      Handle the viewpoint changed
    • getLegendLabels

      public void getLegendLabels(List labels, int legendType)
      Append any label information to the list of labels.
      Overrides:
      getLegendLabels in class DisplayControlImpl
      Parameters:
      labels - in/out list of labels
      legendType - The type of legend, BOTTOM_LEGEND or SIDE_LEGEND
    • loadNewMap

      public void loadNewMap(MapDisplayControl newMap)
      Clear the current state and copy the state held by the given newMap
      Parameters:
      newMap - The map display we copy from
    • init

      public boolean init(DataChoice dataChoice) throws VisADException, RemoteException
      Called to make this kind of Display Control; also calls code to made its Displayable.
      Overrides:
      init in class DisplayControlImpl
      Parameters:
      dataChoice - the DataChoice of the moment - not used yet; can be null.
      Returns:
      true if successful
      Throws:
      RemoteException - Java RMI error
      VisADException - VisAD Error
    • merge

      public void merge(MapDisplayControl that)
      Merge the maps contained by that into this
      Parameters:
      that - The other display control to merge its maps
    • setDisplayVisibility

      public void setDisplayVisibility(boolean on)
      Overwrite base class method so we can apply the visibility changes to the maps.
      Specified by:
      setDisplayVisibility in interface DisplayControl
      Overrides:
      setDisplayVisibility in class DisplayControlImpl
      Parameters:
      on - Is visible
    • setVisible

      public void setVisible(boolean visible)
      set the visible of the given MapStates
      Parameters:
      visible -
    • getViewMenuItems

      protected void getViewMenuItems(List items, boolean forMenuBar)
      Add the relevant view menu items into the list
      Overrides:
      getViewMenuItems in class DisplayControlImpl
      Parameters:
      items - List of menu items
      forMenuBar - Is this for the menu in the window's menu bar or for a popup menu in the legend
    • getEditMenuItems

      protected void getEditMenuItems(List items, boolean forMenuBar)
      Add the relevant edit menu items into the list
      Overrides:
      getEditMenuItems in class DisplayControlImpl
      Parameters:
      items - List of menu items
      forMenuBar - Is this for the menu in the window's menu bar or for a popup menu in the legend
    • getFileMenuItems

      protected void getFileMenuItems(List items, boolean forMenuBar)
      Add the relevant file menu items into the list
      Overrides:
      getFileMenuItems in class DisplayControlImpl
      Parameters:
      items - List of menu items
      forMenuBar - Is this for the menu in the window's menu bar or for a popup menu in the legend
    • getSaveMenuItems

      protected void getSaveMenuItems(List items, boolean forMenuBar)
      Add the relevant File->Save menu items into the list
      Overrides:
      getSaveMenuItems in class DisplayControlImpl
      Parameters:
      items - List of menu items
      forMenuBar - Is this for the menu in the window's menu bar or for a popup menu in the legend
    • selectMap

      protected boolean selectMap()
      Ask the user to choose a map file and try to add it.
      Returns:
      true if a map was selected and added
    • saveToPlugin

      public void saveToPlugin()
      Turn the map state held by this object into xml and write it out as the user's map preference.
    • doMakeContents

      public Container doMakeContents()
      Make the UI contents for this control.
      Overrides:
      doMakeContents in class DisplayControlImpl
      Returns:
      UI container
    • projectionChanged

      public void projectionChanged()
      Method to call if projection changes. Override superclass method to set vertical position ConstantMaps for new projection.
      Specified by:
      projectionChanged in interface DisplayControl
      Overrides:
      projectionChanged in class DisplayControlImpl
    • setInitialMap

      public void setInitialMap(String value)
      Set the InitialMap property. This is the property that is set from the controls.xml file that defines the initial, default map to use.
      Parameters:
      value - The new value for InitialMap
    • getInitialMap

      public String getInitialMap()
      Get the InitialMap property.
      Returns:
      The InitialMap
    • setInitialMapDescription

      public void setInitialMapDescription(String value)
      Set the InitialMapDescription property. This is the property that is set from the controls.xml file that defines the initial, default map to use.
      Parameters:
      value - The new value for InitialMapDescription
    • getInitialMapDescription

      public String getInitialMapDescription()
      Get the InitialMapDescription property.
      Returns:
      The InitialMapDescription
    • shouldApplyFastRendering

      protected boolean shouldApplyFastRendering()
      This method can be overwritten by the derived classes that do not want the general application of the fast rendering flag.
      Overrides:
      shouldApplyFastRendering in class DisplayControlImpl
      Returns:
      Don't use fast rendering
    • getDefaultFastRendering

      protected boolean getDefaultFastRendering()
      What is the default fast rendering value
      Overrides:
      getDefaultFastRendering in class DisplayControlImpl
      Returns:
      false
    • setMapStates

      public void setMapStates(List value)
      Set the MapStates property.
      Parameters:
      value - The new value for MapStates
    • getMapStates

      public List getMapStates()
      Get the MapStates property.
      Returns:
      The MapStates
    • getLatState

      public MapDisplayControl.LatLonState getLatState()
      Get the object that holds the latitude state
      Returns:
      The latitude state
    • setLatState

      public void setLatState(MapDisplayControl.LatLonState value)
      Set the object that holds the latitude state
      Parameters:
      value - The new latitude state
    • getLonState

      public MapDisplayControl.LatLonState getLonState()
      Get the object that holds the longitude state
      Returns:
      The long. state
    • setLonState

      public void setLonState(MapDisplayControl.LatLonState value)
      Set the object that holds the longitude state
      Parameters:
      value - The new long. state
    • getLatLabelState

      public MapDisplayControl.LatLonLabelState getLatLabelState()
      Get the object that holds the latitude label state
      Returns:
      The latitude label state
    • setLatLabelState

      public void setLatLabelState(MapDisplayControl.LatLonLabelState value)
      Set the object that holds the latitude label state
      Parameters:
      value - The new latitude label state
    • getLonLabelState

      public MapDisplayControl.LatLonLabelState getLonLabelState()
      Get the object that holds the longitude label state
      Returns:
      The long. label state
    • setLonLabelState

      public void setLonLabelState(MapDisplayControl.LatLonLabelState value)
      Set the object that holds the longitude label state
      Parameters:
      value - The new long. label state
    • doRemove

      public void doRemove() throws RemoteException, VisADException
      Clear out any lingering references
      Specified by:
      doRemove in interface DisplayControl
      Overrides:
      doRemove in class DisplayControlImpl
      Throws:
      RemoteException - remote display problem
      VisADException - local display problem
    • setInitializeAsDefault

      public void setInitializeAsDefault(boolean value)
      Set the initializeAsDefault property. This is used when we do an addDefaultMap
      Parameters:
      value - The value
    • getIsDefaultMap

      public boolean getIsDefaultMap()
      Get the IsDefaultMap property.
      Returns:
      The IsDefaultMap
    • setIsDefaultMap

      public void setIsDefaultMap(boolean value)
      Set the IsDefaultMap property.
      Parameters:
      value - The new value for IsDefaultMap
    • setMapPosition

      public void setMapPosition(double value)
      Set the MapPosition property.
      Parameters:
      value - The new value for MapPosition
    • getMapPosition

      public double getMapPosition()
      Get the MapPosition property.
      Returns:
      The MapPosition
    • setShowInDisplayList

      public void setShowInDisplayList(boolean value)
      Set the ShowInDisplayList property.
      Overrides:
      setShowInDisplayList in class DisplayControlImpl
      Parameters:
      value - The new value for ShowInDisplayList
    • getShowInDisplayList

      public boolean getShowInDisplayList()
      Get the ShowInDisplayList property.
      Specified by:
      getShowInDisplayList in interface DisplayControl
      Overrides:
      getShowInDisplayList in class DisplayControlImpl
      Returns:
      The ShowInDisplayList
    • setApplyChangesToAllMaps

      public void setApplyChangesToAllMaps(boolean value)
      Set the ApplyChangesToAllMaps property.
      Parameters:
      value - The new value for ApplyChangesToAllMaps
    • getApplyChangesToAllMaps

      public boolean getApplyChangesToAllMaps()
      Get the ApplyChangesToAllMaps property.
      Returns:
      The ApplyChangesToAllMaps
    • setApplyChangesToAllLatLon

      public void setApplyChangesToAllLatLon(boolean value)
      Set the ApplyChangesToAllLatLon property.
      Parameters:
      value - The new value for ApplyChangesToAllLatLon
    • getApplyChangesToAllLatLon

      public boolean getApplyChangesToAllLatLon()
      Get the ApplyChangesToAllLatLon property.
      Returns:
      The ApplyChangesToAllLatLon
    • setApplyChangesToAllLabels

      public void setApplyChangesToAllLabels(boolean value)
      Set the ApplyChangesToAllLatLon property.
      Parameters:
      value - The new value for ApplyChangesToAllLatLon
    • getApplyChangesToAllLabels

      public boolean getApplyChangesToAllLabels()
      Get the ApplyChangesToAllLatLon property.
      Returns:
      The ApplyChangesToAllLatLon
    • getInitialZPosition

      protected double getInitialZPosition()
      Get default z position to use
      Overrides:
      getInitialZPosition in class DisplayControlImpl
      Returns:
      Default z position