ucar.unidata.idv.control
Class WMSControl

java.lang.Object
  extended by ucar.unidata.collab.SharableImpl
      extended by ucar.unidata.idv.control.DisplayControlBase
          extended by ucar.unidata.idv.control.DisplayControlImpl
              extended by ucar.unidata.idv.control.GridDisplayControl
                  extended by ucar.unidata.idv.control.BaseImageControl
                      extended by ucar.unidata.idv.control.ImageControl
                          extended by ucar.unidata.idv.control.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.

Version:
$Revision: 1.104 $
Author:
Jeff McWhirter

Nested Class Summary
static class WMSControl.ColorExclude
          Class ColorExclude Holds information to exclude certain colors
 
Nested classes/interfaces inherited from class ucar.unidata.idv.control.DisplayControlImpl
DisplayControlImpl.SideLegendLabel
 
Field Summary
 
Fields inherited from class ucar.unidata.idv.control.BaseImageControl
EMPTY_IMAGE, EMPTY_RGB_IMAGE, emptyImage, emptyRGBImage
 
Fields inherited from class ucar.unidata.idv.control.GridDisplayControl
CMD_CONTOURDIALOG, CMD_SETLEVELS, gridDataInstance, INITIAL_PROBE_EARTHLOCATION, log_, settingLevel
 
Fields inherited from class ucar.unidata.idv.control.DisplayControlImpl
categories, colorScaleInfo, colorScales, contourInfo, contourInfoParams, controlContext, ctw, cw, dataSelection, defaultView, defaultViewManager, DISPLAY_LIST_NAME, displayListTable, displayMasters, displayUnit, helpUrl, initNoteText, instantiatedWithNoData, noteTextArea, noteWrapper, paramName, requestProperties, settingVisibility, sharables, showNoteText, skipSlider, srw, version, viewManagers
 
Fields inherited from class ucar.unidata.idv.control.DisplayControlBase
CMD_BARBSIZE, CMD_COLORS, CMD_COLORTABLE, CMD_INTERVAL, CMD_LEVEL, CMD_LINEWIDTH, CMD_POPUP, CMD_REMOVE, DEFAULT_POINT_SIZE, DEFAULT_SAMPLING_MODE, FIND_ALL, FIND_CATEGORY, FIND_CLASS, FIND_SPECIAL, FIND_THIS, FIND_WITHDATA, FIND_WITHTHISDATA, FIND_WITHTHISFIELD, FIND_WITHTHISVIEW, FLAG_COLOR, FLAG_COLORTABLE, FLAG_COLORUNIT, FLAG_CONTOUR, FLAG_DATACONTROL, FLAG_DISPLAYUNIT, FLAG_LINEWIDTH, FLAG_NONE, FLAG_SELECTRANGE, FLAG_SKIPFACTOR, FLAG_TIMERANGE, FLAG_ZPOSITION, GRID_INSETS, ICON_LOCK, ICON_REMOVE, ICON_UNLOCK, LABEL_NONE, MACRO_DATASOURCENAME, MACRO_DISPLAYNAME, MACRO_DISPLAYUNIT, MACRO_LONGNAME, MACRO_POSITION, MACRO_SHORTNAME, MACRO_TIMESTAMP, MACRO_VALUE, NEAREST_NEIGHBOR, PREF_DISPLAYLIST_TEMPLATE, PREF_EXTRALABEL_TEMPLATE, PREF_LEGENDLABEL_TEMPLATE, PROP_REMOVED, SETTINGS_GROUP_DISPLAY, SETTINGS_GROUP_FLAGS, SHARE_CHOICES, SHARE_COLOR, SHARE_COLORSCALE, SHARE_COLORTABLE, SHARE_DISPLAYUNIT, SHARE_POSITION, SHARE_SELECTRANGE, SHARE_SKIPVALUE, SHARE_TRANSECT, SHARE_VISIBILITY, WEIGHTED_AVERAGE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Fields inherited from interface ucar.unidata.idv.DisplayControl
BOTTOM_LEGEND, DEFAULT_PROBEFORMAT, PREF_PREFIX, PREF_PROBEFORMAT, PREF_REMOVEONWINDOWCLOSE, PREF_SAMPLING_MODE, PREF_STANDALONE_REMOVEONCLOSE, PREF_STANDALONE_REMOVEONCLOSE_ASK, PROP_LEGENDICON, SIDE_LEGEND
 
