edu.wisc.ssec.mcidasv.control.cyclone
Class StormDisplayState

java.lang.Object
  extended by edu.wisc.ssec.mcidasv.control.cyclone.StormDisplayState

public class StormDisplayState
extends Object

Part of the McV/IDV implementation of AODT

Version:
$Revision$
Author:
Unidata Development Team, McIDAS-V Development Team

Nested Class Summary
private static class StormDisplayState.ParamSelector
          Class ParamSelector _more_
private  class StormDisplayState.PointEditCommand
          Class PointEditCommand _more_
 
Field Summary
private  boolean active
          _more_
private  boolean changed
          _more_
private  List<StormTrackChart> charts
          _more_
private  boolean colorRangeChanged
          _more_
private static Color[] colors
          The array of colors we cycle through
private  CommandManager commandManager
          _more_
private static Data DUMMY_DATA
          _more_
(package private)  JCheckBox editedCbx
          _more_
private  ucar.unidata.data.storm.StormTrack editedStormTrack
          _more_
private  ucar.unidata.data.storm.StormTrackPoint editedStormTrackPoint
          _more_
static PatternFileFilter FILTER_DAT
          _more_
private static int FORECAST_TIME_MODE
          _more_
private  int forecastAnimationMode
          _more_
(package private)  JCheckBox forecastCbx
          _more_
private  JLabel forecastColorTableLabel
          _more_
private  String forecastLayoutModelName
          _more_
private  WayDisplayState forecastState
          _more_
private  boolean hasBeenEdited
          _more_
private  boolean haveLoadedForecasts
          _more_
private  CompositeDisplayable holder
          _more_
private static String ID_FORECAST_COLOR
          _more_
private static String ID_FORECAST_CONE
          _more_
private static String ID_FORECAST_LAYOUTMODEL
          _more_
private static String ID_FORECAST_RINGS
          _more_
private static String ID_OBS_COLOR
          _more_
private static String ID_OBS_CONE
          _more_
private static String ID_OBS_LAYOUTMODEL
          _more_
private static String ID_OBS_RINGS
          _more_
private  boolean isOnlyChild
          _more_
private  JComponent mainContents
          _more_
(package private)  JCheckBox mostRecentCbx
          _more_
private  Object MUTEX
          _more_
private static int[] nextColor
          _more_
(package private)  JCheckBox obsCbx
          _more_
private  JLabel obsColorTableLabel
          _more_
private  WayDisplayState obsDisplayState
          _more_
private  String obsLayoutModelName
          _more_
private  String obsPointLayoutModelName
          _more_
private  JComponent originalContents
          _more_
private  Hashtable params
          _more_
static String PROP_TRACK_TABLE
          _more_
private  ucar.unidata.data.storm.StormInfo stormInfo
          _more_
private  StormTrackControl stormTrackControl
          _more_
private  JTabbedPane tabbedPane
          _more_
private  List<StormTrackTableModel> tableModels
          _more_
private  TreePanel tableTreePanel
          _more_
private  JComboBox timeModeBox
          _more_
private  DisplayableData timesHolder
          time holder
private  ucar.unidata.data.storm.StormTrackCollection trackCollection
          _more_
private  int wayCnt
          _more_
private  Hashtable<ucar.unidata.data.storm.Way,WayDisplayState> wayDisplayStateMap
          _more_
(package private) static int xcnt
          _more_
 
Constructor Summary
StormDisplayState()
          _more_
StormDisplayState(ucar.unidata.data.storm.StormInfo stormInfo)
          _more_
 
Method Summary
protected  void addDisplayable(Displayable displayable)
          _more_
 void addForecastChart(int mode)
          _more_
 void addForecastHourChart()
          _more_
 void addForecastTimeChart()
          _more_
protected  boolean canShowWay(ucar.unidata.data.storm.Way way)
          _more_
private  void checkVisibility()
          _more_
 void colorRangeChanged()
           
 void colorTableChanged()
          _more_
 void deactivate()
          _more_
protected  void displayStateChanged(DisplayState displayState)
          _more_
private  JComponent doMakeContents()
          _more_
 void flythroughTrack(ucar.unidata.data.storm.StormTrack track)
          _more_
 boolean getActive()
          Get the Active property.
 ucar.unidata.geoloc.LatLonRect getBoundingBox()
          _more_
 boolean getChanged()
          Get the Changed property.
 List<StormTrackChart> getCharts()
          Get the Charts property.
