jigcell.compare.plotter
Class PTPlotBridge

java.lang.Object
  extended by javax.swing.TransferHandler
      extended by jigcell.compare.impl.Transferer
          extended by jigcell.compare.impl.DataSource
              extended by jigcell.compare.plotter.Plotter
                  extended by jigcell.compare.plotter.PTPlotBridge
All Implemented Interfaces:
java.awt.datatransfer.Transferable, java.beans.PropertyChangeListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, IDataSource, IWriteableDataSource, IPlotter

public final class PTPlotBridge
extends Plotter

Standard interface for PTPlot.

This code is licensed under the DARPA BioCOMP Open Source License. See LICENSE for more details.

Author:
Nicholas Allen
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface jigcell.compare.plotter.IPlotter
IPlotter.Combine
 
Nested classes/interfaces inherited from interface jigcell.compare.IDataSource
IDataSource.Option
 
Field Summary
private static java.awt.Color DEFAULT_BACKGROUND
          Default background color
private static java.lang.String DEFAULT_MARKSTYLE
          Default mark style
 
Fields inherited from class jigcell.compare.plotter.Plotter
data, SERIES_COLOR, SERIES_NAME
 
Fields inherited from class jigcell.compare.impl.DataSource
OPTIONS_LOCK, SEPARATOR_PAIR, SEPARATOR_PART, SEPARATORS
 
Fields inherited from class jigcell.compare.impl.Transferer
CSV_FOOTER, CSV_LINEPOSTPEND, CSV_LINEPREPEND, CSV_LINESEPARATOR, HTML_FOOTER, HTML_HEADPOSTPEND, HTML_HEADPREPEND, HTML_HEADSEPARATOR, HTML_LINEPOSTPEND, HTML_LINEPREPEND, HTML_LINESEPARATOR
 
Fields inherited from class javax.swing.TransferHandler
COPY, COPY_OR_MOVE, MOVE, NONE
 
Fields inherited from interface jigcell.compare.plotter.IPlotter
OPTION_COMBINE, OPTION_VIEWRANGE, OPTION_VIEWTITLE
 
Fields inherited from interface jigcell.compare.IWriteableDataSource
OPTION_WRITEDESCRIPTION, OPTION_WRITEICON
 
Fields inherited from interface jigcell.compare.IDataSource
OPTION_NAME
 
Constructor Summary
PTPlotBridge()
          Creates a new Ptplot bridge.
 
Method Summary
private  void addPlotNames(ptolemy.plot.Plot plotter)
          Adds the names of series to the plotter.
private  void addPointToPlot(ptolemy.plot.Plot plotter, int seriesIndex, double xPoint, double yPoint)
          Adds a a point to the plotter.
private  void buildPlotter(ptolemy.plot.Plot plotter)
          Adds data to the PTPlot plotter.
private  void configurePlotRange(ptolemy.plot.Plot plotter)
          Configures the range of a plotter according to the currently selected plot range.
private static ptolemy.plot.Plot createDefaultPlotter()
          Constructs a plotter with no data and all options set to the default values.
 java.lang.String getName()
          The name of this data source.
 void plot()
          Produces a plot from the underlying data.
private  void plotCombineAcross(ptolemy.plot.Plot plotter)
          Produces a plot using the combine across option.
private  void plotCombineNone(ptolemy.plot.Plot plotter)
          Produces a plot using the combine none option.
 java.awt.Image plotImage()
          Produces a plot image.
 java.awt.Image plotImage(java.awt.Rectangle size)
          Produces a plot image of the specified size.
 
Methods inherited from class jigcell.compare.plotter.Plotter
getPredictedCompatibility, getPredictedCompatibility, getSeries, getSeriesColor, getSeriesColorOption, getSeriesCombine, getSeriesCount, getSeriesName, getSeriesNameOption, getViewRange, isImmutable, setData, setSeries, setSeriesColor, setSeriesCombine, setSeriesName, setSeriesNames, setTitle, setViewRange, splitMultipleSeries, write
 
