org.das2.graph
Class SeriesRenderer

java.lang.Object
  extended by org.das2.graph.Renderer
      extended by org.das2.graph.SeriesRenderer
All Implemented Interfaces:
Displayable, Editable, DataSetConsumer

public class SeriesRenderer
extends Renderer
implements Displayable

SeriesRender is a high-performance replacement for the SymbolLineRenderer. The SymbolLineRenderer is limited to about 30,000 points, beyond which contracts for speed start breaking degrading usability. The goal of the SeriesRenderer is to plot 1,000,000 points without breaking the contracts.


Field Summary
protected  boolean cadenceCheck
           
protected  java.lang.String legendLabel
           
static java.lang.String PROP_CADENCECHECK
           
static java.lang.String PROP_LEGENDLABEL
          If non-null and non-zero-length, use this label to describe the renderer in the plot's legend.
static java.lang.String PROP_RENDERPOINTSPERMILLISECOND
           
static java.lang.String PROP_STAMPPSYMS
           
static java.lang.String PROP_UPDATESPOINTSPERMILLISECOND
           
static java.lang.String PROPERTY_X_DELTA_MINUS
           
static java.lang.String PROPERTY_X_DELTA_PLUS
           
static java.lang.String PROPERTY_Y_DELTA_MINUS
           
static java.lang.String PROPERTY_Y_DELTA_PLUS
           
 
Fields inherited from class org.das2.graph.Renderer
ds, lastException, logger, propertyChangeSupport, renderException
 
Constructor Summary
SeriesRenderer()
           
 
Method Summary
 boolean acceptContext(int x, int y)
          Returns true if the render thinks it can provide the context for a point.
 java.awt.Color getColor()
          Getter for property color.
 DasColorBar getColorBar()
          Getter for property colorBar.
 VectorDataSet getColorByDataSet()
          Getter for property colorByDataSet.
 java.lang.String getColorByDataSetId()
          Getter for property colorByDataSetId.
 int getDataSetSizeLimit()
          Getter for property dataSetSizeLimit.
 org.w3c.dom.Element getDOMElement(org.w3c.dom.Document document)
           
 java.awt.Color getFillColor()
          Getter for property fillReference.
 FillStyle getFillStyle()
           
 int getFirstIndex()
           
 int getLastIndex()
           
 java.lang.String getLegendLabel()
           
 double getLineWidth()
           
 javax.swing.Icon getListIcon()
          get an Icon representing the trace.
 java.lang.String getListLabel()
          return a String that will help the user identify this item when choosing from a list.
 PlotSymbol getPsym()
          Getter for property psym.
 PsymConnector getPsymConnector()
           
 Datum getReference()
          Getter for property reference.
 double getRenderPointsPerMillisecond()
           
 double getSymSize()
          Getter for property symsize.
 double getUpdatesPointsPerMillisecond()
           
protected  void installRenderer()
           
 boolean isAntiAliased()
          Getter for property antiAliased.
 boolean isCadenceCheck()
           
 boolean isFillToReference()
          Getter for property fillToReference.
 boolean isHistogram()
           
 boolean isResetDebugCounters()
          Getter for property resetDebugCounters.
 boolean isSelected()
          Getter for property selected.
 boolean isSimplifyPaths()
          Getter for property simplifyPaths.
 boolean isStampPsyms()
           
 void render(java.awt.Graphics g, DasAxis xAxis, DasAxis yAxis, ProgressMonitor mon)
          Render is called whenever the image needs to be refreshed or the content has changed.
 void setAntiAliased(boolean antiAliased)
          Setter for property antiAliased.
 void setCadenceCheck(boolean cadenceCheck)
          If true, then use a cadence estimate to determine and indicate data gaps.
 void setColor(java.awt.Color color)
          Setter for property color.
 void setColorBar(DasColorBar colorBar)
          Setter for property colorBar.
 void setColorByDataSet(VectorDataSet colorByDataSet)
          Setter for property colorByDataSet.
 void setColorByDataSetId(java.lang.String colorByDataSetId)
          The dataset plane to use to get colors.
 void setDataSetSizeLimit(int dataSetSizeLimit)
          Setter for property dataSetSizeLimit.
 void setFillColor(java.awt.Color color)
          Setter for property fillReference.
 void setFillStyle(FillStyle fillStyle)
           
 void setFillToReference(boolean fillToReference)
          Setter for property fillToReference.
 void setHistogram(boolean b)
           
 void setLegendLabel(java.lang.String legendLabel)
           
 void setLineWidth(double f)
           
 void setPsym(PlotSymbol psym)
          Setter for property psym.
 void setPsymConnector(PsymConnector p)
           
 void setReference(Datum reference)
          Setter for property reference.
 void setRenderPointsPerMillisecond(double newrenderPointsPerMillisecond)
           
 void setResetDebugCounters(boolean resetDebugCounters)
          Setter for property resetDebugCounters.
 void setSelected(boolean selected)
          Setter for property selected.
 void setSimplifyPaths(boolean simplifyPaths)
          Setter for property simplifyPaths.
 void setStampPsyms(boolean newstampPsyms)
           
 void setSymSize(double symSize)
          Setter for property symsize.
 void setUpdatesPointsPerMillisecond(double newupdatesPointsPerMillisecond)
           
