public abstract class ChartWrapper extends DisplayComponent implements java.awt.event.KeyListener
Modifier and Type | Class and Description |
---|---|
protected static class |
ChartWrapper.FieldProperties
Class FieldProperties holds state for the data choice wrappers in the properties dialog
|
Modifier and Type | Field and Description |
---|---|
protected AnimationWidget |
animationWidget
The widget
|
protected java.util.List |
dataChoiceWrappers
List of data choices
|
static java.lang.String |
PROP_SELECTEDTIME
Property change id
|
static java.lang.String |
PROP_TIMERANGE
Property change id
|
protected TimeSeriesChartWrapper |
timeFilterSource
This is the time series that we get the time segments from for subsetting
|
protected ChartWrapper |
timeSelectSource
This is the source for time selects
|
CMD_SAVEIMAGE, CMD_SAVEMOVIE, displayControl, displayLabel, hasBeenInitialized, isRemoved, PROP_REMOVED
propertiesDialog
Constructor and Description |
---|
ChartWrapper()
Default ctor
|
ChartWrapper(java.lang.String name,
java.util.List dataChoices)
Ctor
|
Modifier and Type | Method and Description |
---|---|
void |
addDataChoice(DataChoice dataChoice)
Add the dta choice
|
void |
addDataChoices(java.util.List newDataChoices)
Add the data choices
|
void |
addField()
Add a field to thei chart
|
void |
animationTimeChanged(visad.Real time)
Use the animation time to set the domain crosshairs
|
void |
applyJython()
Get the jython text from the text field and apply it
|
protected void |
applyJython(java.lang.String jython)
Evaluate the jython.
|
protected boolean |
applyProperties()
Apply properties
|
protected boolean |
canBeASourceForTimeSelectionEvents()
Can this component be a source for time selection events
|
boolean |
canDoDataChoiceList()
ok to show the data choice list
|
protected boolean |
canDoDriveTime()
Can this chart drive the times in the main display.
|
protected boolean |
canDoJython()
Should the jython field be shown in the properties
|
protected boolean |
canDoMinMaxDate()
Can this chart subset the entire data set on time
|
boolean |
canDoParameters()
Can we add fields
|
boolean |
canDoRemoveParameters()
Can we remove fields
|
protected boolean |
canDoResolution()
Should show resolution widget
|
protected boolean |
canDoTimeFilters()
Can this chart use time subset filters.
|
protected boolean |
canDoTimeSelect()
Can this chart use time selects
This is used to determine whether the checkbox should be shown
in the menus
|
boolean |
canDoWrapperColor()
Can the color swatch be shown in the properties for the data choice wrappers.
|
boolean |
canDoWrapperSide()
Can the Side menu be shown in the properties for the data choice wrappers.
|
protected DataChoiceWrapper |
createDataChoiceWrapper(DataChoice dataChoice)
A utility to create a data choice wrapper
|
protected boolean |
doApplyProperties()
Apply the properties
|
protected javax.swing.JComponent |
doMakeWrapperDisplayComponent(int idx,
ChartWrapper.FieldProperties fieldProperty)
Make the widget for the field
|
boolean |
doMultipleAddFields()
When selecting data does the data tree support multiple selections
|
void |
doRemove()
Cleanup the chart
|
protected double[][] |
filterData(double[] samples,
double[] timeValues)
Utility to pull subset the given samples based on the time filter ranges
|
java.lang.String |
formatValue(double v)
utility to format the value
|
java.lang.String |
getAnimationShareGroup()
Get the AnimationShareGroup property.
|
java.util.List |
getCategories()
Get the data categories for selecting data choices
|
java.util.List |
getDataChoices()
Create and return a list of the data choices held by the data choice wrappers.
|
java.util.List |
getDataChoiceWrappers()
Get the DataChoiceWrappers property.
|
boolean |
getDriveTime()
Get the DriveTime property.
|
java.util.List |
getFieldSelectionLabels()
Returns the list of labels used for selecting data choices.
|
protected visad.FlatField |
getFlatField(visad.FieldImpl data)
Utility to extract a FlatField from the data
|
protected org.python.util.PythonInterpreter |
getInterpreter()
Create, if needed, and return the interpreter
|
java.lang.String |
getJython()
Get the Jython property.
|
double |
getMaxDate()
Get the MaxDate property.
|
double |
getMinDate()
Get the MinDate property.
|
protected java.util.List |
getPopupMenuItems(java.util.List items)
Add the default menu items
|
protected void |
getPropertiesComponents(java.util.List comps,
int tabIdx)
Create the properties contents
|
double |
getResolution()
Get the Resolution property.
|
boolean |
getShowTime()
Get the ShowTime property.
|
protected java.util.List |
getTimeFilterRanges()
Get get list of Ranges for time subsetting.
|
TimeSeriesChartWrapper |
getTimeFilterSource()
Get the FilterSource property.
|
java.util.List |
getTimeRanges()
Get the time ranges to use
|
ChartWrapper |
getTimeSelectSource()
Get the SelectSource property.
|
double[] |
getTimeValues(double[][] samples,
visad.FlatField data)
Convert the time from the data (in samples[1]) into an array
of milliseconds
|
abstract java.lang.String |
getTypeName()
Overwritten by derived classes to return the name of the type of this chart.
|
void |
init(MultiDisplayHolder displayControl,
java.util.List dataChoices)
Initialize
|
void |
initDone()
Called after this chart has been created.
|
protected void |
initializeJython(org.python.util.PythonInterpreter interpreter)
Add the state of this chart to the interpreter
|
void |
keyPressed(java.awt.event.KeyEvent e)
Noop
|
void |
keyReleased(java.awt.event.KeyEvent e)
Noop
|
void |
keyTyped(java.awt.event.KeyEvent e)
Noop
|
void |
loadData()
create shapes for an individual time step.
|
void |
propertyChange(java.beans.PropertyChangeEvent event)
Handle the event
|
void |
removeTimeFilterSource()
Remove the current time filter source
|
void |
removeTimeSelectSource()
Remove the current time select source
|
void |
setAnimationShareGroup(java.lang.String value)
Set the AnimationShareGroup property.
|
void |
setDataChoiceWrappers(java.util.List value)
Set the DataChoiceWrappers property.
|
void |
setDriveTime(boolean value)
Set the DriveTime property.
|
void |
setJython(java.lang.String value)
Set the Jython property.
|
void |
setMaxDate(double value)
Set the MaxDate property.
|
void |
setMinDate(double value)
Set the MinDate property.
|
void |
setResolution(double value)
Set the Resolution property.
|
void |
setShowTime(boolean value)
Set the ShowTime property.
|
void |
setTimeFilterSource(TimeSeriesChartWrapper value)
Set the FilterSource property.
|
void |
setTimeFromAnimation(visad.Real time)
Animation in main display changed.
|
void |
setTimeSelectSource(ChartWrapper value)
Set the SelectSource property.
|
protected java.util.List |
wrapDataChoices(java.util.List choices)
A utility that takes a list of DataChoice-s and
wraps each one in the DataChoiceWrapper.
|
addGroupMenuItems, doMakeContents, doMakeDisplayLabel, doSaveImage, doSaveMovie, getBackgroundColor, getContents, getDisplayables, getDisplayControl, getDisplayGroup, getDisplayLabel, getIsRemoved, getLabelShown, getName, initAfterUnPersistence, removeDisplayComponent, setBackgroundColor, setDisplayControl, setDisplayGroup, setIsRemoved, setLabelShown, setName, showPopup, showProperties, toString
addPropertyChangeListener, firePropertyChange, firePropertyChange, getPropertyListeners, getPropertyTabs, isShowing, removePropertyChangeListener, showProperties
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, receiveShareData, removeSharable, setReceiveShareTime, setShareGroup, setSharing, setUniqueId, showSharableDialog
public static final java.lang.String PROP_TIMERANGE
public static final java.lang.String PROP_SELECTEDTIME
protected AnimationWidget animationWidget
protected java.util.List dataChoiceWrappers
protected TimeSeriesChartWrapper timeFilterSource
protected ChartWrapper timeSelectSource
public ChartWrapper()
public ChartWrapper(java.lang.String name, java.util.List dataChoices)
name
- The namedataChoices
- List of data choicespublic java.util.List getCategories()
public void init(MultiDisplayHolder displayControl, java.util.List dataChoices)
displayControl
- The display control we're in.dataChoices
- List of data choicespublic void initDone()
initDone
in class DisplayComponent
protected visad.FlatField getFlatField(visad.FieldImpl data) throws visad.VisADException, java.rmi.RemoteException
data
- The datajava.rmi.RemoteException
- On badnessvisad.VisADException
- On badnesspublic abstract java.lang.String getTypeName()
getTypeName
in class DisplayComponent
public void keyPressed(java.awt.event.KeyEvent e)
keyPressed
in interface java.awt.event.KeyListener
e
- The eventpublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased
in interface java.awt.event.KeyListener
e
- The eventpublic void keyTyped(java.awt.event.KeyEvent e)
keyTyped
in interface java.awt.event.KeyListener
e
- The eventprotected java.util.List wrapDataChoices(java.util.List choices)
choices
- List of data choicesprotected DataChoiceWrapper createDataChoiceWrapper(DataChoice dataChoice)
dataChoice
- The data choiceprotected java.util.List getTimeFilterRanges()
public java.util.List getTimeRanges()
protected java.util.List getPopupMenuItems(java.util.List items)
getPopupMenuItems
in class DisplayComponent
items
- List of menu itemsprotected org.python.util.PythonInterpreter getInterpreter()
public void applyJython()
protected void applyJython(java.lang.String jython)
jython
- The jythonprotected void initializeJython(org.python.util.PythonInterpreter interpreter)
interpreter
- The interpreter to initializeprotected boolean canDoJython()
protected boolean canBeASourceForTimeSelectionEvents()
protected boolean canDoTimeFilters()
protected boolean canDoTimeSelect()
protected boolean canDoDriveTime()
protected boolean canDoMinMaxDate()
protected boolean canDoResolution()
public boolean canDoParameters()
public boolean canDoRemoveParameters()
public boolean canDoDataChoiceList()
public boolean canDoWrapperColor()
public boolean canDoWrapperSide()
public void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange
in interface java.beans.PropertyChangeListener
propertyChange
in class PropertiedThing
event
- The eventpublic void doRemove()
doRemove
in class DisplayComponent
protected void getPropertiesComponents(java.util.List comps, int tabIdx)
getPropertiesComponents
in class DisplayComponent
comps
- List of componentstabIdx
- Which tabprotected javax.swing.JComponent doMakeWrapperDisplayComponent(int idx, ChartWrapper.FieldProperties fieldProperty)
idx
- which onefieldProperty
- The wrapper wrapperprotected boolean applyProperties()
applyProperties
in class DisplayComponent
protected boolean doApplyProperties()
doApplyProperties
in class DisplayComponent
public void addField()
public java.util.List getFieldSelectionLabels()
public boolean doMultipleAddFields()
public java.lang.String formatValue(double v)
v
- the valuepublic void addDataChoice(DataChoice dataChoice) throws visad.VisADException, java.rmi.RemoteException
dataChoice
- the choicejava.rmi.RemoteException
- On badnessvisad.VisADException
- On badnesspublic void addDataChoices(java.util.List newDataChoices) throws visad.VisADException, java.rmi.RemoteException
newDataChoices
- the choicesjava.rmi.RemoteException
- On badnessvisad.VisADException
- On badnesspublic void loadData() throws visad.VisADException, java.rmi.RemoteException
loadData
in class DisplayComponent
java.rmi.RemoteException
- On badnessvisad.VisADException
- On badnesspublic void setTimeFromAnimation(visad.Real time)
time
- the animation timepublic void animationTimeChanged(visad.Real time)
animationTimeChanged
in class DisplayComponent
time
- The timepublic void setDataChoiceWrappers(java.util.List value)
value
- The new value for DataChoiceWrapperspublic java.util.List getDataChoiceWrappers()
public void setResolution(double value)
value
- The new value for Resolutionpublic double getResolution()
public java.util.List getDataChoices()
public void removeTimeFilterSource()
public void setTimeFilterSource(TimeSeriesChartWrapper value)
value
- The new value for FilterSourcepublic TimeSeriesChartWrapper getTimeFilterSource()
public void removeTimeSelectSource()
public void setTimeSelectSource(ChartWrapper value)
value
- The new value for SelectSourcepublic ChartWrapper getTimeSelectSource()
protected double[][] filterData(double[] samples, double[] timeValues) throws visad.VisADException, java.rmi.RemoteException
samples
- The datatimeValues
- The timesjava.rmi.RemoteException
- On badness_visad.VisADException
- On badness_public double[] getTimeValues(double[][] samples, visad.FlatField data) throws visad.VisADException, java.rmi.RemoteException
samples
- The datadata
- Where the data came fromjava.rmi.RemoteException
- On badnessvisad.VisADException
- On badnesspublic void setShowTime(boolean value)
value
- The new value for ShowTimepublic boolean getShowTime()
public void setDriveTime(boolean value)
value
- The new value for DriveTimepublic boolean getDriveTime()
public void setMinDate(double value)
value
- The new value for MinDatepublic double getMinDate()
public void setMaxDate(double value)
value
- The new value for MaxDatepublic double getMaxDate()
public void setJython(java.lang.String value)
value
- The new value for Jythonpublic java.lang.String getJython()
public void setAnimationShareGroup(java.lang.String value)
value
- The new value for AnimationShareGrouppublic java.lang.String getAnimationShareGroup()