Class SelectObjects
- java.lang.Object
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<SelectionProcessor>
,SizeOfHandler
,ObjectPrefixHandler
,ImagePanelSelectionListener
,InteractionLoggingSupporter
,SelectionProcessor
,SelectionProcessorWithLabelSupport
,Serializable
,EventListener
public class SelectObjects extends AbstractSelectionRectangleBasedSelectionProcessor implements SelectionProcessorWithLabelSupport, InteractionLoggingSupporter
Allows the user to select objects in the image.
The locations get stored in the attached report.
If the <ctrl> key is pressed while drawing a selection rectangle, all enclosed locations get removed.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-color <java.awt.Color> (property: color) The color to use for painting. default: #ff0000
-stroke-thickness <float> (property: strokeThickness) The thickness of the stroke. default: 1.0 minimum: 0.01
-prefix <java.lang.String> (property: prefix) The prefix to use for the fields in the report. default: Object.
-num-digits <int> (property: numDigits) The number of digits to use for left-padding the index with zeroes. default: 4 minimum: 0
-label <java.lang.String> (property: label) The label to use for the objects, not set if empty. default:
-label-suffix <java.lang.String> (property: labelSuffix) The suffix to use for storing the label in the report. default: .type
-add-meta-data <boolean> (property: addMetaData) If enabled, a dialog gets shown to add meta-data to the object. default: false
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_AddMetaData
whether to add meta-data.protected AddMetaData
m_AddMetaDataInstance
the AddMetaData instance.protected String
m_Label
the label to use.protected String
m_LabelSuffix
the label suffix to use.-
Fields inherited from class adams.gui.visualization.image.selection.AbstractSelectionRectangleBasedSelectionProcessor
KEY_HEIGHT, KEY_POLY_X, KEY_POLY_Y, KEY_WIDTH, KEY_X, KEY_Y, m_Locations, m_NumDigits, m_Prefix
-
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 SelectObjects()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
addMetaDataTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.protected void
doProcessSelection(ImagePanel panel, Point topLeft, Point bottomRight, List<Point> trace, int modifiersEx)
Process the selection that occurred in the image panel.boolean
getAddMetaData()
Returns whether to allow adding meta-data to the object.protected Color
getDefaultColor()
Returns the default color to use.protected String
getDefaultLabel()
Returns the default label to use for the objects.protected String
getDefaultLabelSuffix()
Returns the default suffix to use for the label.String
getLabel()
Returns the label to use for the objects.String
getLabelSuffix()
Returns the suffix to use for the label.String
globalInfo()
Returns a string describing the object.String
labelSuffixTipText()
Returns the tip text for this property.String
labelTipText()
Returns the tip text for this property.protected void
logAdd(ImagePanel panel, int x, int y, int w, int h, int[] poly_x, int[] poly_y)
Logs the adding of an object.protected void
logRemove(ImagePanel panel, int x, int y, int w, int h, List<Map<String,Object>> removed)
Logs the removal of the of objects.void
setAddMetaData(boolean value)
Sets whether to allow adding meta-data to the object.void
setLabel(String value)
Sets the label to use for the objects.void
setLabelSuffix(String value)
Sets the suffix to use for the label.boolean
supportsInteractionLogging()
Returns whether interaction logging is supported.-
Methods inherited from class adams.gui.visualization.image.selection.AbstractSelectionRectangleBasedSelectionProcessor
doImageChanged, findLastIndex, getDefaultNumDigits, getDefaultPrefix, getLocations, getNumDigits, getPrefix, numDigitsTipText, prefixTipText, removeIndex, reset, setNumDigits, setPrefix, valuesForIndex
-
Methods inherited from class adams.gui.visualization.image.selection.AbstractPaintingSelectionProcessor
applyStroke, colorTipText, getColor, getDefaultStrokeThickness, getStrokeThickness, setColor, setStrokeThickness, strokeThicknessTipText
-
Methods inherited from class adams.gui.visualization.image.selection.AbstractSelectionProcessor
check, imageChanged, processSelection, selected, shallowCopy, shallowCopy
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, 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.gui.event.ImagePanelSelectionListener
imageChanged, selected
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
Methods inherited from interface adams.gui.visualization.image.selection.SelectionProcessor
processSelection
-
Methods inherited from interface adams.core.ShallowCopySupporter
shallowCopy, shallowCopy
-
-
-
-
Field Detail
-
m_Label
protected String m_Label
the label to use.
-
m_LabelSuffix
protected String m_LabelSuffix
the label suffix to use.
-
m_AddMetaData
protected boolean m_AddMetaData
whether to add meta-data.
-
m_AddMetaDataInstance
protected transient AddMetaData m_AddMetaDataInstance
the AddMetaData instance.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractSelectionRectangleBasedSelectionProcessor
-
getDefaultLabel
protected String getDefaultLabel()
Returns the default label to use for the objects.- Returns:
- the default
-
setLabel
public void setLabel(String value)
Sets the label to use for the objects.- Specified by:
setLabel
in interfaceSelectionProcessorWithLabelSupport
- Parameters:
value
- the prefix
-
getLabel
public String getLabel()
Returns the label to use for the objects.- Specified by:
getLabel
in interfaceSelectionProcessorWithLabelSupport
- Returns:
- the label
-
labelTipText
public String labelTipText()
Returns the tip text for this property.- Specified by:
labelTipText
in interfaceSelectionProcessorWithLabelSupport
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDefaultLabelSuffix
protected String getDefaultLabelSuffix()
Returns the default suffix to use for the label.- Returns:
- the default
-
setLabelSuffix
public void setLabelSuffix(String value)
Sets the suffix to use for the label.- Specified by:
setLabelSuffix
in interfaceSelectionProcessorWithLabelSupport
- Parameters:
value
- the suffix
-
getLabelSuffix
public String getLabelSuffix()
Returns the suffix to use for the label.- Specified by:
getLabelSuffix
in interfaceSelectionProcessorWithLabelSupport
- Returns:
- the suffix
-
labelSuffixTipText
public String labelSuffixTipText()
Returns the tip text for this property.- Specified by:
labelSuffixTipText
in interfaceSelectionProcessorWithLabelSupport
- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setAddMetaData
public void setAddMetaData(boolean value)
Sets whether to allow adding meta-data to the object.- Parameters:
value
- true if to add
-
getAddMetaData
public boolean getAddMetaData()
Returns whether to allow adding meta-data to the object.- Returns:
- true if to add
-
addMetaDataTipText
public String addMetaDataTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDefaultColor
protected Color getDefaultColor()
Returns the default color to use.- Overrides:
getDefaultColor
in classAbstractPaintingSelectionProcessor
- Returns:
- the color
-
logAdd
protected void logAdd(ImagePanel panel, int x, int y, int w, int h, int[] poly_x, int[] poly_y)
Logs the adding of an object.- Parameters:
panel
- the panel to use for loggingx
- the x coordinatey
- the y coordinatew
- the widthh
- the heightpoly_x
- the x coordinates of the polygon, can be nullpoly_y
- the y coordinates of the polygon, can be null
-
logRemove
protected void logRemove(ImagePanel panel, int x, int y, int w, int h, List<Map<String,Object>> removed)
Logs the removal of the of objects.- Parameters:
panel
- the panel to use for loggingx
- the x of the removal rectangley
- the y of the removal rectanglew
- the width of the removal rectangleh
- the height of the removal rectangleremoved
- the removed objects
-
doProcessSelection
protected void doProcessSelection(ImagePanel panel, Point topLeft, Point bottomRight, List<Point> trace, int modifiersEx)
Process the selection that occurred in the image panel.- Specified by:
doProcessSelection
in classAbstractSelectionProcessor
- 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
-
supportsInteractionLogging
public boolean supportsInteractionLogging()
Returns whether interaction logging is supported.- Specified by:
supportsInteractionLogging
in interfaceInteractionLoggingSupporter
- Returns:
- true if supported
-
-