Class 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
  • Field Details

    • EVENT_PASSON

      protected static final boolean EVENT_PASSON
      Used by the MyChartPanel event bridge
      See Also:
    • EVENT_DONTPASSON

      protected static final boolean EVENT_DONTPASSON
      Used by the MyChartPanel event bridge
      See Also:
    • chartPanel

      protected PlotWrapper.MyChartPanel chartPanel
      The main chart gui component
    • chart

      protected org.jfree.chart.JFreeChart chart
      The chart
  • Constructor Details

    • PlotWrapper

      public PlotWrapper()
      Default ctor
    • PlotWrapper

      public PlotWrapper(String name, List dataChoices)
      Ctor
      Parameters:
      name - The name
      dataChoices - List of data choices
  • Method Details

    • 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