Package adams.gui.visualization.spectrum
Class WaveNumberHitDetector
-
- All Implemented Interfaces:
adams.core.CleanUpHandler,adams.core.Destroyable,adams.core.GlobalInfoSupporter,adams.core.logging.LoggingLevelHandler,adams.core.logging.LoggingSupporter,adams.core.option.OptionHandler,adams.core.SizeOfHandler,adams.gui.visualization.core.plot.HitDetector<Double,Object>,Serializable
public class WaveNumberHitDetector extends adams.gui.visualization.core.plot.AbstractHitDetector<Double,Object>
Detects selections of wave numbers.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected SpectrumPanelm_Ownerthe owner of this detector.
-
Constructor Summary
Constructors Constructor Description WaveNumberHitDetector(SpectrumPanel owner)Initializes the hit detector.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanUp()Cleans up data structures, frees up memory.protected static SpectrumPointfindClosestSpectrumPoint(SpectrumContainerManager manager, float waveno)Returns the closest spectrum point to the specified wave number across all visible spectra.SpectrumPanelgetOwner()Returns the owner.StringglobalInfo()Returns a string describing the object.protected DoubleisHit(MouseEvent e)Checks for a hit.protected ObjectprocessHit(MouseEvent e, Double hit)Performs the action when a hit is detected.static voidselect(SpectrumPanel panel, float waveno)Selects a wave number.-
Methods inherited from class adams.gui.visualization.core.plot.AbstractHitDetector
detect, getDebug, isEnabled, locate, setDebug, setEnabled
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_Owner
protected SpectrumPanel m_Owner
the owner of this detector.
-
-
Constructor Detail
-
WaveNumberHitDetector
public WaveNumberHitDetector(SpectrumPanel owner)
Initializes the hit detector.- Parameters:
owner- the panel that uses this detector
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin classadams.core.option.AbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
getOwner
public SpectrumPanel getOwner()
Returns the owner.- Returns:
- the owning panel
-
isHit
protected Double isHit(MouseEvent e)
Checks for a hit.
-
processHit
protected Object processHit(MouseEvent e, Double hit)
Performs the action when a hit is detected.
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.
-
findClosestSpectrumPoint
protected static SpectrumPoint findClosestSpectrumPoint(SpectrumContainerManager manager, float waveno)
Returns the closest spectrum point to the specified wave number across all visible spectra.- Parameters:
manager- the container managerwaveno- the wave number to get the closest point for- Returns:
- the point, null if none found
-
select
public static void select(SpectrumPanel panel, float waveno)
Selects a wave number.- Parameters:
panel- the spectrum panel to operate onewaveno- the wave number to select
-
-