ucar.unidata.idv.control.chart
Class PlotWrapper

java.lang.Object
  extended by ucar.unidata.collab.SharableImpl
      extended by ucar.unidata.collab.PropertiedThing
          extended by ucar.unidata.idv.control.multi.DisplayComponent
              extended by ucar.unidata.idv.control.chart.ChartWrapper
                  extended by ucar.unidata.idv.control.chart.PlotWrapper
All Implemented Interfaces:
KeyListener, PropertyChangeListener, EventListener, Sharable
Direct Known Subclasses:
HistogramWrapper, ScatterPlotChartWrapper, TimeSeriesChartWrapper

public abstract class PlotWrapper
extends ChartWrapper
implements KeyListener

Abstract class for chart implementations

Version:
$Revision: 1.15 $
Author:
IDV Development Team

Nested Class Summary
protected  class PlotWrapper.MyChartPanel
          Class MyChartPanel adds items to a popup menu
 
Nested classes/interfaces inherited from class ucar.unidata.idv.control.chart.ChartWrapper
ChartWrapper.FieldProperties
 
Field Summary
protected  org.jfree.chart.JFreeChart chart
          The chart
protected  PlotWrapper.MyChartPanel chartPanel
          The main chart gui component
protected static boolean EVENT_DONTPASSON
          Used by the MyChartPanel event bridge
protected static boolean EVENT_PASSON
          Used by the MyChartPanel event bridge
 
Fields inherited from class ucar.unidata.idv.control.chart.ChartWrapper
animationWidget, dataChoiceWrappers, PROP_SELECTEDTIME, PROP_TIMERANGE, timeFilterSource, timeSelectSource
 
Fields inherited from class ucar.unidata.idv.control.multi.DisplayComponent
CMD_SAVEIMAGE, CMD_SAVEMOVIE, displayControl, displayLabel, hasBeenInitialized, isRemoved, PROP_REMOVED
 
Fields inherited from class ucar.unidata.collab.PropertiedThing
propertiesDialog
 
Constructor Summary
PlotWrapper()
          Default ctor
PlotWrapper(String name, List dataChoices)
          Ctor
 
Method Summary
 void annotationChanged(ChartAnnotation chartAnnotation)
          The annotation changed somehow
protected  boolean applyProperties()
          Apply properties
protected  boolean canDoColors()
          Can this chart do colors
 String chartPanelGetToolTipText(MouseEvent event)
          Hook to intercept these calls on the chart
 boolean chartPanelMouseClicked(MouseEvent e)
          Hook to intercept these calls on the chart
 boolean chartPanelMouseDragged(MouseEvent event)
          Hook to intercept these calls on the chart
 boolean chartPanelMousePressed(MouseEvent e)
          Hook to intercept these calls on the chart
 boolean chartPanelMouseReleased(MouseEvent event)
          Hook to intercept these calls on the chart
protected  PlotWrapper.MyChartPanel doMakeChartPanel(org.jfree.chart.JFreeChart chart)
          Make the panel for the chart
 boolean getAutoRange()
          Get the AutoRange property.
 Color getBackgroundColor()
          Get the BackgroundColor property.
protected  org.jfree.chart.ChartPanel getChartPanel()
          Get the chart
 Color getDataAreaColor()
          Get the DataAreaColor property.
 LineState getDomainLineState()
          Get the DomainLineState property.
protected  List getPopupMenuItems(List items)
          Get the menu items
protected  Dimension getPreferredChartSize()
          Get the chart size
protected  void getPropertiesComponents(List comps, int tabIdx)
          Create the properties contents
 String[] getPropertyTabs()
          Get the list of tab names for the properties dialog
 LineState getRangeLineState()
          Get the RangeLineState property.
protected  void initXYPlot(org.jfree.chart.plot.XYPlot plot)
          Utility to init xy plots
 void keyPressed(KeyEvent e)
          Handle event
 void keyReleased(KeyEvent e)
          Noop
 void keyTyped(KeyEvent e)
          Noop
 boolean okToDraw(ChartAnnotation annotation)
          Is the annotation ok to draw
protected  void panPlot(boolean right)
          Pan plot