protected  ucar.unidata.data.storm.StormParam getColorParam(boolean forObs)
          _more_
protected  ucar.unidata.data.storm.StormParam getColorParam(WayDisplayState way)
          _more_
protected  ColorTable getColorTable(ucar.unidata.data.storm.StormParam param)
          _more_
protected  String getColorTableToolTip(boolean forObs)
          _more_
private  CommandManager getCommandManager()
          _more_
protected  List<ucar.unidata.data.storm.StormParam> getConeParams(WayDisplayState way)
          _more_
 JComponent getContents()
          _more_
private  List<ucar.unidata.data.storm.StormParam> getDistanceParams(List<ucar.unidata.data.storm.StormParam> params)
          _more_
(package private)  ucar.unidata.data.storm.StormParam getFixedParam()
           
 int getForecastAnimationMode()
          _more_
protected  StationModel getForecastLayoutModel()
          _more_
 String getForecastLayoutModelName()
          Get the ForecastLayoutModelName property.
 WayDisplayState getForecastState()
          Get the ForecastState property.
 boolean getForecastVisible()
          _more_
static Color getNextColor(int[] nextColor)
          Cycle through the color list.
 WayDisplayState getObservationState()
          Get the ForecastState property.
protected  StationModel getObsLayoutModel()
          _more_
 String getObsLayoutModelName()
          Get the ObsLayoutModelName property.
protected  StationModel getObsPointLayoutModel()
          _more_
 String getObsPointLayoutModelName()
          Get the ObsLayoutModelName property.
 Hashtable getParams()
          Get the Params property.
protected  List<ucar.unidata.data.storm.StormParam> getParams(Object id)
          _more_
protected  ucar.unidata.data.storm.StormParam getRingsParam(WayDisplayState way)
          _more_
 List<ucar.unidata.data.storm.StormParam> getStormChartParams()
          _more_
 ucar.unidata.data.storm.StormInfo getStormInfo()
          Get the StormInfo property.
protected  StormTrackControl getStormTrackControl()
          _more_
protected  ucar.unidata.data.storm.StormTrackCollection getTrackCollection()
          _more_
private  JComponent getTrackTable()
          _more_
protected  WayDisplayState getWayDisplayState(ucar.unidata.data.storm.Way way)
          _more_
 Hashtable<ucar.unidata.data.storm.Way,WayDisplayState> getWayDisplayStateMap()
          Get the WayDisplayStateMap property.
protected  List<WayDisplayState> getWayDisplayStates()
          _more_
protected  void handleChangedStationModel(String name)
          _more_
 void handleEvent(DisplayEvent event)
          _more_
private  void handleMouseDrag(DisplayEvent event, EarthLocation newPt)
          _more_
private  void initCenterContents()
          _more_
 void initDone()
          _more_
 boolean isColorRangeChanged()
          _more_
 void loadStorm()
          _more_
private  JComponent makeBox(List stormParams, Object id, String tooltip)
          _more_
private  JComponent makeList(List stormParams, Object id)
          _more_
protected  EarthLocation makePoint(double latitude, double longitude)
          _more_
 void markHasBeenEdited()
          _more_
protected  boolean okToShowWay(ucar.unidata.data.storm.Way way)
          Check if its ok to show the given way. if we have less than 2 ways total then always showit
protected  void reload()
          _more_
protected  void reloadChart()
          _more_
protected  void removeChart(StormTrackChart stormTrackChart)
          _more_
 void setActive(boolean value)
          Set the Active property.
 void setChanged(boolean value)
          Set the Changed property.
 void setCharts(List<StormTrackChart> value)
          Set the Charts property.
 void setForecastAnimationMode(int value)
          _more_
 void setForecastLayoutModel(StationModel sm)
          _more_
 void setForecastLayoutModelName(String value)
          Set the ForecastLayoutModelName property.
 void setForecastState(WayDisplayState value)
          Set the ForecastState property.
