Class AbstractSelectionProcessor
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.image.selection.AbstractSelectionProcessor
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<SelectionProcessor>
,SizeOfHandler
,ImagePanelSelectionListener
,SelectionProcessor
,Serializable
,EventListener
- Direct Known Subclasses:
AbstractPaintingSelectionProcessor
,CopyToClipboard
,Crop
,MultiSelectionProcessor
,NullProcessor
,ShowCoordinates
public abstract class AbstractSelectionProcessor extends AbstractOptionHandler implements SelectionProcessor
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 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 AbstractSelectionProcessor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected String
check(ImagePanelSelectionEvent e)
Performs a check on the event.protected void
doImageChanged(ImagePanel.PaintPanel panel)
Notifies the overlay that the image has changed.protected abstract void
doProcessSelection(ImagePanel panel, Point topLeft, Point bottomRight, List<Point> trace, int modifiersEx)
Process the selection that occurred in the image panel.void
imageChanged(ImagePanel.PaintPanel panel)
Notifies the overlay that the image has changed.void
processSelection(ImagePanel panel, Point topLeft, Point bottomRight, List<Point> trace, int modifiersEx)
Process the selection that occurred in the image panel.void
selected(ImagePanelSelectionEvent e)
Invoked when a selection happened in aImagePanel
.SelectionProcessor
shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.SelectionProcessor
shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, 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.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, defineOptions, getOptionManager, toCommandLine
-
-
-
-
Method Detail
-
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 interfaceImagePanelSelectionListener
- Parameters:
panel
- the panel this overlay belongs to
-
doProcessSelection
protected abstract void doProcessSelection(ImagePanel panel, Point topLeft, Point bottomRight, List<Point> trace, int modifiersEx)
Process the selection that occurred in the image panel.- Parameters:
panel
- the origintopLeft
- the top-left position of the selectionbottomRight
- the bottom-right position of the selectiontrace
- the trace from the selectionmodifiersEx
- the associated modifiers
-
processSelection
public void processSelection(ImagePanel panel, Point topLeft, Point bottomRight, List<Point> trace, int modifiersEx)
Process the selection that occurred in the image panel.- Specified by:
processSelection
in interfaceSelectionProcessor
- Parameters:
panel
- the origintopLeft
- the top-left position of the selectionbottomRight
- the bottom-right position of the selectiontrace
- the trace from the selectionmodifiersEx
- the associated modifiers
-
check
protected String check(ImagePanelSelectionEvent e)
Performs a check on the event.- Parameters:
e
- the event to check- Returns:
- null if OK, otherwise error message
-
selected
public void selected(ImagePanelSelectionEvent e)
Invoked when a selection happened in aImagePanel
.- Specified by:
selected
in interfaceImagePanelSelectionListener
- Parameters:
e
- the event
-
shallowCopy
public SelectionProcessor shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopy
in interfaceShallowCopySupporter<SelectionProcessor>
- Returns:
- the shallow copy
-
shallowCopy
public SelectionProcessor shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopy
in interfaceShallowCopySupporter<SelectionProcessor>
- Parameters:
expand
- whether to expand variables to their current values- Returns:
- the shallow copy
-
-