edu.swri.swiftvis.filters
Class SliceSelectionFilter

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

public class SliceSelectionFilter
extends AbstractSingleSourceFilter
implements PlotListener

This is a filter that takes a single source and selects elements in a certain region. This filter type implements PlotListener so it takes inputs from the user clicking on plots or key presses on the plots. These are used to relocate the the region that is selected. The filter uses two formulas and uses the values of those as Cartesian coordinates for doing selection on rectangular regions. The clicks can be set to either relocate the view region, or to resize it.

Author:
Mark Lewis
See Also:
Serialized Form

Nested Class Summary
private static class SliceSelectionFilter.CutStyle
           
 
Field Summary
private  SliceSelectionFilter.CutStyle cutStyle
           
private  DataFormula f1
           
private  DataFormula f2
           
private  EditableString name
           
private  EditableDouble p1
           
private  EditableDouble p2
           
private  EditableBoolean redoOnDrag
           
private  EditableDouble s1
           
private  EditableDouble s2
           
private static long serialVersionUID
           
private  javax.swing.JLabel v1Label
           
private  javax.swing.JLabel v2Label
           
private  EditableDouble width
           
 
Fields inherited from class edu.swri.swiftvis.filters.AbstractSingleSourceFilter
bounds, changed, dataVect, input, propPanel, sinkVector
 
Constructor Summary
SliceSelectionFilter()
           
SliceSelectionFilter(SliceSelectionFilter c, java.util.List<GraphElement> l)
           
 
Method Summary
 SliceSelectionFilter copy(java.util.List<GraphElement> l)
           
 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.
 java.awt.Shape getSelectionRegion()
          This method can be used by plot listeners to tell a certain plot style what region is being investigated.
static java.lang.String getTypeDescription()
           
 java.lang.String getValueDescription(int which)
          Tells you what a particular value is used for.
 void keyPressed(java.awt.event.KeyEvent e)
          This is called when a key is pressed.
 void keyReleased(java.awt.event.KeyEvent e)
          This is called when a key is released.
 void keyTyped(java.awt.event.KeyEvent e)
          This is called when a key is typed.
 void mouseClicked(double v1, double v2, java.awt.event.MouseEvent e)
          This is called when a mouse button is clicked.
 void mouseDragged(double v1, double v2, java.awt.event.MouseEvent e)
          This is called when the mouse is dragged.
 void mouseMoved(double v1, double v2, java.awt.event.MouseEvent e)
          This is called when the mouse is moved.
 void mousePressed(double v1, double v2, java.awt.event.MouseEvent e)
          This is called when a mouse button is pressed.
 void mouseReleased(double v1, double v2, java.awt.event.MouseEvent e)
          This is called when a mouse button is released.
protected  void redoAllElements()
          This method is intended to reprocess all the input elements to redo the output.
protected  void setupSpecificPanelProperties()
          This method should add any tabbed panes to the propPanel that are specific to the given filter.
 java.lang.String toString()
           
 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.AbstractSingleSourceFilter
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, wait, wait, wait
 
Methods inherited from interface edu.swri.swiftvis.GraphElement
clearData, getBounds, getPaint, getPropertiesPanel, relink, setBounds
 

Field Detail

name

private EditableString name

f1

private DataFormula f1

f2

private DataFormula f2

p1

private EditableDouble p1

s1

private EditableDouble s1

p2

private EditableDouble p2

s2

private EditableDouble s2

cutStyle

private SliceSelectionFilter.CutStyle cutStyle

width

private EditableDouble width

redoOnDrag

private EditableBoolean redoOnDrag

v1Label

private transient javax.swing.JLabel v1Label

v2Label

private transient javax.swing.JLabel v2Label

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

SliceSelectionFilter

public SliceSelectionFilter()

SliceSelectionFilter

public SliceSelectionFilter(SliceSelectionFilter c,
                            java.util.List<GraphElement> l)
Method Detail

redoAllElements

protected void redoAllElements()
Description copied from class: AbstractSingleSourceFilter
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 AbstractSingleSourceFilter

