ucar.unidata.idv
Class MapViewManager

java.lang.Object
  extended by ucar.unidata.collab.SharableImpl
      extended by ucar.unidata.idv.ViewManager
          extended by ucar.unidata.idv.NavigatedViewManager
              extended by ucar.unidata.idv.MapViewManager
All Implemented Interfaces:
ActionListener, ItemListener, EventListener, Sharable, ControlListener, DisplayListener

public class MapViewManager
extends NavigatedViewManager

A wrapper around a MapProjectDisplay display master. Provides an interface for managing user interactions, gui creation, etc.

Author:
IDV development team

Nested Class Summary
static class MapViewManager.ProjectionCommand
          Class ProjectionCommand manages changes to the projection
 
Nested classes/interfaces inherited from class ucar.unidata.idv.ViewManager
ViewManager.MatrixCommand
 
Field Summary
static String CMD_FLY_BACK
          flythrough command
static String CMD_FLY_FORWARD
          flythrough command
static String CMD_FLY_LEFT
          flythrough command
static String CMD_FLY_RIGHT
          flythrough command
static String PREF_ADDRESS_LIST
          preference id for the list of addresses in the geocode dialog
static String PREF_ADDRESS_REPROJECT
          do we reproject when we go to an address
static String PREF_AUTOROTATE
          Preference for autorotate in globe mode
static String PREF_GLOBEBACKGROUND
          Preference for the globe background color
static String PREF_PERSPECTIVEVIEW
          Preference for showing display in perspective view_
static String PREF_PROJ_DFLT
          Preference for default projection
static String PREF_PROJ_USEFROMDATA
          Preference for setting projection automatically from data_
static String PREF_SHOWEARTHNAVPANEL
          Preference for showing the earth nav panel
static String PREF_SHOWGLOBEBACKGROUND
          Preference for showing the globe background
static String PREF_SHOWPIP
          Preference for showing the pip
static String PROP_CLIPDISTANCE_GLOBE_BACK
          back globe clipping distance
static String PROP_CLIPDISTANCE_GLOBE_FRONT
          front globe clipping distance
static String PROP_CLIPDISTANCE_MAP_BACK
          back map clipping distance
static String PROP_CLIPDISTANCE_MAP_FRONT
          fron map clipping distance
static String SHARE_PROJECTION
          Defines the projection when sharing state
 
Fields inherited from class ucar.unidata.idv.NavigatedViewManager
CMD_NAV_DOWN, CMD_NAV_HOME, CMD_NAV_LEFT, CMD_NAV_RIGHT, CMD_NAV_ROTATELEFT, CMD_NAV_ROTATERIGHT, CMD_NAV_SMALLDOWN, CMD_NAV_SMALLLEFT, CMD_NAV_SMALLRIGHT, CMD_NAV_SMALLROTATELEFT, CMD_NAV_SMALLROTATERIGHT, CMD_NAV_SMALLTILTDOWN, CMD_NAV_SMALLTILTUP, CMD_NAV_SMALLUP, CMD_NAV_SMALLZOOMIN, CMD_NAV_SMALLZOOMOUT, CMD_NAV_UP, CMD_NAV_ZOOMIN, CMD_NAV_ZOOMOUT, cursorReadoutWindow, PROP_VERTICALRANGE, SHARE_MATRIX, TRANSLATE_FACTOR, ZOOM_FACTOR
 
Fields inherited from class ucar.unidata.idv.ViewManager
animationHolder, animationMenu, borderHighlightColor, borderWidth, clickToFocus, displayBounds, fullScreenWindow, highlightBorder, innerContents, lastActive, lastTimeActivated, logoPoses, nameLabel, normalBorder, PREF_3DCLIP, PREF_ANIREADOUT, PREF_BGCOLOR, PREF_BORDERCOLOR, PREF_CONTOUR_LABELALIGN, PREF_CONTOUR_LABELFONT, PREF_CONTOUR_LABELSIZE, PREF_DIMENSION, PREF_DISPLAYLISTCOLOR, PREF_DISPLAYLISTFONT, PREF_FGCOLOR, PREF_LOGO, PREF_LOGO_POSITION_OFFSET, PREF_LOGO_SCALE, PREF_LOGO_VISIBILITY, PREF_PREFIX, PREF_SHAREVIEWS, PREF_SHOWANIMATIONBOXES, PREF_SHOWBOTTOMLEGEND, PREF_SHOWCURSOR, PREF_SHOWDISPLAYLIST, PREF_SHOWSCALES, PREF_SHOWSIDELEGEND, PREF_SHOWTOOLBAR, PREF_SHOWTRANSECTSCALES, PREF_TOOLBARSFLOATABLE, PREF_TOPBAR_VISIBLE, PREF_WAITMSG, PREF_WIREFRAME, showControlLegend, showControlMenu, TAG_COLORPAIR, TAG_COLORPAIRS, toolbarIds, toolbarNames, toolbars, windowBounds
 
Constructor Summary
MapViewManager()
          Default constructor
MapViewManager(ViewContext viewContext)
          Construct a MapViewManager from an IDV
MapViewManager(ViewContext viewContext, ViewDescriptor desc, String properties)
          Construct a MapViewManager with the specified params
 
Method Summary
 void actionPerformed(ActionEvent event)
          Required interface for ActionEvents, to implement ActionListener for the UI objects such as JButton-s and MenuItem-s
 void addDisplayInfos(List<DisplayInfo> displayInfos)
          Reset projection of display based control's getDataProjection().
protected  void addPropertiesComponents(JTabbedPane tabbedPane)
          Add the properties components for this ViewManager
protected  void animationTimeChanged()
          Handle the animation time changed
 boolean applyProperties()
          Apply the properties
 boolean canBe(ViewManager that)
          Can this view manager be used in exchange for the given view manager
 void center(MapProjection mp)
          Center the display (animated) to the center of the given mapprojection
