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 ImageAnchorm_Anchorwhere to anchor the position on the canvas.protected Colorm_Backgroundthe 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 StringanchorTipText()Returns the tip text for this property.StringbackgroundTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.protected LocatedObjectsdoLocate(BufferedImage image, boolean annotateOnly)Performs the actual locating of the objects.ImageAnchorgetAnchor()Returns where to anchor the position on the canvas.ColorgetBackground()Returns the background color to use.StringgetQuickInfo()Returns a quick info about the object, which can be displayed in the GUI.StringglobalInfo()Returns a string describing the object.voidsetAnchor(ImageAnchor value)Sets where to anchor the position on the canvas.voidsetBackground(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:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin 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:
getQuickInfoin interfaceQuickInfoSupporter- Overrides:
getQuickInfoin 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:
doLocatein classAbstractObjectLocator- Parameters:
image- the image to processannotateOnly- whether to annotate only- Returns:
- the containers of located objects
-
-