Constructor Summary
WMSControl()
          Default constructor.
WMSControl(List wmsSelections, String title)
          Constructor.
 
Method Summary
protected  boolean canSaveDataInCache()
          See if this can save data in cache.
protected  Container doMakeContents()
          Make the gui
protected  DataInstance doMakeDataInstance(DataChoice dataChoice)
          make the data instance
 GeoLocationInfo getCurrentBounds()
          Get the CurrentBounds property.
 MapProjection getDataProjection()
          Even though we do have data that holds a MapProjection we don't want to provide it so we return null.
protected  String getDetailsContents()
          Get the contents of the details html
 boolean getEnableAutoFetch()
          Get the EnableAutoFetch property.
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.
 int getImageHeight()
          Get the ImageHeight property.
 int getImageWidth()
          Get the ImageWidth property.
protected  void getLegendLabels(List labels, int legendType)
          Get the legend labesl
 double getResolution()
          Get the Resolution property.
protected  void getSaveMenuItems(List items, boolean forMenuBar)
          Add the relevant file menu items into the list
 double getScale()
          Get the Scale property.
 String getSelectedTime()
          Get the SelectedTime property.
 Object getTheLayer()
          Get the TheLayer property.
protected  String getTitle()
          Get the window title
protected  void getViewMenuItems(List items, boolean forMenuBar)
          Add to view menu
 WmsSelection getWmsInfo()
          Get the WmsInfo property.
 List getWmsInfos()
          Get the WmsInfos property.
 void goToAddress()
          Go the a street address
 void handleDisplayChanged(DisplayEvent event)
          Listen for DisplayEvents
 boolean imageUpdate(Image img, int flags, int x, int y, int width, int height)
          Handle the image update
 boolean init(DataChoice dataChoice)
          Called to make this kind of Display Control; This method is called from inside DisplayControlImpl init(several args).
 void initDone()
          initdone
 void loadImageFromScreen()
          Load the iamge from screen bounds
 void projectionChanged()
          Method to call if projection changes.
 void reloadDataSource()
          Overwrite base class method to do our own style of reload
 void reproject()
          Reproject the image
 void resolutionChanged(TwoFacedObject tfo)
          User changed resolution
 void saveDataChoiceInCache()
          Save the data choice into the cache data source
 void scaleSliderChanged(int value)
          Handle the slider changing
 void selectLayer(Object layer)
          Set the wmsinfo
 void setCurrentBounds(GeoLocationInfo value)
          Set the CurrentBounds property.
protected  boolean setData(DataChoice dataChoice)
          set the data
 void setEnableAutoFetch(boolean value)
          Set the EnableImageFetch property.
 void setEnableClick(boolean value)
          Deprecated. use setEnableAutoFetch
 void setImageHeight(int value)
          Set the ImageHeight property.
 void setImageWidth(int value)
          Set the ImageWidth property.
 void setResolution(double value)
          Set the Resolution property.
 void setScale(double value)
          Set the Scale property.
 void setSelectedTime(String value)
          Set the SelectedTime property.
 void setTheLayer(Object value)
          Set the TheLayer property.
 void setWmsInfo(WmsSelection value)
          Set the WmsInfo property.
 void setWmsInfos(List value)
          Set the WmsInfos property.
protected  boolean shouldAddControlListener()
          Signal base class to add this as a projection control listener
protected  boolean shouldAddDisplayListener()
          Signal base class to add this as a display listener
 void viewpointChanged()
          Noop for the ControlListener interface
 void writeImageXml()
          Ask the user for an image xml file name and write the image to it
 
