Class AbstractLeftClickProcessor
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.image.leftclick.AbstractLeftClickProcessor
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<AbstractLeftClickProcessor>
,SizeOfHandler
,ImagePanelLeftClickListener
,Serializable
,EventListener
- Direct Known Subclasses:
AbstractSelectionRectangleBasedLeftClickProcessor
,AddMetaData
,DeleteObjects
,MultiProcessor
,NullProcessor
,ViewObjects
public abstract class AbstractLeftClickProcessor extends AbstractOptionHandler implements ImagePanelLeftClickListener, ShallowCopySupporter<AbstractLeftClickProcessor>
Ancestor for classes that react to selection in an image.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_AltDown
whether alt needs to be down.protected boolean
m_CtrlDown
whether ctrl needs to be down.protected boolean
m_MetaDown
whether meta needs to be down.protected boolean
m_ShiftDown
whether shift needs to be down.-
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 AbstractLeftClickProcessor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
altDownTipText()
Returns the tip text for this property.protected String
check(ImagePanelLeftClickEvent e)
Performs a check on the event.void
clicked(ImagePanelLeftClickEvent e)
Invoked when a left-click happened in aImagePanel
.String
ctrlDownTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.protected void
doImageChanged(ImagePanel.PaintPanel panel)
Notifies the overlay that the image has changed.protected abstract void
doProcessClick(ImagePanel panel, Point position, int modifiersEx)
Process the click that occurred in the image panel.boolean
getAltDown()
Returns whether the alt key needs to be down.boolean
getCtrlDown()
Returns whether the ctrl key needs to be down.boolean
getMetaDown()
Returns whether the meta key needs to be down.boolean
getShiftDown()
Returns whether the shift key needs to be down.void
imageChanged(ImagePanel.PaintPanel panel)
Notifies the overlay that the image has changed.String
metaDownTipText()
Returns the tip text for this property.void
processClick(ImagePanel panel, Point position, int modifiersEx, boolean repaint)
Process the click that occurred in the image panel.void
setAltDown(boolean value)
Sets whether the alt key needs to be down.void
setCtrlDown(boolean value)
Sets whether the ctrl key needs to be down.void
setMetaDown(boolean value)
Sets whether the meta key needs to be down.void
setShiftDown(boolean value)
Sets whether the shift key needs to be down.AbstractLeftClickProcessor
shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.AbstractLeftClickProcessor
shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.String
shiftDownTipText()
Returns the tip text for this property.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, 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
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
setShiftDown
public void setShiftDown(boolean value)
Sets whether the shift key needs to be down.- Parameters:
value
- true if needs to be down
-
getShiftDown
public boolean getShiftDown()
Returns whether the shift key needs to be down.- Returns:
- true if needs to be down
-
shiftDownTipText
public String shiftDownTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setAltDown
public void setAltDown(boolean value)
Sets whether the alt key needs to be down.- Parameters:
value
- true if needs to be down
-
getAltDown
public boolean getAltDown()
Returns whether the alt key needs to be down.- Returns:
- true if needs to be down
-
altDownTipText
public String altDownTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setCtrlDown
public void setCtrlDown(boolean value)
Sets whether the ctrl key needs to be down.- Parameters:
value
- true if needs to be down
-
getCtrlDown
public boolean getCtrlDown()
Returns whether the ctrl key needs to be down.- Returns:
- true if needs to be down
-
ctrlDownTipText
public String ctrlDownTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setMetaDown
public void setMetaDown(boolean value)
Sets whether the meta key needs to be down.- Parameters:
value
- true if needs to be down
-
getMetaDown
public boolean getMetaDown()
Returns whether the meta key needs to be down.- Returns:
- true if needs to be down
-
metaDownTipText
public String metaDownTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
doImageChanged
protected void doImageChanged(ImagePanel.PaintPanel panel)
Notifies the overlay that the image has changed.- Parameters:
panel
- the panel this overlay belongs to
-
imageChanged
public void imageChanged(ImagePanel.PaintPanel panel)
Notifies the overlay that the image has changed.- Specified by:
imageChanged
in interfaceImagePanelLeftClickListener
- Parameters:
panel
- the panel this overlay belongs to
-
doProcessClick
protected abstract void doProcessClick(ImagePanel panel, Point position, int modifiersEx)
Process the click that occurred in the image panel.- Parameters:
panel
- the originposition
- the position of the clickmodifiersEx
- the associated modifiers
-
processClick
public void processClick(ImagePanel panel, Point position, int modifiersEx, boolean repaint)
Process the click that occurred in the image panel.- Parameters:
panel
- the originposition
- the position of the clickmodifiersEx
- the associated modifiersrepaint
- whether to repaint the panel
-
check
protected String check(ImagePanelLeftClickEvent e)
Performs a check on the event.- Parameters:
e
- the event to check- Returns:
- null if OK, otherwise error message
-
clicked
public void clicked(ImagePanelLeftClickEvent e)
Invoked when a left-click happened in aImagePanel
.- Specified by:
clicked
in interfaceImagePanelLeftClickListener
- Parameters:
e
- the event
-
shallowCopy
public AbstractLeftClickProcessor shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopy
in interfaceShallowCopySupporter<AbstractLeftClickProcessor>
- Returns:
- the shallow copy
-
shallowCopy
public AbstractLeftClickProcessor shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopy
in interfaceShallowCopySupporter<AbstractLeftClickProcessor>
- Parameters:
expand
- whether to expand variables to their current values- Returns:
- the shallow copy
-
-