Methods inherited from class jigcell.compare.impl.DataSource
addOption, addPropertyChangeListener, addPropertyChangeListener, clone, configure, getOption, getOptions, getOptionType, getPropertyChangeListeners, getPropertyChangeListeners, getReadDescriptionOption, getReadIconOption, getState, getWriteDescriptionOption, getWriteIconOption, initializeSource, persistSource, propertyChange, removePropertyChangeListener, removePropertyChangeListener, setName, setOption, setOptions, setOptionType, setReadDescriptionOption, setReadIconOption, setState, setWriteDescriptionOption, setWriteIconOption, toString, unpersistSource
 
Methods inherited from class jigcell.compare.impl.Transferer
addExtension, addFlavor, createCSVTable, createFormattedTable, createHTMLTable, getExceptionRecorder, getExpectedClasses, getExpectedClasses, getExpectedClasses, getFlavors, getFlavors, getPreferredExtensions, getPreferredExtensions, getTransferClass, getTransferData, getTransferDataFlavors, getTransferFlavor, isDataFlavorSupported, transfer
 
Methods inherited from class javax.swing.TransferHandler
canImport, createTransferable, exportAsDrag, exportDone, exportToClipboard, getCopyAction, getCutAction, getPasteAction, getSourceActions, getVisualRepresentation, importData
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jigcell.compare.IWriteableDataSource
getWriteDescriptionOption, getWriteIconOption, setWriteDescriptionOption, setWriteIconOption
 
Methods inherited from interface jigcell.compare.IDataSource
addOption, clone, configure, getOption, getState, setOption, setState
 
Methods inherited from interface java.awt.datatransfer.Transferable
getTransferData, getTransferDataFlavors, isDataFlavorSupported
 

Field Detail

DEFAULT_BACKGROUND

private static final java.awt.Color DEFAULT_BACKGROUND
Default background color


DEFAULT_MARKSTYLE

private static final java.lang.String DEFAULT_MARKSTYLE
Default mark style

See Also:
Constant Field Values
Constructor Detail

PTPlotBridge

public PTPlotBridge()
Creates a new Ptplot bridge.

Method Detail

createDefaultPlotter

private static ptolemy.plot.Plot createDefaultPlotter()
Constructs a plotter with no data and all options set to the default values.


getName

public java.lang.String getName()
The name of this data source.

Specified by:
getName in interface IDataSource
Overrides:
getName in class Plotter

plot

public void plot()
          throws PlotException
Produces a plot from the underlying data.

Throws:
PlotException

plotImage

public java.awt.Image plotImage()
                         throws PlotException
Produces a plot image.

Throws:
PlotException

plotImage

public java.awt.Image plotImage(java.awt.Rectangle size)
                         throws PlotException
Produces a plot image of the specified size.

Parameters:
size - Size
Throws:
PlotException

addPlotNames

private void addPlotNames(ptolemy.plot.Plot plotter)
                   throws PlotException
Adds the names of series to the plotter.

Parameters:
plotter - Plotter
Throws:
PlotException

addPointToPlot

private void addPointToPlot(ptolemy.plot.Plot plotter,
                            int seriesIndex,
                            double xPoint,
                            double yPoint)
Adds a a point to the plotter.

Parameters:
plotter - Plotter
seriesIndex - Series containing the point
xPoint - Point x-coordinate
yPoint - Point y-coordinate

buildPlotter

private void buildPlotter(ptolemy.plot.Plot plotter)
                   throws PlotException
Adds data to the PTPlot plotter.

Parameters:
plotter - Plotter
Throws:
PlotException

configurePlotRange

private void configurePlotRange(ptolemy.plot.Plot plotter)
Configures the range of a plotter according to the currently selected plot range.

Parameters:
plotter - Plotter

plotCombineAcross

private void plotCombineAcross(ptolemy.plot.Plot plotter)
                        throws PlotException
Produces a plot using the combine across option.

Parameters:
plotter - Plotter
Throws:
PlotException

plotCombineNone

private void plotCombineNone(ptolemy.plot.Plot plotter)
                      throws PlotException
Produces a plot using the combine none option.

Parameters:
plotter - Plotter
Throws:
PlotException