Class WMSControl

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

public class WMSControl extends ImageControl implements ImageObserver
Class for controlling the display of color images.
Author:
Jeff McWhirter
  • Constructor Details

    • WMSControl

      public WMSControl()
      Default constructor.
    • WMSControl

      public WMSControl(List wmsSelections, String title)
      Constructor.
      Parameters:
      wmsSelections - The list of wms infos
      title - The title
  • Method Details

    • init

      public boolean init(DataChoice dataChoice) throws VisADException, RemoteException
      Called to make this kind of Display Control; This method is called from inside DisplayControlImpl init(several args).
      Overrides:
      init in class ImageControl
      Parameters:
      dataChoice - the DataChoice of the moment.
      Returns:
      true if successful
      Throws:
      RemoteException - Java RMI error
      VisADException - VisAD Error
    • initDone

      public void initDone()
      initdone
      Overrides:
      initDone in class DisplayControlImpl
    • isInitDone

      public boolean isInitDone()
      have we fully initialized
      Specified by:
      isInitDone in interface DisplayControl
      Overrides:
      isInitDone in class DisplayControlImpl
      Returns:
      have we fully initialized
    • doMakeDataInstance

      protected DataInstance doMakeDataInstance(DataChoice dataChoice) throws RemoteException, VisADException
      make the data instance
      Overrides:
      doMakeDataInstance in class GridDisplayControl
      Parameters:
      dataChoice - the data choice
      Returns:
      The data instance
      Throws:
      RemoteException - On badness
      VisADException - On badness
    • shouldAddDisplayListener

      protected boolean shouldAddDisplayListener()
      Signal base class to add this as a display listener
      Overrides:
      shouldAddDisplayListener in class GridDisplayControl
      Returns:
      Add as display listener
    • shouldAddControlListener

      protected boolean shouldAddControlListener()
      Signal base class to add this as a projection control listener
      Overrides:
      shouldAddControlListener in class GridDisplayControl
      Returns:
      Add as display listener
    • getInitialFastRendering

      protected boolean getInitialFastRendering()
      Get initial fast rendering option
      Overrides:
      getInitialFastRendering in class DisplayControlImpl
      Returns:
      false
    • projectionChanged

      public void projectionChanged()
      Method to call if projection changes. Subclasses that are worried about such events should implement this.
      Specified by:
      projectionChanged in interface DisplayControl
      Overrides:
      projectionChanged in class DisplayControlImpl
    • viewpointChanged

      public void viewpointChanged()
      Noop for the ControlListener interface
      Overrides:
      viewpointChanged in class DisplayControlImpl
    • getDetailsContents

      protected String getDetailsContents()
      Get the contents of the details html
      Overrides:
      getDetailsContents in class DisplayControlImpl
      Returns:
      The contents of the details
    • handleDisplayChanged

      public void handleDisplayChanged(DisplayEvent event)
      Listen for DisplayEvents
      Overrides:
      handleDisplayChanged in class DisplayControlImpl
      Parameters:
      event - The event
    • goToAddress

      public void goToAddress()
      Go the a street address
    • reloadDataSource

      public void reloadDataSource() throws RemoteException, VisADException
      Overwrite base class method to do our own style of reload
      Overrides:
      reloadDataSource in class DisplayControlImpl
      Throws:
      RemoteException - On badness
      VisADException - On badness
    • getViewMenuItems

      protected void getViewMenuItems(List items, boolean forMenuBar)
      Add to view menu
      Overrides:
      getViewMenuItems in class DisplayControlImpl
      Parameters:
      items - List of ites
      forMenuBar - for the menu bar
    • getSaveMenuItems

      protected void getSaveMenuItems(List items, boolean forMenuBar)
      Add the relevant file 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
    • canSaveDataInCache

      protected boolean canSaveDataInCache()
      See if this can save data in cache.
      Overrides:
      canSaveDataInCache in class DisplayControlImpl
      Returns:
      true if allowable
    • writeImageXml

      public void writeImageXml()
      Ask the user for an image xml file name and write the image to it
    • saveDataChoiceInCache

      public void saveDataChoiceInCache()
      Save the data choice into the cache data source
      Overrides:
      saveDataChoiceInCache in class DisplayControlImpl
    • doMakeContents

      protected Container doMakeContents() throws VisADException, RemoteException
      Make the gui
      Overrides:
      doMakeContents in class ImageControl
      Returns:
      The gui
      Throws:
      RemoteException - On badness
      VisADException - On badness
    • scaleSliderChanged

      public void scaleSliderChanged(int value)
      Handle the slider changing
      Parameters:
      value - new slider value
    • loadImageFromScreen

      public void loadImageFromScreen()
      Load the iamge from screen bounds
    • getDataProjection

      public MapProjection getDataProjection()
      Even though we do have data that holds a MapProjection we don't want to provide it so we return null.
      Specified by:
      getDataProjection in interface DisplayControl
      Overrides:
      getDataProjection in class GridDisplayControl
      Returns:
      null
    • getDataProjectionForMenu

      public MapProjection getDataProjectionForMenu()
      This gets called when the user selects the View menu item "Use Native Image Projection"
      Overrides:
      getDataProjectionForMenu in class DisplayControlImpl
      Returns:
      MapProjection for the data
    • reproject

      public void reproject()
      Reproject the image
    • setData

      protected boolean setData(DataChoice dataChoice) throws VisADException, RemoteException
      set the data
      Overrides:
      setData in class ImageControl
      Parameters:
      dataChoice - The data
      Returns:
      ok
      Throws:
      RemoteException - On badness
      VisADException - On badness
    • selectLayer

      public void selectLayer(Object layer)
      Set the wmsinfo
      Parameters:
      layer - The new layer
    • setImageWidth

      public void setImageWidth(int value)
      Set the ImageWidth property.
      Parameters:
      value - The new value for ImageWidth
    • getImageWidth

      public int getImageWidth()
      Get the ImageWidth property.
      Returns:
      The ImageWidth
    • setImageHeight

      public void setImageHeight(int value)
      Set the ImageHeight property.
      Parameters:
      value - The new value for ImageHeight
    • getImageHeight

      public int getImageHeight()
      Get the ImageHeight property.
      Returns:
      The ImageHeight
    • resolutionChanged

      public void resolutionChanged(TwoFacedObject tfo)
      User changed resolution
      Parameters:
      tfo - New resolution
    • setResolution

      public void setResolution(double value)
      Set the Resolution property.
      Parameters:
      value - The new value for Resolution
    • getResolution

      public double getResolution()
      Get the Resolution property.
      Returns:
      The Resolution
    • setCurrentBounds

      public void setCurrentBounds(GeoLocationInfo value)
      Set the CurrentBounds property.
      Parameters:
      value - The new value for CurrentBounds
    • getCurrentBounds

      public GeoLocationInfo getCurrentBounds()
      Get the CurrentBounds property.
      Returns:
      The CurrentBounds
    • setWmsInfo

      public void setWmsInfo(WmsSelection value)
      Set the WmsInfo property.
      Parameters:
      value - The new value for WmsInfo
    • getWmsInfo

      public WmsSelection getWmsInfo()
      Get the WmsInfo property.
      Returns:
      The WmsInfo
    • getTitle

      protected String getTitle()
      Get the window title
      Overrides:
      getTitle in class DisplayControlImpl
      Returns:
      Window title
    • getLegendLabels

      protected void getLegendLabels(List labels, int legendType)
      Get the legend labesl
      Overrides:
      getLegendLabels in class DisplayControlImpl
      Parameters:
      labels - List of (String) labels
      legendType - For side or bottom
    • imageUpdate

      public boolean imageUpdate(Image img, int flags, int x, int y, int width, int height)
      Handle the image update
      Specified by:
      imageUpdate in interface ImageObserver
      Parameters:
      img - The image
      flags - flags
      x - x
      y - y
      width - width
      height - height
      Returns:
      Continue loading
    • getExtraLegendComponent

      protected JComponent getExtraLegendComponent(int legendType)
      Assume that any display controls that have a color table widget will want the color table to show up in the legend.
      Overrides:
      getExtraLegendComponent in class ImageControl
      Parameters:
      legendType - type of legend
      Returns:
      The extra JComponent to use in legend
    • setWmsInfos

      public void setWmsInfos(List value)
      Set the WmsInfos property.
      Parameters:
      value - The new value for WmsInfos
    • getWmsInfos

      public List getWmsInfos()
      Get the WmsInfos property.
      Returns:
      The WmsInfos
    • setEnableClick

      public void setEnableClick(boolean value)
      Set the EnableClick property.
      Parameters:
      value - The new value for EnableClick deprecated use setEnableAutoFetch
    • getEnableAutoFetch

      public boolean getEnableAutoFetch()
      Get the EnableAutoFetch property.
      Returns:
      The EnableAutoFetch property
    • setEnableAutoFetch

      public void setEnableAutoFetch(boolean value)
      Set the EnableImageFetch property.
      Parameters:
      value - The new value for EnableAutoFetch
    • setSelectedTime

      public void setSelectedTime(String value)
      Set the SelectedTime property.
      Parameters:
      value - The new value for SelectedTime
    • getSelectedTime

      public String getSelectedTime()
      Get the SelectedTime property.
      Returns:
      The SelectedTime
    • setTheLayer

      public void setTheLayer(Object value)
      Set the TheLayer property.
      Parameters:
      value - The new value for TheLayer
    • getTheLayer

      public Object getTheLayer()
      Get the TheLayer property.
      Returns:
      The TheLayer
    • getTheTitle

      public Object getTheTitle()
      Get the TheTitle property.
      Returns:
      The TheTitle
    • setTheTitle

      public void setTheTitle(Object value)
      Set the TheTitle property.
      Parameters:
      value - The new value for TheTitle
    • setScale

      public void setScale(double value)
      Set the Scale property.
      Parameters:
      value - The new value for Scale
    • getScale

      public double getScale()
      Get the Scale property.
      Returns:
      The Scale
    • getInitialZPosition

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