Class AbstractSelectionRectangleBasedSelectionProcessor
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.visualization.image.selection.AbstractSelectionProcessor
-
- adams.gui.visualization.image.selection.AbstractPaintingSelectionProcessor
-
- adams.gui.visualization.image.selection.AbstractSelectionRectangleBasedSelectionProcessor
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<SelectionProcessor>
,SizeOfHandler
,ObjectPrefixHandler
,ImagePanelSelectionListener
,SelectionProcessor
,Serializable
,EventListener
- Direct Known Subclasses:
SelectObjects
public abstract class AbstractSelectionRectangleBasedSelectionProcessor extends AbstractPaintingSelectionProcessor implements ObjectPrefixHandler
Ancestor for selection processors that make use of theSelectionRectangle
class.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
KEY_HEIGHT
the key for the height.static String
KEY_POLY_X
the key for the Xs of the polygon.static String
KEY_POLY_Y
the key for the Ys of the polygon.static String
KEY_WIDTH
the key for the width.static String
KEY_X
the key for the X location.static String
KEY_Y
the key for the Y location.protected List<SelectionRectangle>
m_Locations
the current rectangles.protected int
m_NumDigits
the number of digits to use for left-padding the index.protected String
m_Prefix
the prefix for the objects.-
Fields inherited from class adams.gui.visualization.image.selection.AbstractPaintingSelectionProcessor
m_Color, m_StrokeThickness
-
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 AbstractSelectionRectangleBasedSelectionProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 int
findLastIndex(Report report)
Determines the last index used with the given prefix.protected int
getDefaultNumDigits()
Returns the default number of digits to use.protected String
getDefaultPrefix()
Returns the default prefix to use for the objects.protected List<SelectionRectangle>
getLocations(Report report)
Returns all currently stored locations.int
getNumDigits()
Returns the number of digits to use for the left-padded index.String
getPrefix()
Returns the prefix to use for the objects.String
numDigitsTipText()
Returns the tip text for this property.String
prefixTipText()
Returns the tip text for this property.protected boolean
removeIndex(Report report, int index)
Removes the specified index from the report.protected void
reset()
Resets the scheme.void
setNumDigits(int value)
Sets the number of digits to use for the left-padded index.void
setPrefix(String value)
Sets the prefix to use for the objects.protected Map<String,Object>
valuesForIndex(Report report, int index)
Returns all the values stored in the report under this index.-
Methods inherited from class adams.gui.visualization.image.selection.AbstractPaintingSelectionProcessor
applyStroke, colorTipText, getColor, getDefaultColor, getDefaultStrokeThickness, getStrokeThickness, setColor, setStrokeThickness, strokeThicknessTipText
-
Methods inherited from class adams.gui.visualization.image.selection.AbstractSelectionProcessor
check, doProcessSelection, imageChanged, processSelection, selected, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, 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, getOptionManager, toCommandLine
-
-
-
-
Field Detail
-
KEY_X
public static final String KEY_X
the key for the X location.- See Also:
- Constant Field Values
-
KEY_Y
public static final String KEY_Y
the key for the Y location.- See Also:
- Constant Field Values
-
KEY_WIDTH
public static final String KEY_WIDTH
the key for the width.- See Also:
- Constant Field Values
-
KEY_HEIGHT
public static final String KEY_HEIGHT
the key for the height.- See Also:
- Constant Field Values
-
KEY_POLY_X
public static final String KEY_POLY_X
the key for the Xs of the polygon.- See Also:
- Constant Field Values
-
KEY_POLY_Y
public static final String KEY_POLY_Y
the key for the Ys of the polygon.- See Also:
- Constant Field Values
-
m_Prefix
protected String m_Prefix
the prefix for the objects.
-
m_NumDigits
protected int m_NumDigits
the number of digits to use for left-padding the index.
-
m_Locations
protected List<SelectionRectangle> m_Locations
the current rectangles.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractPaintingSelectionProcessor
-
reset
protected void reset()
Resets the scheme.- Overrides:
reset
in classAbstractOptionHandler
-
getDefaultPrefix
protected String getDefaultPrefix()
Returns the default prefix to use for the objects.- Returns:
- the default
-
setPrefix
public void setPrefix(String value)
Sets the prefix to use for the objects.- Specified by:
setPrefix
in interfaceObjectPrefixHandler
- Parameters:
value
- the prefix
-
getPrefix
public String getPrefix()
Returns the prefix to use for the objects.- Specified by:
getPrefix
in interfaceObjectPrefixHandler
- Returns:
- the prefix
-
prefixTipText
public String prefixTipText()
Returns the tip text for this property.- Specified by:
prefixTipText
in interfaceObjectPrefixHandler
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDefaultNumDigits
protected int getDefaultNumDigits()
Returns the default number of digits to use.- Returns:
- the default
-
setNumDigits
public void setNumDigits(int value)
Sets the number of digits to use for the left-padded index.- Parameters:
value
- the number of digits
-
getNumDigits
public int getNumDigits()
Returns the number of digits to use for the left-padded index.- Returns:
- the number of digits
-
numDigitsTipText
public String numDigitsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
valuesForIndex
protected Map<String,Object> valuesForIndex(Report report, int index)
Returns all the values stored in the report under this index.- Parameters:
report
- the report to look up the index inindex
- the index to retrieve the values for- Returns:
- the values
-
removeIndex
protected boolean removeIndex(Report report, int index)
Removes the specified index from the report.- Returns:
- true if successfully removed
-
findLastIndex
protected int findLastIndex(Report report)
Determines the last index used with the given prefix.
-
getLocations
protected List<SelectionRectangle> getLocations(Report report)
Returns all currently stored locations.- Parameters:
report
- the report to get the locations from- Returns:
- the locations
-
doImageChanged
protected void doImageChanged(ImagePanel.PaintPanel panel)
Notifies the overlay that the image has changed.- Overrides:
doImageChanged
in classAbstractSelectionProcessor
- Parameters:
panel
- the panel this overlay belongs to
-
-