ptolemy.plot
Class Plot.Bin

java.lang.Object
  extended by ptolemy.plot.Plot.Bin
Enclosing class:
Plot

private class Plot.Bin
extends java.lang.Object

A bin is represents a number of points that are all displayed on the same x position. A bin is meant to avoid superfluous drawings of lines. So instaed of having to draw a line between each point, you can draw a line between the minimum and maximum and maximum y position.


Field Summary
private  int _afterLastPointIndex
           
private  int _dataset
           
private  boolean _errorBar
           
private  int _firstPointIndex
           
private  long _firstYPos
           
private  boolean _isConnected
           
private  boolean _isConnectedWithPreviousBin
           
private  long _lastYPos
           
private  long _maxYPos
           
private  long _minYPos
           
private  boolean _needConnectionWithPreviousBin
           
private  int _nextPointToPlot
           
private  boolean _rangeChanged
           
 long xpos
           
 
Constructor Summary
Plot.Bin(long xPos, int dataset)
           
 
Method Summary
 void addPoint(PlotPoint point, int pointIndex, long ypos)
          Add a point to the bin, with a certain pointIndex (the index in the array of all points in a Plot), and a certain ypos.
 int afterLastPointIndex()
          Return the position after the last point of the range of points within the bin This index is the index within the current points of the plot.
 boolean errorBar()
          Return true in case there is one point that needs an error bar, otherwise false
 int firstPointIndex()
          Return the position of the first point of the range of points within the bin This index is the index within the current points of the plot.
 long firstYPos()
          Return the y position of the first added point in the bin.
 boolean isConnected()
           
 boolean isConnectedWithPreviousBin()
          Return true a line has been drawn to the previous bin.
 long lastYPos()
          Return the y position of the last added point in the bin.
 long maxYPos()
          Return the maximum y position of the bin.
 long minYPos()
          Return the minimum y position of the bin.
 boolean needConnectionWithPreviousBin()
          Return whether a line should be drawn with the previous bin.
 boolean needReplot()
          Return true when the bin should be plotted (again)
 int nextPointToPlot()
          Return the position of the next point of the bin that should be plotted This index is the index within the current points of the plot.
 boolean rangeChanged()
          Return true when the rangeChanged
 void resetDisplayStateAfterPlot()
          Reset the plot state for this bin when you have plotted this bin/
 void setNotConnectedWithPreviousBin()
          Disconnect this bin with the previous bin.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xpos

public final long xpos

_afterLastPointIndex

private int _afterLastPointIndex

_dataset

private int _dataset

_errorBar

private boolean _errorBar

_firstPointIndex

private int _firstPointIndex

_firstYPos

private long _firstYPos

_isConnected

private boolean _isConnected

_isConnectedWithPreviousBin

private boolean _isConnectedWithPreviousBin

_lastYPos

private long _lastYPos

_maxYPos

private long _maxYPos

_minYPos

private long _minYPos

_needConnectionWithPreviousBin

private boolean _needConnectionWithPreviousBin

_rangeChanged

private boolean _rangeChanged

_nextPointToPlot

private int _nextPointToPlot
Constructor Detail

Plot.Bin

public Plot.Bin(long xPos,
                int dataset)
Method Detail

addPoint

public void addPoint(PlotPoint point,
                     int pointIndex,
                     long ypos)
Add a point to the bin, with a certain pointIndex (the index in the array of all points in a Plot), and a certain ypos. Precondition: The xpos of the point should be same as other points already within the bin


afterLastPointIndex

public int afterLastPointIndex()
Return the position after the last point of the range of points within the bin This index is the index within the current points of the plot.


errorBar

public boolean errorBar()
Return true in case there is one point that needs an error bar, otherwise false


firstPointIndex

public int firstPointIndex()
Return the position of the first point of the range of points within the bin This index is the index within the current points of the plot.


firstYPos

public long firstYPos()
Return the y position of the first added point in the bin.


minYPos

public long minYPos()
Return the minimum y position of the bin. Precondition: only valid in case there is at least one point


lastYPos

public long lastYPos()
Return the y position of the last added point in the bin. Precondition: only valid in case there is at least one point


maxYPos

public long maxYPos()
Return the maximum y position of the bin. Precondition: only valid in case there is at least one point


needConnectionWithPreviousBin

public boolean needConnectionWithPreviousBin()
Return whether a line should be drawn with the previous bin. After you have reset the display state, the boolean return false


isConnectedWithPreviousBin

public boolean isConnectedWithPreviousBin()
Return true a line has been drawn to the previous bin.


isConnected

public boolean isConnected()

needReplot

public boolean needReplot()
Return true when the bin should be plotted (again)


nextPointToPlot

public int nextPointToPlot()
Return the position of the next point of the bin that should be plotted This index is the index within the current points of the plot.


rangeChanged

public boolean rangeChanged()
Return true when the rangeChanged


resetDisplayStateAfterPlot

public void resetDisplayStateAfterPlot()
Reset the plot state for this bin when you have plotted this bin/


setNotConnectedWithPreviousBin

public void setNotConnectedWithPreviousBin()
Disconnect this bin with the previous bin.