protected  boolean checkForKmlImageCapture()
          Check if its ok to capture a kmz file
 void checkPipPanel()
          Check the pip panel.
 void checkProjection(FieldImpl data, DisplayControl display)
          Deprecated. no substitute. Use setMapProjection()
 void destroy()
          Destroy this ViewManager
 void displayChanged(DisplayEvent event)
          Handle the event
 void displayDataChanged(DisplayControl display)
          Handle a change to the data in a DisplayControl
 void displayDataChanged(DisplayControl display, boolean fromInitialLoad)
          Handle a change to the data in a DisplayControl
protected  Container doMakeContents()
          Make the GUI contents.
protected  DisplayMaster doMakeDisplayMaster()
          Make the DisplayMaster for this ViewManager
 ArrayList doMakeMenuList()
          Create and return the list of menus for the menu bar.
protected  void doneFirstFrame()
          Received the first frame done event from the display
protected  void fillLegends()
          Fill the legends
 void flythrough(float[][] pts)
          Do a flythrough
 void flythrough(List<FlythroughPoint> pts)
          Flythrough the points
 boolean getAutoRotate()
          Get the autorotate flag
 float getDefaultMapPosition()
          Get the default map position from a property
 ucar.unidata.geoloc.ProjectionImpl getDefaultProjection()
          Get the default projection to use
 String getDefaultProjectionName()
          Get the DfltProjectionName property.
 double getDisplayProjectionZoom()
          Get the DisplayProjectionZoom property.
 Flythrough getFlythrough()
          Get the Flythrough property.
 Color getGlobeBackgroundColor()
          Get the GlobeBackgroundColor property.
 Color getGlobeBackgroundColorToUse()
          Get the GlobeBackgroundColor property to be used.
 double getGlobeBackgroundLevel()
          Get the GlobeBackgroundLevel property.
 boolean getGlobeBackgroundShow()
          Get the GlobeBackgroundShow property.
protected  void getInitialBooleanProperties(List props)
          Create the set of BooleanPropertys.
 Rectangle2D.Float getInitLatLonBounds()
          Get the InitLatLonBounds property.
 Color getInitMapColor()
          Get the InitMapColor property.
 String getInitMapPaths()
          Get the InitMapPaths property.
 float getInitMapWidth()
          Get the InitMapWidth property.
 JComponent getInnerContents()
          Get the JComponent for the VisAD display
 MapProjection getMainProjection()
          Get the current projection.Used for xml encoding/decoding.
 String getMainProjectionName()
          The main projection name.Used for xml encoding/decoding.
 NavigatedDisplay getMapDisplay()
          Get the map display.
 boolean getPerspectiveView()
          Get the perspective view flag
 EarthLocation getScreenCenter()
          Get the earth location of the screen center
 List<TwoFacedObject> getScreenCoordinates()
          Get a list of named locations of the different points of the view rectangle.
 boolean getShowEarthNavPanel()
          Get the ShowEarthNavPanel property.
 boolean getShowMaps()
          Get the ShowMaps property.
 boolean getShowPip()
          Get the ShowPipPanel property.
protected  JComponent getSideComponent(JComponent sideLegend)
          Add the PIP panel if needed
 String getTypeName()
          What type of view is this
 boolean getUse3D()
          Get the use 3D display flag.
 boolean getUseGlobeDisplay()
          Get the globe display flag.
 boolean getUseProjectionFromData()
          Get the use projection from data flag
 GeoLocationInfo getVisibleGeoBounds()
          Get the bounds that are visible
 void goToAddress()
          Go the a street address
protected  void handleBooleanPropertyChange(String id, boolean value)
          The BooleanProperty identified byt he given id has changed.
 void hidePip()
          Hide the pip panel
protected  void init()
          Initialize this object.
 void initAfterUnPersistence(IntegratedDataViewer idv)
          Initialize after unpersistence
 void initializeDisplaysProjectionMenu(JMenu displaysMenu)
          Init menu
 void initializeProjectionHistoryMenu(JMenu menu)
          Init menu
 void initializeProjectionMenu(JMenu projectionsMenu)
          Init menu
 void initializeViewMenu(JMenu viewMenu)
          Dynamically initialize the view menu
 void initPreferences(IdvPreferenceManager preferenceManager)
          Add in the different preference panels.
protected  void initToolBars()
          Initialize the toolbars for the GUI
protected  void initUI()
          Initialize the UI
 void initViewState(ViewState viewState)
          Initialize the ViewState
 void initWith(ViewState viewState)
          Initialize with another view
protected  void initWithInner(ViewManager that, boolean ignoreWindow)
          Initialize this object's state with the state from that.
 boolean isCompatibleWith(ViewManager vm)
          Is this a compatible ViewManager
 boolean isCompatibleWith(ViewState viewState)
          Is this compatible with the ViewState
 boolean isDisplay3D()
          Are we in 3d mode
static void makeProjectionsMenu(JMenu projectionsMenu, List projections, Object object, String method)
          Make the projections menu.
static void makeProjectionsMenu(JMenu projectionsMenu, List projections, Object object, String method, ucar.unidata.geoloc.ProjectionImpl currentProjection)
          Make the projections menu
protected  JMenu makeShowMenu()
          Create and return the show menu.
protected  void mouseFlicked(Point startPoint, Point endPoint, double[] startMatrix, double[] endMatrix, double speed)
          Handle the mouse flicked
 boolean okToImportDisplay(DisplayControl control)
          can this viewmanager import the given display control