protected  void uninstallRenderer()
           
 void updatePlotImage(DasAxis xAxis, DasAxis yAxis, ProgressMonitor monitor)
          do the same as updatePlotImage, but use AffineTransform to implement axis transform.
 
Methods inherited from class org.das2.graph.Renderer
addPropertyChangeListener, addPropertyChangeListener, getAffineTransform, getConsumedDataSet, getDataLoader, getDataSet, getDataSetDescriptor, getDataSetID, getLastException, getParent, invalidateParentCacheImage, isActive, isDumpDataSet, isOverloading, refresh, refreshImage, removePropertyChangeListener, removePropertyChangeListener, renderException, setActive, setDataSet, setDataSetDescriptor, setDataSetID, setDataSetLoader, setDumpDataSet, setException, setLastException, setOverloading, update, updateImmediately
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_X_DELTA_PLUS

public static final java.lang.String PROPERTY_X_DELTA_PLUS
See Also:
Constant Field Values

PROPERTY_X_DELTA_MINUS

public static final java.lang.String PROPERTY_X_DELTA_MINUS
See Also:
Constant Field Values

PROPERTY_Y_DELTA_PLUS

public static final java.lang.String PROPERTY_Y_DELTA_PLUS
See Also:
Constant Field Values

PROPERTY_Y_DELTA_MINUS

public static final java.lang.String PROPERTY_Y_DELTA_MINUS
See Also:
Constant Field Values

PROP_STAMPPSYMS

public static final java.lang.String PROP_STAMPPSYMS
See Also:
Constant Field Values

PROP_LEGENDLABEL

public static final java.lang.String PROP_LEGENDLABEL
If non-null and non-zero-length, use this label to describe the renderer in the plot's legend.

See Also:
Constant Field Values

legendLabel

protected java.lang.String legendLabel

PROP_UPDATESPOINTSPERMILLISECOND

public static final java.lang.String PROP_UPDATESPOINTSPERMILLISECOND
See Also:
Constant Field Values

PROP_RENDERPOINTSPERMILLISECOND

public static final java.lang.String PROP_RENDERPOINTSPERMILLISECOND
See Also:
Constant Field Values

cadenceCheck

protected boolean cadenceCheck

PROP_CADENCECHECK

public static final java.lang.String PROP_CADENCECHECK
See Also:
Constant Field Values
Constructor Detail

SeriesRenderer

public SeriesRenderer()
Method Detail

render

public void render(java.awt.Graphics g,
                   DasAxis xAxis,
                   DasAxis yAxis,
                   ProgressMonitor mon)
Description copied from class: Renderer
Render is called whenever the image needs to be refreshed or the content has changed. This operation should occur with an animation-interactive time scale, and an image should be cached when this is not possible. The graphics object will have its origin at the upper-left corner of the screen.

Specified by:
render in class Renderer

updatePlotImage

public void updatePlotImage(DasAxis xAxis,
                            DasAxis yAxis,
                            ProgressMonitor monitor)
do the same as updatePlotImage, but use AffineTransform to implement axis transform.

Overrides:
updatePlotImage in class Renderer

installRenderer

protected void installRenderer()
Overrides:
installRenderer in class Renderer

uninstallRenderer

protected void uninstallRenderer()
Overrides:
uninstallRenderer in class Renderer

getDOMElement

public org.w3c.dom.Element getDOMElement(org.w3c.dom.Document document)
Overrides:
getDOMElement in class Renderer

getListIcon

public javax.swing.Icon getListIcon()
get an Icon representing the trace. This will be an ImageIcon. TODO: cache the result to support use in legend.

Specified by:
getListIcon in interface Displayable
Returns:

getListLabel

public java.lang.String getListLabel()
Description copied from interface: Displayable
return a String that will help the user identify this item when choosing from a list.

Specified by:
getListLabel in interface Displayable

getPsymConnector

public PsymConnector getPsymConnector()

setPsymConnector

public void setPsymConnector(PsymConnector p)

getPsym

public PlotSymbol getPsym()
Getter for property psym.

Returns:
Value of property psym.

setPsym

public void setPsym(PlotSymbol psym)
Setter for property psym.

Parameters:
psym - New value of property psym.

getSymSize

public double getSymSize()
Getter for property symsize.

Returns:
Value of property symsize.

setSymSize

public void setSymSize(double symSize)
Setter for property symsize.

Parameters:
symSize - New value of property symsize.

getColor

public java.awt.Color getColor()
Getter for property color.

Returns:
Value of property color.

setColor

public void setColor(java.awt.Color color)
Setter for property color.

Parameters:
color - New value of property color.

getLineWidth

public double getLineWidth()

setLineWidth

public void setLineWidth(double f)

isAntiAliased