protected  void setIsOnlyChild(boolean isOnlyChild)
          _more_
 void setObservationState(WayDisplayState value)
          Set the ForecastState property.
 void setObsLayoutModel(StationModel sm)
          _more_
 void setObsLayoutModelName(String value)
          Set the ObsLayoutModelName property.
 void setObsPointLayoutModel(StationModel sm)
          _more_
 void setObsPointLayoutModelName(String value)
          Set the ObsLayoutModelName property.
 void setParams(Hashtable value)
          Set the Params property.
 void setStormInfo(ucar.unidata.data.storm.StormInfo value)
          Set the StormInfo property.
protected  void setStormTrackControl(StormTrackControl stormTrackControl)
          _more_
 void setWayDisplayStateMap(Hashtable<ucar.unidata.data.storm.Way,WayDisplayState> value)
          Set the WayDisplayStateMap property.
protected  void showStorm()
          _more_
private  void showStormInner()
          _more_
protected  void timeChanged(Real time)
          _more_
protected  void updateCharts()
          _more_
protected  void updateDisplays()
          _more_
protected  void updateDisplays(boolean force)
          _more_
protected  void updateDisplays(ucar.unidata.data.storm.StormTrack track)
          _more_
 void updateLayoutModel(boolean forObs)
          _more_
protected  void write(org.apache.poi.hssf.usermodel.HSSFWorkbook wb, ucar.unidata.data.storm.StormTrack track, Hashtable sheetNames)
          _more_
 void writeToDataFile()
          _more_
 void writeToKml(Element docNode, Hashtable state, boolean doObs, boolean doForecast, boolean mostRecent)
          _more_
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_TRACK_TABLE

public static final String PROP_TRACK_TABLE
_more_

See Also:
Constant Field Values

ID_OBS_CONE

private static String ID_OBS_CONE
_more_


ID_OBS_RINGS

private static String ID_OBS_RINGS
_more_


ID_OBS_LAYOUTMODEL

private static String ID_OBS_LAYOUTMODEL
_more_


ID_FORECAST_CONE

private static String ID_FORECAST_CONE
_more_


ID_FORECAST_RINGS

private static String ID_FORECAST_RINGS
_more_


ID_FORECAST_COLOR

private static String ID_FORECAST_COLOR
_more_


ID_FORECAST_LAYOUTMODEL

private static String ID_FORECAST_LAYOUTMODEL
_more_


ID_OBS_COLOR

private static String ID_OBS_COLOR
_more_


colors

private static Color[] colors
The array of colors we cycle through


hasBeenEdited

private boolean hasBeenEdited
_more_


colorRangeChanged

private boolean colorRangeChanged
_more_


nextColor

private static int[] nextColor
_more_


obsColorTableLabel

private JLabel obsColorTableLabel
_more_


forecastColorTableLabel

private JLabel forecastColorTableLabel
_more_


charts

private List<StormTrackChart> charts
_more_


tableModels

private List<StormTrackTableModel> tableModels
_more_


tableTreePanel

private TreePanel tableTreePanel
_more_


MUTEX

private Object MUTEX
_more_


DUMMY_DATA

private static final Data DUMMY_DATA
_more_


holder

private CompositeDisplayable holder
_more_


isOnlyChild

private boolean isOnlyChild
_more_


stormInfo

private ucar.unidata.data.storm.StormInfo stormInfo
_more_


forecastState

private WayDisplayState forecastState
_more_


haveLoadedForecasts

private boolean haveLoadedForecasts
_more_


changed

private boolean changed
_more_


active

private boolean active
_more_


trackCollection

private ucar.unidata.data.storm.StormTrackCollection trackCollection
_more_


stormTrackControl

private StormTrackControl stormTrackControl
_more_


obsDisplayState

private WayDisplayState obsDisplayState
_more_


obsLayoutModelName

private String obsLayoutModelName
_more_


obsPointLayoutModelName

private String obsPointLayoutModelName
_more_


forecastLayoutModelName

private String forecastLayoutModelName
_more_


timesHolder

private DisplayableData timesHolder
time holder


mainContents

private JComponent mainContents
_more_


tabbedPane

private JTabbedPane tabbedPane
_more_


originalContents

private JComponent originalContents
_more_


params

private Hashtable params
_more_


FORECAST_TIME_MODE

private static final int FORECAST_TIME_MODE
_more_

See Also:
Constant Field Values

forecastAnimationMode