protected  void perspectiveViewChanged(boolean v)
          Handle a perspective view change
 void receiveShareData(Sharable from, Object dataId, Object[] data)
          Handle the receipt of shared data
 void setAutoRotate(boolean value)
          Set the autorotate property
 void setBgColor(boolean bgColor)
          Deprecated. Keep this around for old bundles
 void setCurrentAsProjection()
          Set the current viewpoint as the projection
 void setDefaultProjectionName(String value)
          Set the DfltProjectionName property.
 void setDisplayProjectionZoom(double value)
          Set the DisplayProjectionZoom property.
 void setFlythrough(Flythrough value)
          Set the Flythrough property.
 void setGlobeBackgroundColor(Color value)
          Set the GlobeBackgroundColor property.
 void setGlobeBackgroundLevel(double value)
          Set the GlobeBackgroundLevel property.
 void setGlobeBackgroundShow(boolean value)
          Set the GlobeBackgroundShow property.
 void setInitialMapResources(String value)
          Set the InitialMapResources property.
 void setInitLatLonBounds(Rectangle2D.Float value)
          Set the InitLatLonBounds property.
 void setInitLatLonColor(Color v)
          Set the intial lat/lon color
 void setInitLatLonSpacing(float v)
          Set the initial lat/lon spacing
 void setInitLatLonVisible(boolean v)
          Set the intial lat/lon visible
 void setInitLatLonWidth(int v)
          Set the initial lat/lon line width
 void setInitMapColor(Color value)
          Set the InitMapColor property.
 void setInitMapPaths(String value)
          Set the InitMapPaths property.
 void setInitMapWidth(float value)
          Set the InitMapWidth property.
 void setMainProjection(MapProjection projection)
          Set the current projection.
 void setMainProjectionName(String projectionName)
          The main projection name.Used for xml encoding/decoding.
 void setMapArea(ucar.unidata.geoloc.ProjectionRect mapArea)
          Set or reset map area of view, using NavigatedDisplay method.
 void setMapConfigFile(String location)
          Have this so we don't get warnings on unpersisting old bundles
 void setMapProjection(MapProjection projection, boolean fromWidget)
          A wrapper aroung the setMapProjection call that takes a projection name.
 boolean setMapProjection(MapProjection projection, boolean fromWidget, String name)
          Set map projection in the main display.
 boolean setMapProjection(MapProjection projection, boolean fromWidget, String name, boolean checkDefault)
          Set map projection in the main display.
 boolean setMapProjection(MapProjection projection, boolean fromWidget, String name, boolean checkDefault, boolean addToCommandHistory)
          Set map projection in the main display.
 boolean setMapProjection(MapProjection projection, boolean fromWidget, String name, boolean checkDefault, boolean addToCommandHistory, boolean maintainViewpoint)
          Set map projection in the main display.
 void setMapState(String ms)
          Leave this here for old bundles
 void setPerspectiveView(boolean value)
          Set the perspective view flag
 void setProjection(ucar.unidata.geoloc.ProjectionImpl p)
          Set the current projection
 void setProjectionByName(String projName)
          Find and set the projection by name
 void setProjectionFromFirstDisplay()
          Set the projection to the first projection found in the displays
 void setShowEarthNavPanel(boolean value)
          Set the ShowEarthNavPanel property.
 void setShowElevation(boolean value)
          Dummy for old bundles
 void setShowMap(boolean value)
          Dummy for old bundles
 void setShowMaps(boolean value)
          Set the ShowMaps property.
 void setShowPip(boolean value)
          Set the ShowPipPanel property.
 void setUse3D(boolean use)
          Use a 3D display.
 void setUseGlobeDisplay(boolean use)
          Use globe display.
 void setUseProjectionFromData(boolean value)
          Set the use projection from data flag
 void setViewpointInfo(ViewpointInfo viewpointInfo)
          Set the viewpoint info
 boolean shouldAnimateViewChanges()
          Should we animate view changes
 void showFlythrough()
          Show the fly through
 void showProjectionManager()
          Show the projection manager.
protected  void updateProjection()
          If we are using a ProjectionImpl then see if it hsa
protected  void verticalScaleChanged()
          Handle a vertical scale change
 
Methods inherited from class ucar.unidata.idv.NavigatedViewManager
applyPreferences, checkHistoryMatrix, doMakeViewPointToolBar, doMakeZoomPanToolBar, getClipping, getDisplayCoordinateSystem, getLabelsVisible, getNavigatedDisplay, getShowCursor, getTransectLabelsVisible, getVerticalRange, getVerticalRangeUnit, getViewpointControl, handleControlChanged, hasViewpointControl, matrixChanged, setClipping, setDisplayMaster, setLabelsVisible, setReadoutFormat, setShowCursor, setTransectLabelsVisible, setVerticalRange, setVerticalRangeUnit, setVerticalRangeUnitPreference, setWindow, verticalRangeChanged
 
