edu.swri.swiftvis.filters
Class BinnedFilter

java.lang.Object
  extended by edu.swri.swiftvis.filters.AbstractMultipleSourceFilter
      extended by edu.swri.swiftvis.filters.BinnedFilter
All Implemented Interfaces:
DataSink, DataSource, Filter, GraphElement, java.io.Serializable

public class BinnedFilter
extends AbstractMultipleSourceFilter

This filter is intended to provide the user with the ability to bin the input values in one or more dimensions. This can be done either by simple counting of how many elements land in each bin, or by taking the average value of some expression on the elements that land in the bin. This can be plotted up by passing it to something like an AveragedSurface plot that will draw the surface or bins and nicely color them. The tabulation of the bins is done in a pseudo-sparse manner. The standard output is not sparse because it takes significantly more logic to plot that.

See Also:
Serialized Form

Nested Class Summary
private  class BinnedFilter.BinData
           
private  class BinnedFilter.BinValueSpec
           
private  class BinnedFilter.CoordinateData
           
 
Field Summary
private  boolean addAveragedSurfaceBuffers
           
private  java.util.Vector<BinnedFilter.CoordinateData> coordinateData
           
private  javax.swing.JList coordinateList
           
private  javax.swing.JPanel coordinatePanel
           
private  boolean makeFinalDataSparse
           
private static long serialVersionUID
           
private  javax.swing.JList valueList
           
private  javax.swing.JPanel valuePanel
           
private  java.util.Vector<BinnedFilter.BinValueSpec> valueSpecs
           
 
Fields inherited from class edu.swri.swiftvis.filters.AbstractMultipleSourceFilter
bounds, changed, dataVect, inputVector, propPanel, sinkVector
 
Constructor Summary
  BinnedFilter()
           
private BinnedFilter(BinnedFilter c, java.util.List<GraphElement> l)
           
 
Method Summary
private  void addCoordinate()
           
private  void addValue()
           
 BinnedFilter copy(java.util.List<GraphElement> l)
           
private  void fillVector(java.lang.Object[] bins, int coordNum, float[] elementData)
           
private  void finalizeBins(java.lang.Object[] bins)
           
 java.lang.String getDescription()
           
 int getNumParameters()
           
 int getNumValues()
           
 java.lang.String getParameterDescription(int which)
          Tells you what a particular parameter is used for.
 java.lang.String getParameterName(int which, int paramVal)
          Tells you the text that should be used to describe a particular value of a given parameter.
static java.lang.String getTypeDescription()
           
 java.lang.String getValueDescription(int which)
          Tells you what a particular value is used for.
private  void newCoordinateSelected()
           
private  void newValueSelected()
           
protected  void redoAllElements()
          This method is intended to reprocess all the input elements to redo the output.
private  void removeCoordinate()
           
private  void removeValue()
           
protected  void setupSpecificPanelProperties()
          This method should add any tabbed panes to the propPanel that are specific to the given filter.
private  void storeValues(int index, float[] values, java.lang.Object[] bins, int coordNum)
           
private  void storeValuesLast(int index, float[] values, BinnedFilter.BinData[] bins, int coordNum)
           
 boolean useParameterNameString(int which)
          If this returns true then the value of a parameter for this type should be listed as the strong value returned by getParameterName.
 
Methods inherited from class edu.swri.swiftvis.filters.AbstractMultipleSourceFilter
abstractRedoAllElements, addInput, addOutput, clearData, getBounds, getElement, getNumElements, getNumOutputs, getNumSources, getOutput, getOutputInfoPanel, getPaint, getPropertiesPanel, getSource, getSourceInfoPanel, relink, removeInput, removeOutput, setBounds, sourceAltered, validInput
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

coordinateData

private java.util.Vector<BinnedFilter.CoordinateData> coordinateData

valueSpecs

private java.util.Vector<BinnedFilter.BinValueSpec> valueSpecs

addAveragedSurfaceBuffers

private boolean addAveragedSurfaceBuffers

makeFinalDataSparse

private boolean makeFinalDataSparse

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

coordinateList

private transient javax.swing.JList coordinateList

valueList

private transient javax.swing.JList valueList

coordinatePanel

private transient javax.swing.JPanel coordinatePanel

valuePanel

private transient javax.swing.JPanel valuePanel
Constructor Detail

BinnedFilter

public BinnedFilter()

BinnedFilter

private BinnedFilter(BinnedFilter c,
                     java.util.List<GraphElement> l)
Method Detail

getDescription

public java.lang.String getDescription()

getTypeDescription

public static java.lang.String getTypeDescription()

setupSpecificPanelProperties

protected void setupSpecificPanelProperties()
Description copied from class: AbstractMultipleSourceFilter
This method should add any tabbed panes to the propPanel that are specific to the given filter. This is called when the propPanel is created. After it is called, the source and output info panels are added.

Specified by:
setupSpecificPanelProperties in class AbstractMultipleSourceFilter

getParameterDescription

public java.lang.String getParameterDescription(int which)
Tells you what a particular parameter is used for.


useParameterNameString

public boolean useParameterNameString(int which)
If this returns true then the value of a parameter for this type should be listed as the strong value returned by getParameterName. Otherwise just the number should be displayed.


getParameterName

public java.lang.String getParameterName(int which,
                                         int paramVal)
Tells you the text that should be used to describe a particular value of a given parameter.


getValueDescription

public java.lang.String getValueDescription(int which)
Tells you what a particular value is used for.


getNumParameters

public int getNumParameters()
Specified by:
getNumParameters in interface DataSource
Overrides:
getNumParameters in class AbstractMultipleSourceFilter

getNumValues

public int getNumValues()
Specified by:
getNumValues in interface DataSource
Overrides:
getNumValues in class AbstractMultipleSourceFilter

copy

public BinnedFilter copy(java.util.List<GraphElement> l)

newCoordinateSelected

private void newCoordinateSelected()

addCoordinate

private void addCoordinate()

removeCoordinate

private void removeCoordinate()

newValueSelected

private void newValueSelected()

addValue

private void addValue()

removeValue

private void removeValue()

redoAllElements

protected void redoAllElements()
Description copied from class: AbstractMultipleSourceFilter
This method is intended to reprocess all the input elements to redo the output. It must be properly implemented by all extending classes.

Specified by:
redoAllElements in class AbstractMultipleSourceFilter

storeValues

private void storeValues(int index,
                         float[] values,
                         java.lang.Object[] bins,
                         int coordNum)

storeValuesLast

private void storeValuesLast(int index,
                             float[] values,
                             BinnedFilter.BinData[] bins,
                             int coordNum)

finalizeBins

private void finalizeBins(java.lang.Object[] bins)

fillVector

private void fillVector(java.lang.Object[] bins,
                        int coordNum,
                        float[] elementData)