private int forecastAnimationMode
_more_


timeModeBox

private JComboBox timeModeBox
_more_


wayDisplayStateMap

private Hashtable<ucar.unidata.data.storm.Way,WayDisplayState> wayDisplayStateMap
_more_


commandManager

private CommandManager commandManager
_more_


wayCnt

private int wayCnt
_more_


editedStormTrack

private ucar.unidata.data.storm.StormTrack editedStormTrack
_more_


editedStormTrackPoint

private ucar.unidata.data.storm.StormTrackPoint editedStormTrackPoint
_more_


xcnt

static int xcnt
_more_


FILTER_DAT

public static final PatternFileFilter FILTER_DAT
_more_


obsCbx

JCheckBox obsCbx
_more_


forecastCbx

JCheckBox forecastCbx
_more_


mostRecentCbx

JCheckBox mostRecentCbx
_more_


editedCbx

JCheckBox editedCbx
_more_

Constructor Detail

StormDisplayState

public StormDisplayState()
_more_


StormDisplayState

public StormDisplayState(ucar.unidata.data.storm.StormInfo stormInfo)
                  throws Exception
_more_

Parameters:
stormInfo - _more_
Throws:
Exception - _more_
Method Detail

getCommandManager

private CommandManager getCommandManager()
_more_

Returns:
_more_

checkVisibility

private void checkVisibility()
_more_


colorTableChanged

public void colorTableChanged()
_more_


handleEvent

public void handleEvent(DisplayEvent event)
                 throws Exception
_more_

Parameters:
event - _more_
Throws:
Exception - _more_

handleMouseDrag

private void handleMouseDrag(DisplayEvent event,
                             EarthLocation newPt)
                      throws Exception
_more_

Parameters:
event - _more_
newPt - _more_
Throws:
Exception - _more_

makePoint

protected EarthLocation makePoint(double latitude,
                                  double longitude)
                           throws VisADException,
                                  RemoteException
_more_

Parameters:
latitude - _more_
longitude - _more_
Returns:
_more_
Throws:
RemoteException - _more_
VisADException - _more_

okToShowWay

protected boolean okToShowWay(ucar.unidata.data.storm.Way way)
Check if its ok to show the given way. if we have less than 2 ways total then always showit

Parameters:
way - _more_
Returns:
_more_

getBoundingBox

public ucar.unidata.geoloc.LatLonRect getBoundingBox()
_more_

Returns:
_more_

setIsOnlyChild

protected void setIsOnlyChild(boolean isOnlyChild)
_more_

Parameters:
isOnlyChild - _more_

getContents

public JComponent getContents()
_more_

Returns:
_more_

getWayDisplayStates

protected List<WayDisplayState> getWayDisplayStates()
_more_

Returns:
_more_

getWayDisplayState

protected WayDisplayState getWayDisplayState(ucar.unidata.data.storm.Way way)
_more_

Parameters:
way - _more_
Returns:
_more_

reload

protected void reload()
_more_


loadStorm

public void loadStorm()
_more_


reloadChart

protected void reloadChart()
_more_


getTrackCollection

protected ucar.unidata.data.storm.StormTrackCollection getTrackCollection()
_more_

Returns:
_more_

setObsLayoutModel

public void setObsLayoutModel(StationModel sm)
_more_

Parameters:
sm - _more_

setObsPointLayoutModel

public void setObsPointLayoutModel(StationModel sm)
_more_

Parameters:
sm - _more_

setForecastLayoutModel

public void setForecastLayoutModel(StationModel sm)
_more_

Parameters:
sm - _more_

handleChangedStationModel

protected void handleChangedStationModel(String name)
_more_

Parameters:
name - _more_

updateLayoutModel

public void updateLayoutModel(boolean forObs)
_more_

Parameters:
forObs - _more_

deactivate

public void deactivate()
_more_


doMakeContents

private JComponent doMakeContents()
_more_

Returns:
_more_

initDone

public void initDone()
_more_


getForecastVisible

public boolean getForecastVisible()
_more_

Returns:
_more_

makeList

private JComponent makeList(List stormParams,
                            Object id)
_more_

Parameters:
stormParams - _more_
id - _more_
Returns:
_more_

makeBox

private JComponent makeBox(List stormParams,
                           Object id,
                           String tooltip)