Methods inherited from class ucar.unidata.idv.control.ImageControl
getControlWidgets, getImageFlags, getInitialColorTable, getMultipleIsTopography, haveMultipleFields, setAlphaFromSlider, setMultipleIsTopography
 
Methods inherited from class ucar.unidata.idv.control.BaseImageControl
doMakeAlphaSlider, getAlpha, getDataProjectionLabel, getSkipWidgetLabel, getWorkingImage, setAlpha, setInverseAlphaFromSlider, showSkipFactorSlider
 
Methods inherited from class ucar.unidata.idv.control.GridDisplayControl
actionPerformed, addTopographyMap, convertColorRange, doMakeContourLevelControl, doMakeLevelControl, doMakeLevelControl, getColorParamName, getColorRangeFromData, getColorRangeIndex, getColorUnit, getContourInfo, getCursorReadoutData, getCursorReadoutInner, getDefaultContourInfo, getDisplayUnit, getGridDataInstance, getInitialRange, getRawDataUnit, initializeDefaultContourInfo, isDisplayUnitAlsoColorUnit, setLevel, setLevel, setLevelFromUser
 
Methods inherited from class ucar.unidata.idv.control.DisplayControlImpl
activateDisplays, addAttributedDisplayable, addAttributedDisplayable, addAttributedDisplayable, addAttributeFlags, addCheckBoxSettings, addDataChoice, addDisplayable, addDisplayable, addDisplayable, addDisplayable, addDisplayable, addDisplayable, addDisplayMaster, addDisplaySettings, addLabelMacros, addNewData, addNoteText, addPropertiesComponents, addPropertyChangeListener, addSharable, addToRangeMenu, addToRangeMenu, addToRangeMenu, addViewManager, appendDataChoices, applyAttributesToDisplayables, applyColor, applyColorScaleInfo, applyColorTable, applyColorUnit, applyContourInfo, applyDisplaySetting, applyDisplayUnit, applyLineWidth, applyPreferences, applyProperties, applyProperties, applyPropertyValues, applyRange, applySelectRange, applySkipFactor, applyTimeRange, applyZPosition, boundsClose, canBeDocked, canExportData, captureWindow, changeColorUnit, changeDisplayUnit, checkFlag, checkIfDataOk, checkImageSize, clearDataInstance, clearPrototype, clearViewManagers, close, colorUnitChanged, controlChanged, convertColorRange, convertRange, createDisplayListDisplayable, createIdvWindow, dataChanged, deactivateDisplays, debug, displayableToFront, displayChanged, displayControlFailed, displayUnitChanged, doApplyProperties, doMakeBottomLegendComponent, doMakeChangeColorMenu, doMakeChangeColorMenu, doMakeChangeParameterMenuItem, doMakeColorControl, doMakeColorControl, doMakeColorScales, doMakeMenuBar, doMakeMenuBarMenus, doMakeRemoveControl, doMakeSideLegendComponent, doMakeSkipFactorSlider, doMakeVisibilityControl, doMakeWidgetComponent, doMakeWindow, doMakeZPositionSlider, doRemove, exportDisplayedData, findDisplayInfo, findDisplays, findDisplays, firePropertyChangeEvent, firstFrameDone, formatForCursorReadout, getActive, getAnimation, getAnimation, getAnimation, getAnimation, getAnimationInfo, getAnimationWidget, getAttributeFlags, getCachedData, getCanDoRemoveAll, getCategories, getChangeParameterLabel, getCollapseLegend, getColor, getColorDimness, getColorScaleInfo, getColorTable, getColorTableForDisplayable, getColorTableToApply, getColorTableWidget, getColorUnitName, getColorWidgetLabel, getComponentHolder, getContents, getControlChangeSleepTime, getControlContext, getCursorReadout, getDataChoice, getDataChoices, getDataInstance, getDataInstance, getDataProjectionForMenu, getDataSelection, getDataSources, getDataTimeRange, getDataTimeRange, getDataTimeSet, getDebugDetails, getDefaultColorScaleInfo, getDefaultDistanceUnit, getDefaultFastRendering, getDefaultSamplingMode, getDefaultSamplingModeValue, getDefaultView, getDefaultViewDescriptor, getDefaultViewManager, getDisplayAltitudeType, getDisplayCategory, getDisplayCenter, getDisplayConventions, getDisplayedData, getDisplayId, getDisplayInfos, getDisplayListColor, getDisplayListData, getDisplayListDisplayable, getDisplayListTemplate, getDisplayMaster, getDisplayName, getDisplayScale, getDisplayUnit, getDisplayUnitName, getDisplayVisibility, getDoCursorReadout, getEditMenuItems, getEditMenuItems, getExpandedInTabs, getExtraLabelTemplate, getExtraMenus, getFileMenuItems, getFileMenuItems, getGraphicsConfiguration, getHadDataChoices, getHaveInitialized, getHelpIds, getHelpMenuItems, getId, getIdv, getImage, getImage, getInitDataChoices, getInitialZPosition, getLabel, getLastFileMenuItems, getLegendButtons, getLegendComponent, getLegendLabel, getLegendLabelTemplate, getLegendToolTip, getLineWidth, getLineWidthWidget, getLineWidthWidgetLabel, getLockVisibilityToggle, getLongParamName, getMacroNames, getMainPanel, getMainPanelSize, getMakeWindow, getMapDisplay, getMapViewManager, getMapViewProjection, getMenuLabel, getMyDataChoices, getNavigatedDisplay, getNoteText, getObjectStore, getOkToFireEvents, getOldColorTableOrInitialColorTable, getOriginalDataChoicesLabel, getOuterContents, getProperty, getProperty, getPropertyDisplayName, getRange, getRangeForColorTable, getRangeToApply, getRequestProperties, getSamplingModeName, getSamplingModeValue, getSelectRange, getSelectRangeEnabled, getSelectRangeWidget, getSettingsPanel, getShortParamName, getShowInDisplayList, getShowInLegend, getShowInTabs, getShowNoteText, getSkipValue, getStore, getTemplateName, getTimeSet, getTransientProperty, getUnitForColor, getUseFastRendering, getUseTimesInAnimation, getVersion, getVerticalValue, getViewContext, getViewer, getViewManager, getViewManager, getViewManager, getViewManagerClassNames, getViewManagers, getViewMenuItems, getWasUnPersisted, getWindow, getWindowSize, getWindowVisible, getWindowX, getWindowY, getZPosition, getZPositionSliderLabel, guiExported, guiImported, handleWindowClosing, hasMapProjection, haveDataTimes, haveParameterDefaults, hide, hyperlinkUpdate, init, init, init, initAfterUnPersistence, initAfterUnPersistence, initAsPrototype, initAsTemplate, initBasic, initializeWithNewData, initWindow, isDisplay3D, isGuiShown, isInitDone, isInTransectView, isInViewManager, itemStateChanged, makeChangeColorMenuItems, makeLegendLabel, makeLockButton, makeRemoveButton, moveTo, notifyViewManagersOfChange, parseProperties, popup, popupDataDialog, popupDataDialog, popupDataDialog, processRequestProperties, propertyChange, putTransientProperty, receiveShareData, redoGuiLayout, reloadDataSourceInThread, removeDataChoice, removeDisplayable, removeDisplayables, removeOnWindowClose, removePropertyChangeListener, resetData, resetDimness, resetViewManager, revertToDefaultColorTable, revertToDefaultColorTable, revertToDefaultRange, revertToDefaultRange, saveAsFavorite, saveAsParameterDefaults, saveAsPrototype, saveAsTemplate, saveImage, setAnimationInfo, setAnimationSet, setAttributeFlags, setCachedData, setCanDoRemoveAll, setCategories, setCollapseLegend, setColor, setColorBrighter, setColorDimmer, setColorDimness, setColorScaleInfo, setColorScaleVisible, setColorTable, setColorTable, setColorTableName, setColorUnit, setColorUnitName, setComponentHolder, setContents, setContourInfo, setContourInfoParams, setData, setDataChoices, setDataInstance, setDataInstances, setDataSelection, setDataTimeRange, setDefaultSamplingMode, setDefaultView, setDisplayableVisibility, setDisplayableVisiblity, setDisplayActive, setDisplayCategory, setDisplayId, setDisplayInactive, setDisplayListColor, setDisplayListProperties, setDisplayListTemplate, setDisplayName, setDisplayUnit, setDisplayUnitName, setDisplayVisibility, setDoCursorReadout, setExpandedInTabs, setExtraLabelTemplate, setHadDataChoices, setHelpUrl, setId, setInitDataChoices, setInitialSettings, setLabelAsPreference, setLegendBackground, setLegendForeground, setLegendLabel, setLegendLabelTemplate, setLineWidth, setLockVisibilityToggle, setMainPanelDimensions, setMainPanelSize, setMakeWindow, setName, setNameFromUser, setNewColorUnit, setNewDisplayUnit, setNoteText, setOkToFireEvents, setOriginalDataChoicesLabel, setParamName, setPersistedVisadData, setProjectionInView, setProjectionInView, setProperty, setRange, setRange, setSelectRange, setSelectRangeEnabled, setSettingsDisplayUnit, setSharedColorScaleInfo, setShowInDisplayList, setShowInLegend, setShowInTabs, setShowNoteText, setSkipValue, setTemplateName, setTitle, setUnitForColor, setUseFastRendering, setUseTimesInAnimation, setVersion, setViewer, setViewManagerClassNames, setWindowSize, setWindowVisible, setWindowX, setWindowY, setZPosition, shouldAddAnimationListener, shouldApplyFastRendering, shouldBeDocked, shouldWindowBeVisible, show, showColorControlWidget, showColorDialog, showColorDialog, showColorScaleDialog, showColorScales, showColorSwatches, showContourPropertiesDialog, showDetails, showDisplaySettingsDialog, showHelp, showLegendMenu, showNormalCursor, showProperties, showTimeRangeDialog, showWaitCursor, timeChanged, toFront, toggleNoteTextArea, toggleWindow, toString, transectChanged, updateAnimation, updateDisplayList, updateLegendAndList, updateLegendLabel, updateLockButton, useZPosition, viewManagerChanged, viewManagerDestroyed, writeTestArchive, xxxsetDisplayActive, zSliderChanged
 