protected  void panPlot(boolean right, double percent)
          Pan the plot
 void setAutoRange(boolean value)
          Set the AutoRange property.
 void setBackgroundColor(Color value)
          Set the BackgroundColor property.
 void setDataAreaColor(Color value)
          Set the DataAreaColor property.
 void setDomainLineState(LineState value)
          Set the DomainLineState property.
 void setName(String value)
          Set the Name property.
 void setRangeLineState(LineState value)
          Set the RangeLineState property.
 void signalChartChanged()
          update chart
 
Methods inherited from class ucar.unidata.idv.control.chart.ChartWrapper
addDataChoice, addDataChoices, addField, animationTimeChanged, applyJython, applyJython, canBeASourceForTimeSelectionEvents, canDoDataChoiceList, canDoDriveTime, canDoJython, canDoMinMaxDate, canDoParameters, canDoRemoveParameters, canDoResolution, canDoTimeFilters, canDoTimeSelect, canDoWrapperColor, canDoWrapperSide, createDataChoiceWrapper, doApplyProperties, doMakeWrapperDisplayComponent, doMultipleAddFields, doRemove, filterData, formatValue, getAnimationShareGroup, getCategories, getDataChoices, getDataChoiceWrappers, getDriveTime, getFieldSelectionLabels, getFlatField, getInterpreter, getJython, getMaxDate, getMinDate, getResolution, getShowTime, getTimeFilterRanges, getTimeFilterSource, getTimeRanges, getTimeSelectSource, getTimeValues, getTypeName, init, initDone, initializeJython, loadData, propertyChange, removeTimeFilterSource, removeTimeSelectSource, setAnimationShareGroup, setDataChoiceWrappers, setDriveTime, setJython, setMaxDate, setMinDate, setResolution, setShowTime, setTimeFilterSource, setTimeFromAnimation, setTimeSelectSource, wrapDataChoices
 
Methods inherited from class ucar.unidata.idv.control.multi.DisplayComponent
addGroupMenuItems, doMakeContents, doMakeDisplayLabel, doSaveImage, doSaveMovie, getContents, getDisplayables, getDisplayControl, getDisplayGroup, getDisplayLabel, getIsRemoved, getLabelShown, getName, initAfterUnPersistence, removeDisplayComponent, setDisplayControl, setDisplayGroup, setIsRemoved, setLabelShown, showPopup, showProperties, toString
 
Methods inherited from class ucar.unidata.collab.PropertiedThing
addPropertyChangeListener, firePropertyChange, firePropertyChange, getPropertyListeners, isShowing, removePropertyChangeListener, showProperties
 
Methods inherited from class ucar.unidata.collab.SharableImpl
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, receiveShareData, 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

EVENT_PASSON

protected static final boolean EVENT_PASSON
Used by the MyChartPanel event bridge

See Also:
Constant Field Values

EVENT_DONTPASSON

protected static final boolean EVENT_DONTPASSON
Used by the MyChartPanel event bridge

See Also:
Constant Field Values

chartPanel

protected PlotWrapper.MyChartPanel chartPanel
The main chart gui component


chart

protected org.jfree.chart.JFreeChart chart
The chart

Constructor Detail

PlotWrapper

public PlotWrapper()
Default ctor


PlotWrapper

public PlotWrapper(String name,
                   List dataChoices)
Ctor

Parameters:
name - The name
dataChoices - List of data choices
Method Detail

keyReleased

public void keyReleased(KeyEvent e)
Noop

Specified by:
keyReleased in interface KeyListener
Overrides:
keyReleased in class ChartWrapper
Parameters:
e - The event

keyTyped

public void keyTyped(KeyEvent e)
Noop

Specified by:
keyTyped in interface KeyListener
Overrides:
keyTyped in class ChartWrapper
Parameters:
e - The event

okToDraw

public boolean okToDraw(ChartAnnotation annotation)
Is the annotation ok to draw

Parameters:
annotation - The annotation
Returns:
ok to draw

canDoColors

protected boolean canDoColors()
Can this chart do colors

Returns:
true

annotationChanged

public void annotationChanged(ChartAnnotation chartAnnotation)
The annotation changed somehow

Parameters:
chartAnnotation - The annotation

getPropertyTabs

public String[] getPropertyTabs()
Get the list of tab names for the properties dialog

Overrides:
getPropertyTabs in class PropertiedThing
Returns:
List of tab names

