Package adams.data.objectfilter
Class MakeSquare
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,ObjectFilter
,FlowContextHandler
,Serializable
public class MakeSquare extends AbstractObjectFilter
Generates a square bounding box around the current center of the bounding box.
Discards any polygon data.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-side-type <SMALLER|LARGER|WIDTH|HEIGHT> (property: sideType) The type of side of the current bounding box to use for the square box. default: SMALLER
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MakeSquare.SideType
the side to use.
-
Field Summary
Fields Modifier and Type Field Description protected MakeSquare.SideType
m_SideType
what side to use.-
Fields inherited from class adams.data.objectfilter.AbstractObjectFilter
m_FlowContext
-
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 MakeSquare()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.protected LocatedObjects
doFilter(LocatedObjects objects)
Filters the image objects.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.MakeSquare.SideType
getSideType()
Returns the type of side of the current bounding box to use for the square box.String
globalInfo()
Returns a string describing the object.void
setSideType(MakeSquare.SideType value)
Sets the type of side of the current bounding box to use for the square box.String
sideTypeTipText()
Returns the tip text for this property.protected LocatedObject
transform(LocatedObject object, double scaleX, double scaleY, int transX, int transY)
Scales/translates the given object.-
Methods inherited from class adams.data.objectfilter.AbstractObjectFilter
check, filter, getFlowContext, requiresFlowContext, setFlowContext
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, 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, getOptionManager, toCommandLine
-
-
-
-
Field Detail
-
m_SideType
protected MakeSquare.SideType m_SideType
what side to use.
-
-
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 classAbstractOptionHandler
-
setSideType
public void setSideType(MakeSquare.SideType value)
Sets the type of side of the current bounding box to use for the square box.- Parameters:
value
- the type
-
getSideType
public MakeSquare.SideType getSideType()
Returns the type of side of the current bounding box to use for the square box.- Returns:
- the type
-
sideTypeTipText
public String sideTypeTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractObjectFilter
- Returns:
- null if no info available, otherwise short string
-
transform
protected LocatedObject transform(LocatedObject object, double scaleX, double scaleY, int transX, int transY)
Scales/translates the given object.- Parameters:
object
- the object to transformscaleX
- the scale for XscaleY
- the scale for YtransX
- the X translationtransY
- the Y translation- Returns:
- the updated object
-
doFilter
protected LocatedObjects doFilter(LocatedObjects objects)
Filters the image objects.- Specified by:
doFilter
in classAbstractObjectFilter
- Parameters:
objects
- the located objects- Returns:
- the updated list of objects
-
-