_more_

Parameters:
stormParams - _more_
id - _more_
tooltip - _more_
Returns:
_more_

getDistanceParams

private List<ucar.unidata.data.storm.StormParam> getDistanceParams(List<ucar.unidata.data.storm.StormParam> params)
_more_

Parameters:
params - _more_
Returns:
_more_

getFixedParam

ucar.unidata.data.storm.StormParam getFixedParam()

initCenterContents

private void initCenterContents()
_more_


timeChanged

protected void timeChanged(Real time)
_more_

Parameters:
time - _more_

canShowWay

protected boolean canShowWay(ucar.unidata.data.storm.Way way)
_more_

Parameters:
way - _more_
Returns:
_more_

setStormTrackControl

protected void setStormTrackControl(StormTrackControl stormTrackControl)
_more_

Parameters:
stormTrackControl - _more_

showStorm

protected void showStorm()
_more_


addDisplayable

protected void addDisplayable(Displayable displayable)
                       throws VisADException,
                              RemoteException
_more_

Parameters:
displayable - _more_
Throws:
RemoteException - _more_
VisADException - _more_

getStormTrackControl

protected StormTrackControl getStormTrackControl()
_more_

Returns:
_more_

showStormInner

private void showStormInner()
                     throws Exception
_more_

Throws:
Exception - _more_

getParams

protected List<ucar.unidata.data.storm.StormParam> getParams(Object id)
_more_

Parameters:
id - _more_
Returns:
_more_

getConeParams

protected List<ucar.unidata.data.storm.StormParam> getConeParams(WayDisplayState way)
_more_

Parameters:
way - _more_
Returns:
_more_

getRingsParam

protected ucar.unidata.data.storm.StormParam getRingsParam(WayDisplayState way)
_more_

Parameters:
way - _more_
Returns:
_more_

getColorParam

protected ucar.unidata.data.storm.StormParam getColorParam(WayDisplayState way)
_more_

Parameters:
way - _more_
Returns:
_more_

getColorParam

protected ucar.unidata.data.storm.StormParam getColorParam(boolean forObs)
_more_

Parameters:
forObs - _more_
Returns:
_more_

updateCharts

protected void updateCharts()
                     throws Exception
_more_

Throws:
Exception - _more_

displayStateChanged

protected void displayStateChanged(DisplayState displayState)
                            throws Exception
_more_

Parameters:
displayState - _more_
Throws:
Exception - _more_

updateDisplays

protected void updateDisplays(ucar.unidata.data.storm.StormTrack track)
                       throws Exception
_more_

Parameters:
track - _more_
Throws:
Exception - _more_

updateDisplays

protected void updateDisplays()
                       throws Exception
_more_

Throws:
Exception - _more_

updateDisplays

protected void updateDisplays(boolean force)
                       throws Exception
_more_

Parameters:
force - _more_
Throws:
Exception - _more_

getColorTableToolTip

protected String getColorTableToolTip(boolean forObs)
_more_

Parameters:
forObs - _more_
Returns:
_more_

getColorTable

protected ColorTable getColorTable(ucar.unidata.data.storm.StormParam param)
_more_

Parameters:
param - _more_
Returns:
_more_

getObsLayoutModel

protected StationModel getObsLayoutModel()
_more_

Returns:
_more_

getObsPointLayoutModel

protected StationModel getObsPointLayoutModel()
_more_

Returns:
_more_

getForecastLayoutModel

protected StationModel getForecastLayoutModel()
_more_

Returns:
_more_

removeChart

protected void removeChart(StormTrackChart stormTrackChart)
_more_

Parameters:
stormTrackChart - _more_

addForecastTimeChart

public void addForecastTimeChart()
_more_


addForecastHourChart

public void addForecastHourChart()
_more_


addForecastChart

public void addForecastChart(int mode)
_more_

Parameters:
mode - _more_

getStormChartParams

public List<ucar.unidata.data.storm.StormParam> getStormChartParams()
_more_

Returns:
_more_

getTrackTable

private JComponent getTrackTable()
_more_

Returns:
_more_

flythroughTrack

public void flythroughTrack(ucar.unidata.data.storm.StormTrack track)
_more_

Parameters:
track - _more_

writeToDataFile

public void writeToDataFile()
_more_


