Class ChangeCanvasSize
-
- All Implemented Interfaces:
CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,SizeOfHandler
,Stoppable
,Serializable
public class ChangeCanvasSize extends AbstractMetaObjectLocator
Places the located objects obtained from the base locator on a canvas of specified size at the specified position.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-locator <adams.flow.transformer.locateobjects.AbstractObjectLocator> (property: locator) The base locator to use. default: adams.flow.transformer.locateobjects.PassThrough
-canvas-width <int> (property: canvasWidth) The width of the canvas in pixels. default: 100 minimum: 1
-canvas-height <int> (property: canvasHeight) The height of the canvas in pixels. default: 100 minimum: 1
-anchor <TOP_LEFT|TOP_CENTER|TOP_RIGHT|MIDDLE_LEFT|MIDDLE_CENTER|MIDDLE_RIGHT|BOTTOM_LEFT|BOTTOM_CENTER|BOTTOM_RIGHT> (property: anchor) Defines where to anchor the position on the canvas. default: TOP_LEFT
-background <java.awt.Color> (property: background) The background color to use. default: #ffffff
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ImageAnchor
m_Anchor
where to anchor the position on the canvas.protected Color
m_Background
the background color.-
Fields inherited from class adams.flow.transformer.locateobjects.AbstractMetaObjectLocator
m_Locator
-
Fields inherited from class adams.flow.transformer.locateobjects.AbstractObjectLocator
m_CanvasColor, m_CanvasHeight, m_CanvasWidth, m_CenterOnCanvas, m_Errors, m_Stopped, m_Warnings
-
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 ChangeCanvasSize()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
anchorTipText()
Returns the tip text for this property.String
backgroundTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.protected LocatedObjects
doLocate(BufferedImage image, boolean annotateOnly)
Performs the actual locating of the objects.ImageAnchor
getAnchor()
Returns where to anchor the position on the canvas.Color
getBackground()
Returns the background color to use.String
getQuickInfo()
Returns a quick info about the object, which can be displayed in the GUI.String
globalInfo()
Returns a string describing the object.void
setAnchor(ImageAnchor value)
Sets where to anchor the position on the canvas.void
setBackground(Color value)
Sets the background color to use.-
Methods inherited from class adams.flow.transformer.locateobjects.AbstractMetaObjectLocator
check, getLocator, locatorTipText, setLocator
-
Methods inherited from class adams.flow.transformer.locateobjects.AbstractObjectLocator
addError, addWarning, annotate, canvasColorTipText, canvasHeightTipText, canvasWidthTipText, centerOnCanvas, centerOnCanvasTipText, cleanUp, destroy, getCanvasColor, getCanvasHeight, getCanvasWidth, getCenterOnCanvas, getDefaultCanvasColor, getDefaultCanvasHeight, getDefaultCanvasWidth, getDefaultCenterOnCanvas, getErrors, getWarnings, hasErrors, hasWarnings, initialize, locate, reset, setCanvasColor, setCanvasHeight, setCanvasWidth, setCenterOnCanvas, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, 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.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Anchor
protected ImageAnchor m_Anchor
where to anchor the position on the canvas.
-
m_Background
protected Color m_Background
the background color.
-
-
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 classAbstractMetaObjectLocator
-
setAnchor
public void setAnchor(ImageAnchor value)
Sets where to anchor the position on the canvas.- Parameters:
value
- the anchor
-
getAnchor
public ImageAnchor getAnchor()
Returns where to anchor the position on the canvas.- Returns:
- the anchor
-
anchorTipText
public String anchorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setBackground
public void setBackground(Color value)
Sets the background color to use.- Parameters:
value
- the color
-
getBackground
public Color getBackground()
Returns the background color to use.- Returns:
- the color
-
backgroundTipText
public String backgroundTipText()
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 object, which can be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractMetaObjectLocator
- Returns:
- null if no info available, otherwise short string
-
doLocate
protected LocatedObjects doLocate(BufferedImage image, boolean annotateOnly)
Performs the actual locating of the objects.- Specified by:
doLocate
in classAbstractObjectLocator
- Parameters:
image
- the image to processannotateOnly
- whether to annotate only- Returns:
- the containers of located objects
-
-