Methods inherited from class ucar.unidata.idv.control.DisplayControlBase
boxToEarth, boxToEarth, boxToEarth, boxToEarth, boxToEarth, boxToScreen, calculateRectangle, createStationTfo, earthToBox, earthToBox, earthToBoxTuple, earthToScreen, formatLevels, getScreenCenter, getSelectedStation, isLeftButtonDown, logException, logException, makeEarthLocation, screenToBox, screenToBox, screenToEarth, setStations, setStations, toBox, toEarth, userErrorMessage, userMessage
 
Methods inherited from class ucar.unidata.collab.SharableImpl
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, removeSharable, setShareGroup, setSharing, setUniqueId, showSharableDialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ucar.unidata.collab.Sharable
getShareGroup, getSharing, getUniqueId
 

Constructor Detail

WMSControl

public WMSControl()
Default constructor.


WMSControl

public WMSControl(List wmsSelections,
                  String title)
Constructor.

Parameters:
wmsSelections - The list of wms infos
title - The title
Method Detail

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

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 DisplayControlImpl
Returns:
Add as display listener

shouldAddControlListener

protected boolean shouldAddControlListener()
Signal base class to add this as a projection control listener

Overrides:
shouldAddControlListener in class DisplayControlImpl
Returns:
Add as display listener

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 - f