jigcell.compare.plotter
Class Plotter

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
All Implemented Interfaces:
java.awt.datatransfer.Transferable, java.beans.PropertyChangeListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, IDataSource, IWriteableDataSource, IPlotter
Direct Known Subclasses:
JPlotBridge, PTPlotBridge

public abstract class Plotter
extends DataSource
implements IPlotter

A default implementation of PlotterInteface.

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
protected  IDataElement data
          Data aggregate
protected static java.lang.String SERIES_COLOR
          Series color key
protected static java.lang.String SERIES_NAME
          Series name key
 
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
Plotter()
          Creates a new plotter bridge.
 
Method Summary
 java.lang.String getName()
          The name of this data source.
 boolean getPredictedCompatibility(java.lang.Class clazz)
          A prediction on whether this data source can hold a particular type.
 boolean getPredictedCompatibility(java.lang.Object instance)
          A prediction on whether this data source can hold a particular type.
 IDataElement getSeries(long pos)
          A data series from the data aggregate.
 java.awt.Color getSeriesColor(long pos)
          The color of a series.
protected static java.lang.String getSeriesColorOption(long pos)
          The option indicating the color of a series.
 IPlotter.Combine getSeriesCombine()
          The series combine option.
protected  int getSeriesCount()
          The number of series to plot.
 java.lang.String getSeriesName(long pos)
          The name of a series.
protected static java.lang.String getSeriesNameOption(long pos)
          The option indicating the name of a series.
 IDataElement getViewRange()
          The view range option.
 boolean isImmutable()
          Whether the data aggregate is immutable.
 void setData(IDataElement data)
          Sets the data aggregate.
 void setSeries(long pos, IDataElement series)
          Sets one of the data series in the aggregate.
 void setSeriesColor(long pos, java.awt.Color color)
          Sets the color of a series.
 void setSeriesCombine(IPlotter.Combine option)
          Sets the series combine option.
 void setSeriesName(long pos, java.lang.String name)
          Sets the name of a series.
 void setSeriesNames(java.lang.String[] names)
          Sets the name of every series.
 void setTitle(java.lang.String title)
          Sets the title of the plot window.
 void setViewRange(IDataElement range)
          Sets the view range option.
static IDataElement splitMultipleSeries(IDataElement series)
          Splits time series data with multiple series to multiple time series with a single series.
 void write(java.lang.Object data)
          Writes data to the source destroying the previous contents if multiple objects are not supported.
 
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.plotter.IPlotter
plot
 
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

SERIES_COLOR

protected static final java.lang.String SERIES_COLOR
Series color key

See Also:
Constant Field Values

SERIES_NAME

protected static final java.lang.String SERIES_NAME
Series name key

See Also:
Constant Field Values

data

protected IDataElement data
Data aggregate

Constructor Detail

Plotter

public Plotter()
Creates a new plotter bridge.

Method Detail

splitMultipleSeries

public static IDataElement splitMultipleSeries(IDataElement series)
Splits time series data with multiple series to multiple time series with a single series. The split time series is formatted for the combine none option.

Parameters:
series - Time series formatted for the combine across option

getSeriesColorOption

protected static java.lang.String getSeriesColorOption(long pos)
The option indicating the color of a series.

Parameters:
pos - Position

getSeriesNameOption

protected static java.lang.String getSeriesNameOption(long pos)
The option indicating the name of a series.

Parameters:
pos - Position

getName

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

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

getPredictedCompatibility

public boolean getPredictedCompatibility(java.lang.Class clazz)
A prediction on whether this data source can hold a particular type.

Specified by:
getPredictedCompatibility in interface IWriteableDataSource
Parameters:
clazz - Type

getPredictedCompatibility

public boolean getPredictedCompatibility(java.lang.Object instance)
A prediction on whether this data source can hold a particular type.

Specified by:
getPredictedCompatibility in interface IWriteableDataSource
Parameters:
instance - Type

getSeries

public IDataElement getSeries(long pos)
A data series from the data aggregate.

Specified by:
getSeries in interface IPlotter
Parameters:
pos - Position

getSeriesColor

public java.awt.Color getSeriesColor(long pos)
The color of a series.

Specified by:
getSeriesColor in interface IPlotter
Parameters:
pos - Position

getSeriesCombine

public IPlotter.Combine getSeriesCombine()
The series combine option.

Specified by:
getSeriesCombine in interface IPlotter

getSeriesName

public java.lang.String getSeriesName(long pos)
The name of a series.

Specified by:
getSeriesName in interface IPlotter
Parameters:
pos - Position

getViewRange

public IDataElement getViewRange()
The view range option. The range is either null (fit to data) or in the form ((xmin, ymin), (xmax, ymax)).

Specified by:
getViewRange in interface IPlotter

isImmutable

public boolean isImmutable()
Whether the data aggregate is immutable.

Specified by:
isImmutable in interface IPlotter

setData

public void setData(IDataElement data)
Sets the data aggregate.

Specified by:
setData in interface IPlotter
Parameters:
data - Data

setSeries

public void setSeries(long pos,
                      IDataElement series)
Sets one of the data series in the aggregate. If the aggregate is immutable, an exception is thrown.

Specified by:
setSeries in interface IPlotter
Parameters:
pos - Position
series - Data series

setSeriesColor

public void setSeriesColor(long pos,
                           java.awt.Color color)
Sets the color of a series.

Specified by:
setSeriesColor in interface IPlotter
Parameters:
pos - Position
color - Series color

setSeriesCombine

public void setSeriesCombine(IPlotter.Combine option)
Sets the series combine option.

Specified by:
setSeriesCombine in interface IPlotter
Parameters:
option - Series combine option

setSeriesName

public void setSeriesName(long pos,
                          java.lang.String name)
Sets the name of a series.

Specified by:
setSeriesName in interface IPlotter
Parameters:
pos - Position
name - Series name

setSeriesNames

public void setSeriesNames(java.lang.String[] names)
Sets the name of every series.

Parameters:
names - Series names

setTitle

public void setTitle(java.lang.String title)
Sets the title of the plot window.

Specified by:
setTitle in interface IPlotter
Parameters:
title - Window title

setViewRange

public void setViewRange(IDataElement range)
Sets the view range option. The range must be either null (fit to data) or in the form ((xmin, ymin), (xmax, ymax)).

Specified by:
setViewRange in interface IPlotter
Parameters:
range - View range

write

public void write(java.lang.Object data)
           throws PlotException
Writes data to the source destroying the previous contents if multiple objects are not supported.

Specified by:
write in interface IWriteableDataSource
Parameters:
data - Data
Throws:
PlotException

getSeriesCount

protected int getSeriesCount()
                      throws PlotException
The number of series to plot.

Throws:
PlotException