Package adams.gui.visualization.core
Class AbstractMouseMovementTracker
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.core.AbstractMouseMovementTracker
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<MouseMovementTracker>
,SizeOfHandler
,MouseMovementTracker
,Serializable
- Direct Known Subclasses:
NullTracker
,TrackMousePositionInConsole
public abstract class AbstractMouseMovementTracker extends AbstractOptionHandler implements MouseMovementTracker, ShallowCopySupporter<MouseMovementTracker>
An abstract superclass for mouse movement trackers.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected PaintablePanel
m_Panel
the panel this tracker is for.-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractMouseMovementTracker()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static MouseMovementTracker
forCommandLine(String cmdline)
Instantiates the paintlet from the given commandline (i.e., classname and optional options).static MouseMovementTracker
forName(String classname, String[] options)
Instantiates the paintlet with the given options.static String[]
getMouseMovementTrackers()
Returns a list with classnames of paintlets.PaintablePanel
getPanel()
Returns the panel currently in use.PlotPanel
getPlot()
Returns the plot panel of the panel, null if no panel present.boolean
hasPanel()
Returns whether a panel has been set.protected void
initialize()
Initializes the members.abstract void
mouseMovementTracked(MouseEvent e)
Gets triggered when the mouse moved.void
setPanel(PaintablePanel value)
Sets the panel to use, null to disable painting.MouseMovementTracker
shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.MouseMovementTracker
shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.MouseMovementTracker
shallowCopyTracker()
Returns a shallow copy of the tracker.MouseMovementTracker
shallowCopyTracker(boolean expand)
Returns a shallow copy of the tracker.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, 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
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Panel
protected PaintablePanel m_Panel
the panel this tracker is for.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classAbstractOptionHandler
-
setPanel
public void setPanel(PaintablePanel value)
Sets the panel to use, null to disable painting.- Specified by:
setPanel
in interfaceMouseMovementTracker
- Parameters:
value
- the panel to paint on
-
getPanel
public PaintablePanel getPanel()
Returns the panel currently in use.- Specified by:
getPanel
in interfaceMouseMovementTracker
- Returns:
- the panel in use
-
hasPanel
public boolean hasPanel()
Returns whether a panel has been set.- Returns:
- true if a panel is currently set
-
getPlot
public PlotPanel getPlot()
Returns the plot panel of the panel, null if no panel present.- Returns:
- the plot panel
-
mouseMovementTracked
public abstract void mouseMovementTracked(MouseEvent e)
Gets triggered when the mouse moved.- Specified by:
mouseMovementTracked
in interfaceMouseMovementTracker
- Parameters:
e
- the mouse event that triggered the event
-
shallowCopy
public MouseMovementTracker shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopy
in interfaceShallowCopySupporter<MouseMovementTracker>
- Returns:
- the shallow copy
-
shallowCopy
public MouseMovementTracker shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopy
in interfaceShallowCopySupporter<MouseMovementTracker>
- Parameters:
expand
- whether to expand variables to their current values- Returns:
- the shallow copy
-
shallowCopyTracker
public MouseMovementTracker shallowCopyTracker()
Returns a shallow copy of the tracker. Doesn't expand variables in case ofOptionHandler
objects.- Specified by:
shallowCopyTracker
in interfaceMouseMovementTracker
- Returns:
- a shallow copy of the tracker
-
shallowCopyTracker
public MouseMovementTracker shallowCopyTracker(boolean expand)
Returns a shallow copy of the tracker.- Specified by:
shallowCopyTracker
in interfaceMouseMovementTracker
- Parameters:
expand
- whether to expand variables to their actual value- Returns:
- a shallow copy of the tracker
-
getMouseMovementTrackers
public static String[] getMouseMovementTrackers()
Returns a list with classnames of paintlets.- Returns:
- the filter classnames
-
forName
public static MouseMovementTracker forName(String classname, String[] options)
Instantiates the paintlet with the given options.- Parameters:
classname
- the classname of the paintlet to instantiateoptions
- the options for the paintlet- Returns:
- the instantiated paintlet or null if an error occurred
-
forCommandLine
public static MouseMovementTracker forCommandLine(String cmdline)
Instantiates the paintlet from the given commandline (i.e., classname and optional options).- Parameters:
cmdline
- the classname (and optional options) of the paintlet to instantiate- Returns:
- the instantiated paintlet or null if an error occurred
-
-