com.aspose.omr

## Class BasicElement

- java.lang.Object
- - com.aspose.omr.BasicElement

- Direct Known Subclasses:
    OmrElement

      public abstract class BasicElement
      extends Object

  The base class for elements of the OMR template.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `BasicElement(String name, Point2D.Float position, Dimension2D.Float size)` Initializes a new instance of the `BasicElement` class.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract String` | `extractData(OmrImage image, OmrConfig config)` Extracts data from a portion of scanned OMR sheet assigned to this element.
    `String` | `getName()` Gets the name of the element.
    `Point2D.Float` | `getPosition()` Gets position, in millimeters, relative to top left corner of an image
    `Dimension2D.Float` | `getSize()` Gets size of the element, in millimeters.
    `void` | `loadProperties(StringDictionary properties)` Initializes the properties of an element from their string representation.
    `StringDictionary` | `saveProperties()` Converts values of the properties of an element from their string representation.
    `void` | `setName(String value)` Sets the name of the element.
    `void` | `setPosition(Point2D.Float value)` Sets position, in millimeters, relative to top left corner of an image
    `void` | `setSize(Dimension2D.Float value)` Sets size of the element, in millimeters.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BasicElement

          protected BasicElement(String name,
                      Point2D.Float position,
                      Dimension2D.Float size)

      Initializes a new instance of the `BasicElement` class.

      Parameters:
        `name` - The name of the element.
        `position` - Element position, in millimeters, relative to top left corner of an image
        `size` - Size of the element, in millimeters.

  - ### Method Detail

    - #### extractData

          public abstract String extractData(OmrImage image,
                           OmrConfig config)

      Extracts data from a portion of scanned OMR sheet assigned to this element.

      Parameters:
        `image` - The image to extract data from.
        `config` - Global configuration for OMR extraction algorithm.
      Returns:
        A string that contains data extracted from the sheet.

    - #### getName

          public String getName()

      Gets the name of the element.

      Returns:
        the name of the element.

    - #### getPosition

          public Point2D.Float getPosition()

      Gets position, in millimeters, relative to top left corner of an image

      Returns:
        position, in millimeters, relative to top left corner of an image

    - #### getSize

          public Dimension2D.Float getSize()

      Gets size of the element, in millimeters.

      Returns:
        size of the element, in millimeters.

    - #### loadProperties

          public void loadProperties(StringDictionary properties)

      Initializes the properties of an element from their string representation.

      Parameters:
        `properties` - A collection of properties' values.

    - #### saveProperties

          public StringDictionary saveProperties()

      Converts values of the properties of an element from their string representation.

      Returns:
        A collection of properties' values.

    - #### setName

          public void setName(String value)

      Sets the name of the element. Value cannot be null.

      Parameters:
        `value` - the name of the element. Value cannot be null.

    - #### setPosition

          public void setPosition(Point2D.Float value)

      Sets position, in millimeters, relative to top left corner of an image

      Parameters:
        `value` - position, in millimeters, relative to top left corner of an image

    - #### setSize

          public void setSize(Dimension2D.Float value)

      Sets size of the element, in millimeters.

      Parameters:
        `value` - size of the element, in millimeters.

Copyright © 2014. All rights reserved.