Methods inherited from class ucar.unidata.idv.ViewManager
addBooleanProperty, addCommand, addContextMenuItems, addDisplayInfo, addDisplayListener, addRemovable, addToolBar, addViewDescriptor, animationOk, aspectSliderChanged, brighter, checkToolBarVisibility, clearDisplays, clearImageGrabber, controlChanged, controlMoved, createCBMI, displayControlChanged, displayControlVisibilityChanged, doClose, doDrop, doMakeMenuBar, doMakeViewState, doPrintImage, doPublishImage, doPublishImage, doSaveImage, doSaveImage, doSaveImageInThread, doSaveState, ensureOnlyOneTimeDriver, fillLegendsInner, fillLegendsLater, findLoc, firstInitializeViewMenu, getAliases, getAnimation, getAnimationInfo, getAnimationStringVisible, getAnimationTimes, getAnimationWidget, getAniReadout, getAspectPropertiesComponent, getAspectRatio, getBackground, getBooleanPropertiesForPersistence, getBooleanProperty, getBooleanProperty, getBp, getBp, getClickToFocus, getCommandManager, getComponent, getContents, getContentsBorder, getControls, getControlsForLegend, getDefaultBackground, getDefaultForeground, getDisplayBounds, getDisplayConventions, getDisplayInfos, getDisplayListColor, getDisplayListFont, getDisplayMatrix, getDisplayRenderer, getDisplayWindow, getExternalAnimation, getExternalAnimationWidget, getForeground, getFullScreenHeight, getFullScreenWidth, getHasWindow, getHaveInitialized, getHighlightBorder, getIdv, getIdvUIManager, getInitDone, getInitViewStateName, getIsActive, getIsDestroyed, getIsShared, getLastFrameDoneTime, getLastTimeActivated, getLegendOnLeft, getLegends, getLegendState, getLights, getLogoFile, getLogoPosition, getLogoScale, getLogoVisibility, getMainPropertiesComponent, getMaster, getMySize, getName, getNormalBorder, getProjectionControl, getProjectionList, getProperties, getPropertiesComponent, getProperty, getPublishManager, getReallyHasWindow, getResourceManager, getShareViews, getShowAnimationBoxes, getShowBottomLegend, getShowControlLegend, getShowDisplayList, getShowScales, getShowSideLegend, getSideDividerLocation, getSideLegend, getSideLegendContainer, getSkinProperties, getSkinProperty, getSplitPaneLocation, getStateManager, getStore, getTimeDriverTimes, getTimelineComponent, getToolbarsFloatable, getTopBarVisible, getUniqueId, getUseFastRendering, getViewDescriptor, getViewManager, getVMManager, getWaitMessageVisible, getWireframe, guiInitializationDone, hasBooleanProperty, hasDisplayMaster, initBooleanProperties, initColorMenu, initDisplayMenu, initFromSkin, initializeBooleanProperty, initViewStateMenu, initWith, initWith, insertSideLegend, isClassOk, isDefinedBy, isFullScreen, isInteractive, isVectorGraphicsFile, itemStateChanged, keyWasTyped, logException, makeColorMenu, makeDropPanel, makeFrames, makeLogoPosition, makeSavedViewsMenu, makeViewMenu, makeViewStateMenu, notifyDisplayControls, paintDisplayList, parseLogoPosition, parseProperties, printAspect, putProperty, reallyFillLegends, removeColorPair, removeDisplayInfo, resetAspectSliders, resetFullScreen, resetProjectionControl, setAliases, setAnimatedVisibility, setAnimationInfo, setAnimationStringVisible, setAniReadout, setAspectRatio, setBackground, setBooleanProperties, setBooleanPropertiesForPersistence, setBp, setClickToFocus, setColors, setContentsBorder, setCursorInDisplay, setDisplayBounds, setDisplayListColor, setDisplayListFont, setDisplayMatrix, setExternalAnimation, setForeground, setFullScreen, setFullScreenHeight, setFullScreenWidth, setHasWindow, setHighlightBorder, setIdv, setInitialSplitPaneLocation, setInitViewStateName, setIsShared, setLastActive, setLegendOnLeft, setLegendState, setLegendState, setLights, setLogoFile, setLogoPosition, setLogoScale, setLogoVisibility, setMasterActive, setMasterActive, setMasterInactive, setName, setProperties, setProperty, setShareViews, setShowControlLegend, setShowDisplayList, setShowScales, setShowToolBars, setSideDividerLocation, setSideLegend, setSideLegendPosition, setSize, setSkinProperties, setSplitPaneLocation, setTopBarVisible, setView, setViewDescriptor, setWaitMessageVisible, setWindowBounds, setWireframe, shouldDoThingsRightAway, showColorPairDialog, showHighlight, showLegend, showPropertiesDialog, showTimeline, showWindow, startImageCapture, toFront, toggleFullScreen, toString, turnOnOffAllDisplays, updateAnnotations, updateDisplayIfNeeded, updateDisplayList, updateNameLabel, useDisplay, useImages, useImages, writeImage, writeImage, writeImage, writeImage, writeImage, writeImage, writeImage, writeTestArchive
 
Methods inherited from class ucar.unidata.collab.SharableImpl
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, initSharable, removeSharable, setReceiveShareTime, setShareGroup, setSharing, setUniqueId, showSharableDialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_CLIPDISTANCE_GLOBE_FRONT

public static final String PROP_CLIPDISTANCE_GLOBE_FRONT
front globe clipping distance

See Also:
Constant Field Values

PROP_CLIPDISTANCE_GLOBE_BACK

public static final String PROP_CLIPDISTANCE_GLOBE_BACK
back globe clipping distance

See Also:
Constant Field Values

PROP_CLIPDISTANCE_MAP_FRONT

public static final String PROP_CLIPDISTANCE_MAP_FRONT
fron map clipping distance

See Also:
Constant Field Values

PROP_CLIPDISTANCE_MAP_BACK

public static final String PROP_CLIPDISTANCE_MAP_BACK
back map clipping distance

See Also:
Constant Field Values

CMD_FLY_LEFT

public static final String CMD_FLY_LEFT
flythrough command

See Also:
Constant Field Values

CMD_FLY_RIGHT

public static final String CMD_FLY_RIGHT
flythrough command

See Also:
Constant Field Values

CMD_FLY_FORWARD

public static final String CMD_FLY_FORWARD
flythrough command

See Also:
Constant Field Values

CMD_FLY_BACK

public static final String CMD_FLY_BACK
flythrough command

See Also:
Constant Field Values

PREF_ADDRESS_LIST

public static final String PREF_ADDRESS_LIST
preference id for the list of addresses in the geocode dialog

See Also:
Constant Field Values

PREF_ADDRESS_REPROJECT

public static final String PREF_ADDRESS_REPROJECT
do we reproject when we go to an address

See Also:
Constant Field Values

PREF_AUTOROTATE

public static final String PREF_AUTOROTATE
Preference for autorotate in globe mode

See Also:
Constant Field Values

PREF_PERSPECTIVEVIEW

public static final String PREF_PERSPECTIVEVIEW
Preference for showing display in perspective view_

See Also:
Constant Field Values

PREF_PROJ_DFLT

public static final String PREF_PROJ_DFLT
Preference for default projection

See Also:
Constant Field Values

PREF_PROJ_USEFROMDATA

public static final String PREF_PROJ_USEFROMDATA
Preference for setting projection automatically from data_

See Also:
Constant Field Values

PREF_SHOWPIP

public static final String PREF_SHOWPIP
Preference for showing the pip

See Also:
Constant Field Values

PREF_SHOWGLOBEBACKGROUND

