com.aspose.omr

## Class GridElement

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

-     public class GridElement
      extends OmrElement

  Represents an OMR grid element

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GridElement(String name, Point2D.Float position, Dimension2D.Float size)` Initializes a new instance of the `GridElement` class.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `extractData(OmrImage image, OmrConfig config)` Extracts data from a portion of scanned OMR sheet assigned to this element.
    `List<GridSection>` | `getSections()` Gets a collection of sections of the grid.
    `void` | `setSectionsCount(int count)` A shortcut method for setting the sections count in the grid.

    - ### Methods inherited from class com.aspose.omr.OmrElement

      `getCells, getConfiguration, isHorizontal, isHorizontal, loadProperties, saveProperties, setConfiguration`

    - ### Methods inherited from class com.aspose.omr.BasicElement

      `getName, getPosition, getSize, setName, setPosition, setSize`

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

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

- - ### Constructor Detail

    - #### GridElement

          public GridElement(String name,
                     Point2D.Float position,
                     Dimension2D.Float size)

      Initializes a new instance of the `GridElement` 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 String extractData(OmrImage image,
                           OmrConfig config)

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

      Specified by:
        `extractData` in class `BasicElement`
      Parameters:
        `image` - The image to extract data from.
        `config` - Configuration for OMR extraction algorithm.
      Returns:
        An string that contains data extracted from the sheet.

    - #### getSections

          public List<GridSection> getSections()

      Gets a collection of sections of the grid.

      Returns:
        a collection of sections of the grid.

    - #### setSectionsCount

          public void setSectionsCount(int count)

      A shortcut method for setting the sections count in the grid. Adds and removes elements from `Sections` as necessary.

      Parameters:
        `count` - New sections count.

Copyright © 2014. All rights reserved.