org.opensourcephysics.cabrillo.tracker
Class SpectralLineFilter

java.lang.Object
  extended by org.opensourcephysics.media.core.Filter
      extended by org.opensourcephysics.cabrillo.tracker.SpectralLineFilter
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener

public class SpectralLineFilter
extends Filter
implements java.beans.PropertyChangeListener

This is a Filter that draws gas spectral lines on the source image.

Version:
1.0
Author:
Douglas Brown

Field Summary
protected  java.awt.Color color
           
protected  TPoint end1
           
protected  TPoint end2
           
protected  java.awt.geom.Line2D line
           
protected  java.awt.BasicStroke stroke
           
protected  java.util.Collection<java.lang.Double> wavelengths
           
 
Fields inherited from class org.opensourcephysics.media.core.Filter
ableButton, clearButton, closeButton, deleteItem, enabledAction, enabledItem, frame, hasInspector, inspectorVisible, inspectorX, inspectorY, propertiesItem, stack, support, vidPanel
 
Constructor Summary
SpectralLineFilter()
          Constructs a SpectralLineFilter object.
 
Method Summary
static SpectralLineFilter getFilter(TrackerPanel panel)
          Gets the spectral line filter for the specified tracker panel.
 java.awt.image.BufferedImage getFilteredImage(java.awt.image.BufferedImage sourceImage)
          Applies the filter to a source image and returns the result.
 javax.swing.JDialog getInspector()
          Implements abstract Filter method.
static XML.ObjectLoader getLoader()
          Returns an XML.ObjectLoader to save and load filter data.
 void propertyChange(java.beans.PropertyChangeEvent e)
          Responds to property change events.
 void setTrackerPanel(TrackerPanel panel)
          Sets the tracker panel whose coords determine where the lines are drawn.
 
Methods inherited from class org.opensourcephysics.media.core.Filter
addPropertyChangeListener, addPropertyChangeListener, clear, getMenu, isEnabled, refresh, removePropertyChangeListener, removePropertyChangeListener, setEnabled, setVideoPanel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

end1

protected TPoint end1

end2

protected TPoint end2

line

protected java.awt.geom.Line2D line

color

protected java.awt.Color color

stroke

protected java.awt.BasicStroke stroke

wavelengths

protected java.util.Collection<java.lang.Double> wavelengths
Constructor Detail

SpectralLineFilter

public SpectralLineFilter()
Constructs a SpectralLineFilter object.

Method Detail

setTrackerPanel

public void setTrackerPanel(TrackerPanel panel)
Sets the tracker panel whose coords determine where the lines are drawn.

Parameters:
panel - a tracker panel

getFilteredImage

public java.awt.image.BufferedImage getFilteredImage(java.awt.image.BufferedImage sourceImage)
Applies the filter to a source image and returns the result.

Specified by:
getFilteredImage in class Filter
Parameters:
sourceImage - the source image
Returns:
the filtered image

getInspector

public javax.swing.JDialog getInspector()
Implements abstract Filter method.

Specified by:
getInspector in class Filter
Returns:
the inspector

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Responds to property change events. Implements PropertyChangeListener.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
e - the property change event

getFilter

public static SpectralLineFilter getFilter(TrackerPanel panel)
Gets the spectral line filter for the specified tracker panel.

Parameters:
panel - a tracker panel
Returns:
the filter

getLoader

public static XML.ObjectLoader getLoader()
Returns an XML.ObjectLoader to save and load filter data.

Returns:
the object loader