setupSpecificPanelProperties

protected void setupSpecificPanelProperties()
Description copied from class: AbstractSingleSourceFilter
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 AbstractSingleSourceFilter

mousePressed

public void mousePressed(double v1,
                         double v2,
                         java.awt.event.MouseEvent e)
Description copied from interface: PlotListener
This is called when a mouse button is pressed.

Specified by:
mousePressed in interface PlotListener
Parameters:
v1 - The primary coordinate in the plot where it was pressed.
v2 - The secondary coordinate in the plot where it was pressed.
e - The event that triggered the call.

mouseReleased

public void mouseReleased(double v1,
                          double v2,
                          java.awt.event.MouseEvent e)
Description copied from interface: PlotListener
This is called when a mouse button is released.

Specified by:
mouseReleased in interface PlotListener
Parameters:
v1 - The primary coordinate in the plot where it was pressed.
v2 - The secondary coordinate in the plot where it was pressed.
e - The event that triggered the call.

mouseClicked

public void mouseClicked(double v1,
                         double v2,
                         java.awt.event.MouseEvent e)
Description copied from interface: PlotListener
This is called when a mouse button is clicked.

Specified by:
mouseClicked in interface PlotListener
Parameters:
v1 - The primary coordinate in the plot where it was pressed.
v2 - The secondary coordinate in the plot where it was pressed.
e - The event that triggered the call.

mouseMoved

public void mouseMoved(double v1,
                       double v2,
                       java.awt.event.MouseEvent e)
Description copied from interface: PlotListener
This is called when the mouse is moved.

Specified by:
mouseMoved in interface PlotListener
Parameters:
v1 - The primary coordinate in the plot where it was pressed.
v2 - The secondary coordinate in the plot where it was pressed.
e - The event that triggered the call.

mouseDragged

public void mouseDragged(double v1,
                         double v2,
                         java.awt.event.MouseEvent e)
Description copied from interface: PlotListener
This is called when the mouse is dragged.

Specified by:
mouseDragged in interface PlotListener
Parameters:
v1 - The primary coordinate in the plot where it was pressed.
v2 - The secondary coordinate in the plot where it was pressed.
e - The event that triggered the call.

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Description copied from interface: PlotListener
This is called when a key is pressed.

Specified by:
keyPressed in interface PlotListener
Parameters:
e - The event that triggered the call.

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Description copied from interface: PlotListener
This is called when a key is released.

Specified by:
keyReleased in interface PlotListener
Parameters:
e - The event that triggered the call.

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Description copied from interface: PlotListener
This is called when a key is typed.

Specified by:
keyTyped in interface PlotListener
Parameters:
e - The event that triggered the call.

getSelectionRegion

public java.awt.Shape getSelectionRegion()
Description copied from interface: PlotListener
This method can be used by plot listeners to tell a certain plot style what region is being investigated. This can provide the user with input as to what is being seen in other plots.

Specified by:
getSelectionRegion in interface PlotListener
Returns:
The shape for the selected region.

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface GraphElement

getTypeDescription

public static java.lang.String getTypeDescription()

copy

public SliceSelectionFilter copy(java.util.List<GraphElement> l)
Specified by:
copy in interface GraphElement

getNumParameters

public int getNumParameters()
Specified by:
getNumParameters in interface DataSource

getParameterDescription

public java.lang.String getParameterDescription(int which)
Description copied from interface: DataSource
Tells you what a particular parameter is used for.

Specified by:
getParameterDescription in interface DataSource

useParameterNameString

public boolean useParameterNameString(int which)
Description copied from interface: DataSource
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.

Specified by:
useParameterNameString in interface DataSource

getParameterName

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

Specified by:
getParameterName in interface DataSource

getNumValues

public int getNumValues()
Specified by:
getNumValues in interface DataSource

getValueDescription

public java.lang.String getValueDescription(int which)
Description copied from interface: DataSource
Tells you what a particular value is used for.

Specified by:
getValueDescription in interface DataSource

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object