public static final String PREF_SHOWGLOBEBACKGROUND
Preference for showing the globe background

See Also:
Constant Field Values

PREF_GLOBEBACKGROUND

public static final String PREF_GLOBEBACKGROUND
Preference for the globe background color

See Also:
Constant Field Values

PREF_SHOWEARTHNAVPANEL

public static final String PREF_SHOWEARTHNAVPANEL
Preference for showing the earth nav panel

See Also:
Constant Field Values

SHARE_PROJECTION

public static final String SHARE_PROJECTION
Defines the projection when sharing state

See Also:
Constant Field Values
Constructor Detail

MapViewManager

public MapViewManager()
Default constructor


MapViewManager

public MapViewManager(ViewContext viewContext)
Construct a MapViewManager from an IDV

Parameters:
viewContext - Really the IDV

MapViewManager

public MapViewManager(ViewContext viewContext,
                      ViewDescriptor desc,
                      String properties)
               throws VisADException,
                      RemoteException
Construct a MapViewManager with the specified params

Parameters:
viewContext - context in which this MVM exists
desc - ViewDescriptor
properties - semicolon separated list of properties (can be null)
Throws:
RemoteException - Java RMI problem
VisADException - Couldn't create the VisAD object
Method Detail

getDefaultProjection

public ucar.unidata.geoloc.ProjectionImpl getDefaultProjection()
Get the default projection to use

Returns:
The default projection

doMakeDisplayMaster

protected DisplayMaster doMakeDisplayMaster()
                                     throws VisADException,
                                            RemoteException
Make the DisplayMaster for this ViewManager

Overrides:
doMakeDisplayMaster in class ViewManager
Returns:
the DisplayMaster
Throws:
RemoteException - Java RMI problem
VisADException - Couldn't create the VisAD object

getScreenCenter

public EarthLocation getScreenCenter()
                              throws VisADException,
                                     RemoteException
Get the earth location of the screen center

Returns:
screen center
Throws:
RemoteException - On badness
VisADException - On badness

getScreenCoordinates

public List<TwoFacedObject> getScreenCoordinates()
                                          throws VisADException,
                                                 RemoteException
Get a list of named locations of the different points of the view rectangle. e.g., center, upper left, etc.

Returns:
list of locations
Throws:
RemoteException - On badness
VisADException - On badness

init

protected void init()
             throws VisADException,
                    RemoteException
Initialize this object.

Overrides:
init in class NavigatedViewManager
Throws:
RemoteException
VisADException

initUI

protected void initUI()
Initialize the UI

Overrides:
initUI in class ViewManager

fillLegends

protected void fillLegends()
Fill the legends

Overrides:
fillLegends in class ViewManager

perspectiveViewChanged

protected void perspectiveViewChanged(boolean v)
Handle a perspective view change

Overrides:
perspectiveViewChanged in class NavigatedViewManager
Parameters:
v - the value

verticalScaleChanged

protected void verticalScaleChanged()
Handle a vertical scale change

Overrides:
verticalScaleChanged in class NavigatedViewManager

shouldAnimateViewChanges

public boolean shouldAnimateViewChanges()
Should we animate view changes

Returns:
true if not running ISL

displayChanged

public void displayChanged(DisplayEvent event)
                    throws VisADException,
                           RemoteException
Handle the event

Specified by:
displayChanged in interface DisplayListener
Overrides:
displayChanged in class NavigatedViewManager
Parameters:
event - The event
Throws:
RemoteException - On badness
VisADException - On badness

mouseFlicked

protected void mouseFlicked(Point startPoint,
                            Point endPoint,
                            double[] startMatrix,
                            double[] endMatrix,
                            double speed)
Handle the mouse flicked

Overrides:
mouseFlicked in class NavigatedViewManager
Parameters:
startPoint - start point of flick
endPoint - end point of flick
startMatrix - the start matrix
endMatrix - the end matrix
speed - the speed of flicking

checkForKmlImageCapture

protected boolean checkForKmlImageCapture()
Check if its ok to capture a kmz file

Overrides:
checkForKmlImageCapture in class ViewManager
Returns:
ok to capture kmz

canBe

public boolean canBe(ViewManager that)
Can this view manager be used in exchange for the given view manager

Overrides:
canBe in class ViewManager
Parameters:
that - The other view manager to check
Returns:
Can this be used in place of that

initWith

public void initWith(ViewState viewState)
              throws Exception
Initialize with another view

Overrides:
initWith in class ViewManager
Parameters:
viewState - the view state
Throws:
Exception - problems

animationTimeChanged

protected void animationTimeChanged()
Handle the animation time changed

Overrides:
animationTimeChanged in class NavigatedViewManager

initWithInner

protected void initWithInner(ViewManager that,
                             boolean ignoreWindow)
                      throws VisADException,
                             RemoteException
Initialize this object's state with the state from that.

Overrides:
initWithInner in class NavigatedViewManager
Parameters:
that - The other obejct to get state from
ignoreWindow - If true then don't set the window size and location
Throws:
RemoteException - Java RMI problem
VisADException - Couldn't create the VisAD object

initViewState

public void initViewState(ViewState viewState)
Initialize the ViewState

Overrides:
initViewState in class ViewManager
Parameters:
viewState - the ViewState

getInnerContents

public JComponent getInnerContents()
Get the JComponent for the VisAD display

Overrides:
getInnerContents in class ViewManager
Returns:
VisAD display's Component

setMapState

public void setMapState(String ms)
Leave this here for old bundles

Parameters:
ms - The map specification

initPreferences

public void initPreferences(IdvPreferenceManager preferenceManager)
Add in the different preference panels.

Overrides:
initPreferences in class ViewManager
Parameters:
preferenceManager - The preference manager to add things into

goToAddress

public void goToAddress()
Go the a street address


getMapDisplay

public NavigatedDisplay getMapDisplay()
Get the map display.

Returns:
The map display. This is the main display for thie view manager.

isDisplay3D

public boolean isDisplay3D()
Are we in 3d mode