getPropertiesComponents

protected void getPropertiesComponents(List comps,
                                       int tabIdx)
Create the properties contents

Overrides:
getPropertiesComponents in class ChartWrapper
Parameters:
comps - List of components
tabIdx - Which tab

applyProperties

protected boolean applyProperties()
Apply properties

Overrides:
applyProperties in class ChartWrapper
Returns:
Was successful

getPopupMenuItems

protected List getPopupMenuItems(List items)
Get the menu items

Overrides:
getPopupMenuItems in class ChartWrapper
Parameters:
items - List of menu items
Returns:
The items list

setName

public void setName(String value)
Set the Name property.

Overrides:
setName in class DisplayComponent
Parameters:
value - The new value for Name

chartPanelGetToolTipText

public String chartPanelGetToolTipText(MouseEvent event)
Hook to intercept these calls on the chart

Parameters:
event - The event
Returns:
Was this event handled by the ChartWrapper

chartPanelMousePressed

public boolean chartPanelMousePressed(MouseEvent e)
Hook to intercept these calls on the chart

Parameters:
e - The event
Returns:
Was this event handled by the ChartWrapper

chartPanelMouseClicked

public boolean chartPanelMouseClicked(MouseEvent e)
Hook to intercept these calls on the chart

Parameters:
e - The event
Returns:
Was this event handled by the ChartWrapper

chartPanelMouseDragged

public boolean chartPanelMouseDragged(MouseEvent event)
Hook to intercept these calls on the chart

Parameters:
event - The event
Returns:
Was this event handled by the ChartWrapper

chartPanelMouseReleased

public boolean chartPanelMouseReleased(MouseEvent event)
Hook to intercept these calls on the chart

Parameters:
event - The event
Returns:
Was this event handled by the ChartWrapper

getChartPanel

protected org.jfree.chart.ChartPanel getChartPanel()
Get the chart

Returns:
The chart_

signalChartChanged

public void signalChartChanged()
update chart


doMakeChartPanel

protected PlotWrapper.MyChartPanel doMakeChartPanel(org.jfree.chart.JFreeChart chart)
Make the panel for the chart

Parameters:
chart - The chart
Returns:
The panel

panPlot

protected void panPlot(boolean right)
Pan plot

Parameters:
right - to right

panPlot

protected void panPlot(boolean right,
                       double percent)
Pan the plot

Parameters:
right - to right
percent - by how much

keyPressed

public void keyPressed(KeyEvent e)
Handle event

Specified by:
keyPressed in interface KeyListener
Overrides:
keyPressed in class ChartWrapper
Parameters:
e - The event

initXYPlot

protected void initXYPlot(org.jfree.chart.plot.XYPlot plot)
Utility to init xy plots

Parameters:
plot - the plotx

getPreferredChartSize

protected Dimension getPreferredChartSize()
Get the chart size

Returns:
size

setBackgroundColor

public void setBackgroundColor(Color value)
Set the BackgroundColor property.

Overrides:
setBackgroundColor in class DisplayComponent
Parameters:
value - The new value for BackgroundColor

getBackgroundColor

public Color getBackgroundColor()
Get the BackgroundColor property.

Overrides:
getBackgroundColor in class DisplayComponent
Returns:
The BackgroundColor

setDataAreaColor

public void setDataAreaColor(Color value)
Set the DataAreaColor property.

Parameters:
value - The new value for DataAreaColor

getDataAreaColor

public Color getDataAreaColor()
Get the DataAreaColor property.

Returns:
The DataAreaColor

setDomainLineState

public void setDomainLineState(LineState value)
Set the DomainLineState property.

Parameters:
value - The new value for DomainLineState

getDomainLineState

public LineState getDomainLineState()
Get the DomainLineState property.

Returns:
The DomainLineState

setRangeLineState

public void setRangeLineState(LineState value)
Set the RangeLineState property.

Parameters:
value - The new value for RangeLineState

getRangeLineState

public LineState getRangeLineState()
Get the RangeLineState property.

Returns:
The RangeLineState

setAutoRange

public void setAutoRange(boolean value)
Set the AutoRange property.

Parameters:
value - The new value for AutoRange

getAutoRange

public boolean getAutoRange()
Get the AutoRange property.

Returns:
The AutoRange