Package adams.gui.visualization.spectrum
Class SpectrumPointHitDetector
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.core.plot.AbstractHitDetector<H,P>
-
- adams.gui.visualization.core.plot.AbstractDistanceBasedHitDetector<List<SpectrumPoint>,String>
-
- adams.gui.visualization.spectrum.SpectrumPointHitDetector
-
- 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.ContainerHitDetector<List<SpectrumPoint>,String,SpectrumContainer>,adams.gui.visualization.core.plot.HitDetector<List<SpectrumPoint>,String>,Serializable
public class SpectrumPointHitDetector extends adams.gui.visualization.core.plot.AbstractDistanceBasedHitDetector<List<SpectrumPoint>,String> implements adams.gui.visualization.core.plot.ContainerHitDetector<List<SpectrumPoint>,String,SpectrumContainer>
Detects selections of spectrum points in the spectrum panel.- 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.-
Fields inherited from class adams.gui.visualization.core.plot.AbstractDistanceBasedHitDetector
m_MinimumPixelDifference
-
-
Constructor Summary
Constructors Constructor Description SpectrumPointHitDetector(SpectrumPanel owner)Initializes the hit detector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanUp()Cleans up data structures, frees up memory.SpectrumContainer[]containers(MouseEvent e)Detects hits and associates them with the containers.SpectrumPanelgetOwner()Returns the owner.StringglobalInfo()Returns a string describing the object.protected List<SpectrumPoint>isHit(MouseEvent e)Checks for a hit.protected StringprocessHit(MouseEvent e, List<SpectrumPoint> hit)Performs the action when a hit is detected.-
Methods inherited from class adams.gui.visualization.core.plot.AbstractDistanceBasedHitDetector
defineOptions, distance, getDefaultMinimumPixelDifference, getMinimumPixelDifference, minimumPixelDifferenceTipText, setMinimumPixelDifference
-
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, 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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
m_Owner
protected SpectrumPanel m_Owner
the owner of this detector.
-
-
Constructor Detail
-
SpectrumPointHitDetector
public SpectrumPointHitDetector(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 List<SpectrumPoint> isHit(MouseEvent e)
- Specified by:
isHitin classadams.gui.visualization.core.plot.AbstractHitDetector<List<SpectrumPoint>,String>- Parameters:
e- the MouseEvent (for coordinates)- Returns:
- the associated object with the hit, otherwise null
-
processHit
protected String processHit(MouseEvent e, List<SpectrumPoint> hit)
Performs the action when a hit is detected.- Specified by:
processHitin classadams.gui.visualization.core.plot.AbstractHitDetector<List<SpectrumPoint>,String>- Parameters:
e- the MouseEvent (for coordinates)hit- the object that got determined by the hit- Returns:
- the generated appendix for the tiptext
-
containers
public SpectrumContainer[] containers(MouseEvent e)
Detects hits and associates them with the containers.- Specified by:
containersin interfaceadams.gui.visualization.core.plot.ContainerHitDetector<List<SpectrumPoint>,String,SpectrumContainer>- Parameters:
e- the mouse event to analyze for a hit- Returns:
- optional result of processing the event
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUpin interfaceadams.core.CleanUpHandler- Overrides:
cleanUpin classadams.gui.visualization.core.plot.AbstractHitDetector<List<SpectrumPoint>,String>
-
-