Returns:
Is display in 3d?

receiveShareData

public void receiveShareData(Sharable from,
                             Object dataId,
                             Object[] data)
Handle the receipt of shared data

Specified by:
receiveShareData in interface Sharable
Overrides:
receiveShareData in class NavigatedViewManager
Parameters:
from - Who is it from
dataId - What is it
data - Here it is

getSideComponent

protected JComponent getSideComponent(JComponent sideLegend)
Add the PIP panel if needed

Overrides:
getSideComponent in class ViewManager
Parameters:
sideLegend - The side legend
Returns:
The side legend or the sidelegend coupled with the pip panel

doMakeContents

protected Container doMakeContents()
Make the GUI contents.

Overrides:
doMakeContents in class ViewManager
Returns:
The GUI contents

initToolBars

protected void initToolBars()
Initialize the toolbars for the GUI

Overrides:
initToolBars in class NavigatedViewManager

setViewpointInfo

public void setViewpointInfo(ViewpointInfo viewpointInfo)
Set the viewpoint info

Parameters:
viewpointInfo - the viewpoint info

initializeViewMenu

public void initializeViewMenu(JMenu viewMenu)
Dynamically initialize the view menu

Overrides:
initializeViewMenu in class ViewManager
Parameters:
viewMenu - the view menu

doMakeMenuList

public ArrayList doMakeMenuList()
Create and return the list of menus for the menu bar. Just the map and view menu.

Overrides:
doMakeMenuList in class ViewManager
Returns:
List of menus.

makeShowMenu

protected JMenu makeShowMenu()
Create and return the show menu.

Overrides:
makeShowMenu in class NavigatedViewManager
Returns:
The Show menu

center

public void center(MapProjection mp)
            throws RemoteException,
                   VisADException
Center the display (animated) to the center of the given mapprojection

Parameters:
mp - map projection
Throws:
RemoteException - Java RMI problem
VisADException - VisAD problem

setProjectionFromFirstDisplay

public void setProjectionFromFirstDisplay()
Set the projection to the first projection found in the displays


updateProjection

protected void updateProjection()
                         throws RemoteException,
                                VisADException
If we are using a ProjectionImpl then see if it hsa

Throws:
RemoteException - On badness
VisADException - On badness

setProjectionByName

public void setProjectionByName(String projName)
Find and set the projection by name

Parameters:
projName - projection name

setProjection

public void setProjection(ucar.unidata.geoloc.ProjectionImpl p)
Set the current projection

Parameters:
p - The new projection.

setMapProjection

public void setMapProjection(MapProjection projection,
                             boolean fromWidget)
A wrapper aroung the setMapProjection call that takes a projection name. This passes in null.

Parameters:
projection - The projection
fromWidget - Is it from the projection selection widget

getMainProjection

public MapProjection getMainProjection()
Get the current projection.Used for xml encoding/decoding.

Returns:
The current projection

setMainProjection

public void setMainProjection(MapProjection projection)
Set the current projection. Used for xml encoding/decoding.

Parameters:
projection - The new projection

getMainProjectionName

public String getMainProjectionName()
The main projection name.Used for xml encoding/decoding.

Returns:
Projection name

setMainProjectionName

public void setMainProjectionName(String projectionName)
The main projection name.Used for xml encoding/decoding.

Parameters:
projectionName - Projection name

setDefaultProjectionName

public void setDefaultProjectionName(String value)
Set the DfltProjectionName property.

Parameters:
value - The new value for DfltProjectionName

getDefaultProjectionName

public String getDefaultProjectionName()
Get the DfltProjectionName property.

Returns:
The DfltProjectionName

setMapProjection

public boolean setMapProjection(MapProjection projection,
                                boolean fromWidget,
                                String name)
Set map projection in the main display.

Parameters:
projection - a Projection
fromWidget - true if this was from a widget (ie. widget or menu item)
name - name to put in the history list (may be null)
Returns:
true if successful

setMapProjection

public boolean setMapProjection(MapProjection projection,
                                boolean fromWidget,
                                String name,
                                boolean checkDefault)
Set map projection in the main display.

Parameters:
projection - a Projection
fromWidget - true if this was from a widget (ie. widget or menu item)
name - name to put in the history list (may be null)
checkDefault - if true, check to see if we should call getUseProjectionFromData()
Returns:
true if successful

setMapProjection

public boolean setMapProjection(MapProjection projection,
                                boolean fromWidget,
                                String name,
                                boolean checkDefault,
                                boolean addToCommandHistory)
Set map projection in the main display.

Parameters:
projection - a Projection
fromWidget - true if this was from a widget (ie. widget or menu item)
name - name to put in the history list (may be null)
checkDefault - if true, check to see if we should call getUseProjectionFromData()
addToCommandHistory - Add this projection to the command history
Returns:
true if successful

setMapProjection

public boolean setMapProjection(MapProjection projection,
                                boolean fromWidget,
                                String name,
                                boolean checkDefault,
                                boolean addToCommandHistory,
                                boolean maintainViewpoint)
Set map projection in the main display.

Parameters:
projection - a Projection
fromWidget - true if this was from a widget (ie. widget or menu item)
name - name to put in the history list (may be null)
checkDefault - if true, check to see if we should call getUseProjectionFromData()
addToCommandHistory - Add this projection to the command history
maintainViewpoint - maintain the viewpoint
Returns:
true if successful

checkPipPanel

public void checkPipPanel()
Check the pip panel. If non-null have it reset its box


okToImportDisplay

public boolean okToImportDisplay(DisplayControl control)
can this viewmanager import the given display control

Overrides:
okToImportDisplay in class ViewManager
Parameters:
control - the control
Returns:
ok to import

doneFirstFrame

protected void doneFirstFrame()
Received the first frame done event from the display

Overrides:
doneFirstFrame in class ViewManager

applyProperties

public boolean applyProperties()
Apply the properties

Overrides:
applyProperties in class NavigatedViewManager
Returns:
true if successful

addPropertiesComponents

