Class ChartManager

java.lang.Object
ucar.unidata.idv.control.chart.ChartManager
All Implemented Interfaces:
ImageObserver
Direct Known Subclasses:
XYChartManager

public abstract class ChartManager extends Object implements ImageObserver
A time series chart
Version:
$Revision: 1.16 $
Author:
MetApps Development Team
  • Field Details

    • LAYOUT_HSTACK

      public static final int LAYOUT_HSTACK
      chart layout type
      See Also:
    • LAYOUT_VSTACK

      public static final int LAYOUT_VSTACK
      chart layout type
      See Also:
    • LAYOUT_2COLGRID

      public static final int LAYOUT_2COLGRID
      chart layout type
      See Also:
    • LAYOUT_3COLGRID

      public static final int LAYOUT_3COLGRID
      chart layout type
      See Also:
    • LAYOUT_GRAPH

      public static final int LAYOUT_GRAPH
      chart layout type
      See Also:
    • LAYOUT_TAB

      public static final int LAYOUT_TAB
      chart layout type
      See Also:
    • LAYOUT_CARD

      public static final int LAYOUT_CARD
      chart layout type
      See Also:
    • AXIS_WIDTH

      public static final int AXIS_WIDTH
      width of axis_
      See Also:
    • MUTEX

      protected Object MUTEX
      for synching_
    • chartHolders

      protected List<ChartHolder> chartHolders
      the charts
    • control

      protected DisplayControlImpl control
      my control
    • contents

      protected JComponent contents
      gui_
    • settingData

      protected boolean settingData
      currently setting data in chart_
    • okToDraw

      protected boolean okToDraw
      ok to draw charts
  • Constructor Details

    • ChartManager

      public ChartManager()
      ctor
    • ChartManager

      public ChartManager(DisplayControlImpl control)
      ctor
      Parameters:
      control - the control
    • ChartManager

      public ChartManager(DisplayControlImpl control, String chartName)
      Default constructor.
      Parameters:
      control - the control
      chartName - name of default chart
  • Method Details

    • addLineState

      protected void addLineState(LineState lineState)
      add line state
      Parameters:
      lineState - line state
    • saveImage

      public void saveImage()
      Save the image
    • clearLineStates

      protected void clearLineStates()
      clear all saved line states
    • chartNameChanged

      protected void chartNameChanged(String oldName, String newName)
      The chart name has changed
      Parameters:
      oldName - old name
      newName - new name
    • setChartName

      public void setChartName(String newName)
      The chart name has changed
      Parameters:
      newName - new name
    • initCharts

      protected void initCharts()
      init all charts
    • getCurrentRanges

      public List getCurrentRanges()
      get the ranges
      Returns:
      ranges
    • addRange

      protected void addRange(double min, double max, String name)
      add a range
      Parameters:
      min - min
      max - max
      name - name
    • getMutex

      protected Object getMutex()
      for synching the charts
      Returns:
      mutex
    • initChart

      protected void initChart(ChartHolder chartHolder)
      init chart
      Parameters:
      chartHolder - The chart
    • initPlot

      protected void initPlot(org.jfree.chart.plot.Plot plot)
      init plot
      Parameters:
      plot - plot
    • doMakePlot

      public abstract org.jfree.chart.plot.Plot doMakePlot()
      factory method to make the plot
      Returns:
      the new plot
    • getPlots

      protected List getPlots()
      Get the plots
      Returns:
      plots_
    • updateThumb

      public void updateThumb()
      update thumbnail legend image
    • updateThumbInner

      public void updateThumbInner()
      actually update the thumbnail image
    • signalChartChanged

      public void signalChartChanged()
      Tell the chart holds that something changed
    • doneLoadingData

      protected void doneLoadingData()
      Call this after you are done loading data into the charts. It resets the flag to ignore any intermediate chart repaints and then it signals the chart to repaint
    • startLoadingData

      protected void startLoadingData()
      Call this before you start loading data into the charts. It sets a flag to ignore any intermediate chart repaints
    • getPopupMenuItems

      protected void getPopupMenuItems(ChartHolder chartHolder, List items)
      get menu items for chart
      Parameters:
      chartHolder - chart_
      items - items
    • showPropertiesDialog

      protected void showPropertiesDialog(ChartHolder chartHolder)
      show dialog for chart
      Parameters:
      chartHolder - chart
    • getPropertiesComponents

      protected void getPropertiesComponents(ChartHolder chartHolder, List comps)
      get properties widgets
      Parameters:
      chartHolder - the chart
      comps - comps
    • applyProperties

      protected boolean applyProperties(ChartHolder chartHolder)
      apply properties to chart
      Parameters:
      chartHolder - the chart
      Returns:
      OK
    • setLayoutType

      public void setLayoutType(Integer i)
      set layout
      Parameters:
      i - layout type
    • editLayout

      public void editLayout()
      change layout
    • addViewMenuItems

      public void addViewMenuItems(List items)
      add menu items
      Parameters:
      items - items
    • getOkToDraw

      public boolean getOkToDraw()
      ok to draw chart
      Returns:
      ok to draw
    • getSettingData

      public boolean getSettingData()
      Are we currently setting data
      Returns:
      is setting data
    • timeChanged

      public void timeChanged()
      Stub for handling time change events.
    • timeChanged

      public void timeChanged(Real value)
      Stub for handling time change events. Signals a redraw.
      Parameters:
      value - the time value (may be null);
    • imageUpdate

      public boolean imageUpdate(Image img, int flags, int x, int y, int width, int height)
      Handle the image update
      Specified by:
      imageUpdate in interface ImageObserver
      Parameters:
      img - img
      flags - flags
      x - x
      y - y
      width - width
      height - height
      Returns:
      keep going
    • hasStuff

      public boolean hasStuff()
      do we have anything to show
      Returns:
      anything to show
    • getContents

      public JComponent getContents()
      get gui
      Returns:
      gui
    • getPlotNames

      public List getPlotNames()
      get list of chart names
      Returns:
      names
    • getChartHolder

      protected ChartHolder getChartHolder(LineState lineState)
      Get the chart holder that is displaying the given line state.
      Parameters:
      lineState - The line state
      Returns:
      The chart holder
    • findChartHolder

      protected ChartHolder findChartHolder(String name)
      find chart with name
      Parameters:
      name - name
      Returns:
      the chart or null if none found
    • getChartHolder

      protected ChartHolder getChartHolder(String name)
      find chart with name
      Parameters:
      name - name
      Returns:
      the chart or create one if needed
    • addChart

      protected void addChart(ChartHolder chartHolder)
      add chart
      Parameters:
      chartHolder - chart
    • getPreferredChartSize

      protected Dimension getPreferredChartSize()
      Get the preferred chart size
      Returns:
      The preferred chart size
    • doMakeContents

      protected void doMakeContents()
      make gui
    • makeInitialChart

      protected void makeInitialChart()
      make the chart
    • getDefaultChartName

      protected String getDefaultChartName()
      get name to use for default chart
      Returns:
      default chart name
    • updateContents

      protected void updateContents()
      update gui
    • updateContents

      protected void updateContents(boolean force)
      update gui
      Parameters:
      force - always do it
    • getThumb

      public JLabel getThumb()
      get thumb label
      Returns:
      thumb
    • setLayout

      public void setLayout(int value)
      Set the Layout property.
      Parameters:
      value - The new value for Layout
    • getLayout

      public int getLayout()
      Get the Layout property.
      Returns:
      The Layout
    • setGridLayoutDimension

      public void setGridLayoutDimension(int value)
      Set the GridLayoutDimension property.
      Parameters:
      value - The new value for GridLayoutDimension
    • getGridLayoutDimension

      public int getGridLayoutDimension()
      Get the GridLayoutDimension property.
      Returns:
      The GridLayoutDimension
    • setChartHolders

      public void setChartHolders(List value)
      Set the ChartHolders property.
      Parameters:
      value - The new value for ChartHolders
    • getChartHolders

      public List getChartHolders()
      Get the ChartHolders property.
      Returns:
      The ChartHolders
    • setControl

      public void setControl(DisplayControlImpl value)
      Set the Control property.
      Parameters:
      value - The new value for Control
    • getControl

      public DisplayControlImpl getControl()
      Get the Control property.
      Returns:
      The Control
    • setShowThumb

      public void setShowThumb(boolean value)
      Set the ShowThumb property.
      Parameters:
      value - The new value for ShowThumb
    • getShowThumb

      public boolean getShowThumb()
      Get the ShowThumb property.
      Returns:
      The ShowThumb