nl.astron.lofar.java.gui.plotter
Class PlotSGTImpl

java.lang.Object
  extended by nl.astron.lofar.java.gui.plotter.PlotSGTImpl
All Implemented Interfaces:
IPlot

public class PlotSGTImpl
extends java.lang.Object
implements IPlot

This class provides an implementation of IPlot for use with the SGT package. It manages the calls to create plots etc. in a way that SGT can support and handle.

This software uses (parts of) the SGT graphics library. SGT was developed and is maintained by Donald W. Denbo, National Oceanic and Atmospheric Administration. E-Mail : Donald.W.Denbo@noaa.gov Website: http://www.epic.noaa.gov/java/sgt

Version:
$Id$
Author:
pompert

Constructor Summary
PlotSGTImpl()
          Creates a new instance of PlotSGTImpl
 
Method Summary
 javax.swing.JComponent createPlot(int type, java.lang.String name, java.util.HashMap data, boolean separateLegend)
          Creates a SGT JPlotLayout plot using several key arguments
 void finalize()
          Cleans up the SGT plot(s) present in memory and other instance variables
 java.util.HashMap getData()
          Returns the current dataset used in the plot
 javax.swing.JComponent getLegend(javax.swing.JComponent aPlot)
          Create a legend/key using the SGT plot specified.
 javax.swing.JComponent modifyPlot(javax.swing.JComponent aPlot, java.util.HashMap data)
          Modifies a given SGT plot using a given dataset.
 void setData(java.util.HashMap newData)
          Sets the dataset used in the plot
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlotSGTImpl

public PlotSGTImpl()
Creates a new instance of PlotSGTImpl

Method Detail

finalize

public void finalize()
              throws java.lang.Throwable
Cleans up the SGT plot(s) present in memory and other instance variables

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

modifyPlot

public javax.swing.JComponent modifyPlot(javax.swing.JComponent aPlot,
                                         java.util.HashMap data)
                                  throws PlotterException
Modifies a given SGT plot using a given dataset. All data is updated, including already present data.

Specified by:
modifyPlot in interface IPlot
Parameters:
aPlot - A plot JComponent
data - The data to be displayed in the plot.
Returns:
A legend JComponent of plot aPlot
Throws:
PlotterException - will be thrown if the plot could not be generated for any reason.

createPlot

public javax.swing.JComponent createPlot(int type,
                                         java.lang.String name,
                                         java.util.HashMap data,
                                         boolean separateLegend)
                                  throws PlotterException
Creates a SGT JPlotLayout plot using several key arguments

Specified by:
createPlot in interface IPlot
Parameters:
type - Type of plot as dictated by PlotConstants.PLOT_*
name - Name to be given to the plot
data - The dataset to be used to create the plot
separateLegend - Indicates the user's need for a separate legend
Returns:
the JComponent plot generated
Throws:
PlotterException - will be thrown if the plot could not be generated for any reason.

getData

public java.util.HashMap getData()
Returns the current dataset used in the plot

Specified by:
getData in interface IPlot
Returns:
the dataset currently in use.

setData

public void setData(java.util.HashMap newData)
Sets the dataset used in the plot

Specified by:
setData in interface IPlot
Parameters:
newData - A new set of data

getLegend

public javax.swing.JComponent getLegend(javax.swing.JComponent aPlot)
                                 throws PlotterException
Create a legend/key using the SGT plot specified.

Specified by:
getLegend in interface IPlot
Parameters:
aPlot - A plot JComponent (must be a SGT JPlotLayout!)
Returns:
A legend JComponent of plot aPlot
Throws:
PlotterException - will be thrown if the legend could not be generated for the given SGT plot.