write

protected void write(org.apache.poi.hssf.usermodel.HSSFWorkbook wb,
                     ucar.unidata.data.storm.StormTrack track,
                     Hashtable sheetNames)
_more_

Parameters:
wb - _more_
track - _more_
sheetNames - _more_

writeToKml

public void writeToKml(Element docNode,
                       Hashtable state,
                       boolean doObs,
                       boolean doForecast,
                       boolean mostRecent)
                throws VisADException,
                       RemoteException
_more_

Parameters:
docNode - _more_
state - _more_
doObs - _more_
doForecast - _more_
mostRecent - _more_
Throws:
RemoteException - _more_
VisADException - _more_

setStormInfo

public void setStormInfo(ucar.unidata.data.storm.StormInfo value)
Set the StormInfo property.

Parameters:
value - The new value for StormInfo

getStormInfo

public ucar.unidata.data.storm.StormInfo getStormInfo()
Get the StormInfo property.

Returns:
The StormInfo

setChanged

public void setChanged(boolean value)
Set the Changed property.

Parameters:
value - The new value for Changed

getChanged

public boolean getChanged()
Get the Changed property.

Returns:
The Changed

setActive

public void setActive(boolean value)
Set the Active property.

Parameters:
value - The new value for Active

getActive

public boolean getActive()
Get the Active property.

Returns:
The Active

setWayDisplayStateMap

public void setWayDisplayStateMap(Hashtable<ucar.unidata.data.storm.Way,WayDisplayState> value)
Set the WayDisplayStateMap property.

Parameters:
value - The new value for WayDisplayStateMap

getWayDisplayStateMap

public Hashtable<ucar.unidata.data.storm.Way,WayDisplayState> getWayDisplayStateMap()
Get the WayDisplayStateMap property.

Returns:
The WayDisplayStateMap

setForecastState

public void setForecastState(WayDisplayState value)
Set the ForecastState property.

Parameters:
value - The new value for ForecastState

getObservationState

public WayDisplayState getObservationState()
Get the ForecastState property.

Returns:
The ForecastState

setObservationState

public void setObservationState(WayDisplayState value)
Set the ForecastState property.

Parameters:
value - The new value for ForecastState

getForecastState

public WayDisplayState getForecastState()
Get the ForecastState property.

Returns:
The ForecastState

getNextColor

public static Color getNextColor(int[] nextColor)
Cycle through the color list.

Parameters:
nextColor - _more_
Returns:
The next color in the list

setCharts

public void setCharts(List<StormTrackChart> value)
Set the Charts property.

Parameters:
value - The new value for Charts

getCharts

public List<StormTrackChart> getCharts()
Get the Charts property.

Returns:
The Charts

setParams

public void setParams(Hashtable value)
Set the Params property.

Parameters:
value - The new value for Params

getParams

public Hashtable getParams()
Get the Params property.

Returns:
The Params

setObsLayoutModelName

public void setObsLayoutModelName(String value)
Set the ObsLayoutModelName property.

Parameters:
value - The new value for ObsLayoutModelName

getObsLayoutModelName

public String getObsLayoutModelName()
Get the ObsLayoutModelName property.

Returns:
The ObsLayoutModelName

setObsPointLayoutModelName

public void setObsPointLayoutModelName(String value)
Set the ObsLayoutModelName property.

Parameters:
value - The new value for ObsLayoutModelName

getObsPointLayoutModelName

public String getObsPointLayoutModelName()
Get the ObsLayoutModelName property.

Returns:
The ObsLayoutModelName

setForecastLayoutModelName

public void setForecastLayoutModelName(String value)
Set the ForecastLayoutModelName property.

Parameters:
value - The new value for ForecastLayoutModelName

getForecastLayoutModelName

public String getForecastLayoutModelName()
Get the ForecastLayoutModelName property.

Returns:
The ForecastLayoutModelName

getForecastAnimationMode

public int getForecastAnimationMode()
_more_

Returns:
_more_

setForecastAnimationMode

public void setForecastAnimationMode(int value)
_more_

Parameters:
value - _more_

markHasBeenEdited

public void markHasBeenEdited()
_more_


colorRangeChanged

public void colorRangeChanged()

isColorRangeChanged

public boolean isColorRangeChanged()
_more_