protected void addPropertiesComponents(JTabbedPane tabbedPane)
Add the properties components for this ViewManager

Overrides:
addPropertiesComponents in class NavigatedViewManager
Parameters:
tabbedPane - the tabbed pane to add to

destroy

public void destroy()
Destroy this ViewManager

Overrides:
destroy in class NavigatedViewManager

showFlythrough

public void showFlythrough()
Show the fly through


flythrough

public void flythrough(float[][] pts)
Do a flythrough

Parameters:
pts - the flythrough points

flythrough

public void flythrough(List<FlythroughPoint> pts)
Flythrough the points

Parameters:
pts - the List of points

initAfterUnPersistence

public final void initAfterUnPersistence(IntegratedDataViewer idv)
                                  throws VisADException,
                                         RemoteException
Initialize after unpersistence

Overrides:
initAfterUnPersistence in class ViewManager
Parameters:
idv - the IDV
Throws:
RemoteException - Java RMI exception
VisADException - VisAD problem

displayDataChanged

public void displayDataChanged(DisplayControl display)
Handle a change to the data in a DisplayControl

Overrides:
displayDataChanged in class ViewManager
Parameters:
display - the DisplayControl

displayDataChanged

public void displayDataChanged(DisplayControl display,
                               boolean fromInitialLoad)
Handle a change to the data in a DisplayControl

Parameters:
display - the DisplayControl
fromInitialLoad - if this is from the initial load

addDisplayInfos

public void addDisplayInfos(List<DisplayInfo> displayInfos)
                     throws RemoteException,
                            VisADException
Reset projection of display based control's getDataProjection(). called by DisplayInfo.addDisplayable (), usually from control's init.

Overrides:
addDisplayInfos in class ViewManager
Parameters:
displayInfos - The List of new display infos to add
Throws:
RemoteException - Java RMI Exception
VisADException - Problem creating VisAD object

checkProjection

public void checkProjection(FieldImpl data,
                            DisplayControl display)
Deprecated. no substitute. Use setMapProjection()

Reset projection of display based on data.

Parameters:
data - The data form the display
display - The display

actionPerformed

public void actionPerformed(ActionEvent event)
Required interface for ActionEvents, to implement ActionListener for the UI objects such as JButton-s and MenuItem-s

Specified by:
actionPerformed in interface ActionListener
Overrides:
actionPerformed in class NavigatedViewManager
Parameters:
event - an ActionEvent

getVisibleGeoBounds

public GeoLocationInfo getVisibleGeoBounds()
Get the bounds that are visible

Overrides:
getVisibleGeoBounds in class ViewManager
Returns:
bounds

setCurrentAsProjection

public void setCurrentAsProjection()
Set the current viewpoint as the projection


showProjectionManager

public void showProjectionManager()
Show the projection manager.


setMapArea

public void setMapArea(ucar.unidata.geoloc.ProjectionRect mapArea)
Set or reset map area of view, using NavigatedDisplay method.

Parameters:
mapArea - ProjectionRect the map area of view

initializeProjectionMenu

public void initializeProjectionMenu(JMenu projectionsMenu)
Init menu

Parameters:
projectionsMenu - menu

initializeDisplaysProjectionMenu

public void initializeDisplaysProjectionMenu(JMenu displaysMenu)
Init menu

Parameters:
displaysMenu - menu

makeProjectionsMenu

public static void makeProjectionsMenu(JMenu projectionsMenu,
                                       List projections,
                                       Object object,
                                       String method)
Make the projections menu. Call the method on the given object.

Parameters:
projectionsMenu - Menu to add to
projections - List of projections
object - object to call
method - method to call

makeProjectionsMenu

public static void makeProjectionsMenu(JMenu projectionsMenu,
                                       List projections,
                                       Object object,
                                       String method,
                                       ucar.unidata.geoloc.ProjectionImpl currentProjection)
Make the projections menu

Parameters:
projectionsMenu - the menu to add to
projections - list of projections
object - object to call
method - method to call
currentProjection - current projection

initializeProjectionHistoryMenu

public void initializeProjectionHistoryMenu(JMenu menu)
Init menu

Parameters:
menu - menu

isCompatibleWith

public boolean isCompatibleWith(ViewManager vm)
Is this a compatible ViewManager

Overrides:
isCompatibleWith in class ViewManager
Parameters:
vm - the other
Returns:
true if compatible

isCompatibleWith

public boolean isCompatibleWith(ViewState viewState)
Is this compatible with the ViewState

Overrides:
isCompatibleWith in class ViewManager
Parameters:
viewState - the view state
Returns:
true if compatible

setMapConfigFile

public void setMapConfigFile(String location)
Have this so we don't get warnings on unpersisting old bundles

Parameters:
location - The location

setUseGlobeDisplay

public void setUseGlobeDisplay(boolean use)
Use globe display. Used for xml encoding/decoding.

Parameters:
use - The globe display value

getUseGlobeDisplay

public boolean getUseGlobeDisplay()
Get the globe display flag. Used for xml encoding/decoding.

Returns:
The globe display value

setUse3D

public void setUse3D(boolean use)
Use a 3D display. Used for xml encoding/decoding.

Parameters:
use - The use 3D display value

getUse3D

public boolean getUse3D()
Get the use 3D display flag. Used for xml encoding/decoding.

Returns:
The use 3D value

handleBooleanPropertyChange

protected void handleBooleanPropertyChange(String id,
                                           boolean value)
                                    throws Exception
The BooleanProperty identified byt he given id has changed. Apply the change to the display.

Overrides:
handleBooleanPropertyChange in class NavigatedViewManager
Parameters:
id - Id of the changed BooleanProperty
value - Its new value
Throws:
Exception - problem handeling the change

getInitialBooleanProperties

protected void getInitialBooleanProperties(List props)
Create the set of BooleanPropertys. These hold all of the different flag based display state.

Overrides:
getInitialBooleanProperties in class NavigatedViewManager
Parameters:
props - the list of properties

setAutoRotate

