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 Detail

      • m_Anchor

        protected ImageAnchor m_Anchor
        where to anchor the position on the canvas.
      • m_Background

        protected Color m_Background
        the background color.
    • Constructor Detail

      • ChangeCanvasSize

        public ChangeCanvasSize()
    • Method Detail

      • 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.
      • doLocate

        protected LocatedObjects doLocate​(BufferedImage image,
                                          boolean annotateOnly)
        Performs the actual locating of the objects.
        Specified by:
        doLocate in class AbstractObjectLocator
        Parameters:
        image - the image to process
        annotateOnly - whether to annotate only
        Returns:
        the containers of located objects