public boolean isAntiAliased()
Getter for property antiAliased.

Returns:
Value of property antiAliased.

setAntiAliased

public void setAntiAliased(boolean antiAliased)
Setter for property antiAliased.

Parameters:
antiAliased - New value of property antiAliased.

isHistogram

public boolean isHistogram()

setHistogram

public void setHistogram(boolean b)

isSelected

public boolean isSelected()
Getter for property selected.

Returns:
Value of property selected.

setSelected

public void setSelected(boolean selected)
Setter for property selected.

Parameters:
selected - New value of property selected.

getFillColor

public java.awt.Color getFillColor()
Getter for property fillReference.

Returns:
Value of property fillReference.

setFillColor

public void setFillColor(java.awt.Color color)
Setter for property fillReference.

Parameters:
fillReference - New value of property fillReference.

getColorByDataSetId

public java.lang.String getColorByDataSetId()
Getter for property colorByDataSetId.

Returns:
Value of property colorByDataSetId.

setColorByDataSetId

public void setColorByDataSetId(java.lang.String colorByDataSetId)
The dataset plane to use to get colors. If this is null or "", then no coloring is done. (Note the default plane cannot be used to color.)

Parameters:
colorByDataSetId - New value of property colorByDataSetId.

getColorBar

public DasColorBar getColorBar()
Getter for property colorBar.

Returns:
Value of property colorBar.

setColorBar

public void setColorBar(DasColorBar colorBar)
Setter for property colorBar.

Parameters:
colorBar - New value of property colorBar.

isFillToReference

public boolean isFillToReference()
Getter for property fillToReference.

Returns:
Value of property fillToReference.

setFillToReference

public void setFillToReference(boolean fillToReference)
Setter for property fillToReference.

Parameters:
fillToReference - New value of property fillToReference.

getReference

public Datum getReference()
Getter for property reference.

Returns:
Value of property reference.

setReference

public void setReference(Datum reference)
Setter for property reference.

Parameters:
reference - New value of property reference.

getColorByDataSet

public VectorDataSet getColorByDataSet()
Getter for property colorByDataSet.

Returns:
Value of property colorByDataSet.

setColorByDataSet

public void setColorByDataSet(VectorDataSet colorByDataSet)
Setter for property colorByDataSet.

Parameters:
colorByDataSet - New value of property colorByDataSet.

isResetDebugCounters

public boolean isResetDebugCounters()
Getter for property resetDebugCounters.

Returns:
Value of property resetDebugCounters.

setResetDebugCounters

public void setResetDebugCounters(boolean resetDebugCounters)
Setter for property resetDebugCounters.

Parameters:
resetDebugCounters - New value of property resetDebugCounters.

isSimplifyPaths

public boolean isSimplifyPaths()
Getter for property simplifyPaths.

Returns:
Value of property simplifyPaths.

setSimplifyPaths

public void setSimplifyPaths(boolean simplifyPaths)
Setter for property simplifyPaths.

Parameters:
simplifyPaths - New value of property simplifyPaths.

isStampPsyms

public boolean isStampPsyms()

setStampPsyms

public void setStampPsyms(boolean newstampPsyms)

getFillStyle

public FillStyle getFillStyle()

setFillStyle

public void setFillStyle(FillStyle fillStyle)

getLegendLabel

public java.lang.String getLegendLabel()

setLegendLabel

public void setLegendLabel(java.lang.String legendLabel)

acceptContext

public boolean acceptContext(int x,
                             int y)
Description copied from class: Renderer
Returns true if the render thinks it can provide the context for a point. That is, the renderer affected that point, or nearby points. For example, this is used currently to provide a way for the operator to click on a plot and directly edit the renderer who drew the pixel.

Overrides:
acceptContext in class Renderer
Parameters:
x - the x coordinate in the canvas coordinate system.
y - the y coordinate in the canvas coordinate system.

getDataSetSizeLimit

public int getDataSetSizeLimit()
Getter for property dataSetSizeLimit.

Returns:
Value of property dataSetSizeLimit.

setDataSetSizeLimit

public void setDataSetSizeLimit(int dataSetSizeLimit)
Setter for property dataSetSizeLimit.

Parameters:
dataSetSizeLimit - New value of property dataSetSizeLimit.

getUpdatesPointsPerMillisecond

public double getUpdatesPointsPerMillisecond()

setUpdatesPointsPerMillisecond

public void setUpdatesPointsPerMillisecond(double newupdatesPointsPerMillisecond)

getRenderPointsPerMillisecond

public double getRenderPointsPerMillisecond()

setRenderPointsPerMillisecond

public void setRenderPointsPerMillisecond(double newrenderPointsPerMillisecond)

getFirstIndex

public int getFirstIndex()

getLastIndex

public int getLastIndex()

isCadenceCheck

public boolean isCadenceCheck()

setCadenceCheck

public void setCadenceCheck(boolean cadenceCheck)
If true, then use a cadence estimate to determine and indicate data gaps.

Parameters:
cadenceCheck -