public void setAutoRotate(boolean value)
Set the autorotate property

Parameters:
value - The value

getAutoRotate

public boolean getAutoRotate()
Get the autorotate flag

Returns:
The flag value

setPerspectiveView

public void setPerspectiveView(boolean value)
Set the perspective view flag

Parameters:
value - The value

getPerspectiveView

public boolean getPerspectiveView()
Get the perspective view flag

Overrides:
getPerspectiveView in class ViewManager
Returns:
The flag value

setShowMap

public void setShowMap(boolean value)
Dummy for old bundles

Parameters:
value - The value

setShowElevation

public void setShowElevation(boolean value)
Dummy for old bundles

Parameters:
value - The value

setUseProjectionFromData

public void setUseProjectionFromData(boolean value)
Set the use projection from data flag

Parameters:
value - The value

getUseProjectionFromData

public boolean getUseProjectionFromData()
Get the use projection from data flag

Returns:
The flag value

setBgColor

public void setBgColor(boolean bgColor)
Deprecated. Keep this around for old bundles

Set the background color property.

Parameters:
bgColor - The value

setShowEarthNavPanel

public void setShowEarthNavPanel(boolean value)
Set the ShowEarthNavPanel property.

Parameters:
value - The new value for ShowEarthNavPanel

getShowEarthNavPanel

public boolean getShowEarthNavPanel()
Get the ShowEarthNavPanel property.

Returns:
The ShowEarthNavPanel

hidePip

public void hidePip()
Hide the pip panel


setShowPip

public void setShowPip(boolean value)
Set the ShowPipPanel property.

Parameters:
value - The new value for ShowPipPanel

getShowPip

public boolean getShowPip()
Get the ShowPipPanel property.

Returns:
The ShowPipPanel

setInitialMapResources

public void setInitialMapResources(String value)
Set the InitialMapResources property. This gets set by the viewmanager properties and is a comma separated list of map resource paths.

Parameters:
value - The new value for InitialMapResources

getTypeName

public String getTypeName()
What type of view is this

Overrides:
getTypeName in class ViewManager
Returns:
The type of view

getDefaultMapPosition

public float getDefaultMapPosition()
Get the default map position from a property

Returns:
the value in the range of -1 to 1

setGlobeBackgroundColor

public void setGlobeBackgroundColor(Color value)
Set the GlobeBackgroundColor property.

Parameters:
value - The new value for GlobeBackgroundColor

getGlobeBackgroundColor

public Color getGlobeBackgroundColor()
Get the GlobeBackgroundColor property.

Returns:
The GlobeBackgroundColor

getGlobeBackgroundColorToUse

public Color getGlobeBackgroundColorToUse()
Get the GlobeBackgroundColor property to be used. If it has not been set then get the preference

Returns:
The GlobeBackgroundColor to use

setGlobeBackgroundShow

public void setGlobeBackgroundShow(boolean value)
Set the GlobeBackgroundShow property.

Parameters:
value - The new value for GlobeBackgroundShow

getGlobeBackgroundShow

public boolean getGlobeBackgroundShow()
Get the GlobeBackgroundShow property.

Returns:
The GlobeBackgroundShow

setGlobeBackgroundLevel

public void setGlobeBackgroundLevel(double value)
Set the GlobeBackgroundLevel property.

Parameters:
value - The new value for GlobeBackgroundLevel

getGlobeBackgroundLevel

public double getGlobeBackgroundLevel()
Get the GlobeBackgroundLevel property.

Returns:
The GlobeBackgroundLevel

setFlythrough

public void setFlythrough(Flythrough value)
Set the Flythrough property.

Parameters:
value - The new value for Flythrough

getFlythrough

public Flythrough getFlythrough()
Get the Flythrough property.

Returns:
The Flythrough

setShowMaps

public void setShowMaps(boolean value)
Set the ShowMaps property.

Parameters:
value - The new value for ShowMaps

getShowMaps

public boolean getShowMaps()
Get the ShowMaps property.

Returns:
The ShowMaps

setDisplayProjectionZoom

public void setDisplayProjectionZoom(double value)
Set the DisplayProjectionZoom property.

Parameters:
value - The new value for DisplayProjectionZoom

getDisplayProjectionZoom

public double getDisplayProjectionZoom()
Get the DisplayProjectionZoom property.

Returns:
The DisplayProjectionZoom

setInitMapPaths

public void setInitMapPaths(String value)
Set the InitMapPaths property.

Parameters:
value - The new value for InitMapPaths

getInitMapPaths

public String getInitMapPaths()
Get the InitMapPaths property.

Returns:
The InitMapPaths

setInitLatLonVisible

public void setInitLatLonVisible(boolean v)
Set the intial lat/lon visible

Parameters:
v - true or false

setInitLatLonColor

public void setInitLatLonColor(Color v)
Set the intial lat/lon color

Parameters:
v - the color

setInitLatLonWidth

public void setInitLatLonWidth(int v)
Set the initial lat/lon line width

Parameters:
v - the width

setInitLatLonSpacing

public void setInitLatLonSpacing(float v)
Set the initial lat/lon spacing

Parameters:
v - the spacing

setInitMapWidth

public void setInitMapWidth(float value)
Set the InitMapWidth property.

Parameters:
value - The new value for InitMapWidth

getInitMapWidth

public float getInitMapWidth()
Get the InitMapWidth property.

Returns:
The InitMapWidth

setInitMapColor

public void setInitMapColor(Color value)
Set the InitMapColor property.

Parameters:
value - The new value for InitMapColor

getInitMapColor

public Color getInitMapColor()
Get the InitMapColor property.

Returns:
The InitMapColor

setInitLatLonBounds

public void setInitLatLonBounds(Rectangle2D.Float value)
Set the InitLatLonBounds property.

Parameters:
value - The new value for InitLatLonBounds

getInitLatLonBounds

public Rectangle2D.Float getInitLatLonBounds()
Get the InitLatLonBounds property.

Returns:
The InitLatLonBounds