net.returnvoid.graphics.grid

## Interface RGrid

- All Known Implementing Classes:
    EllipseGrid, EquiSpiralGrid, SpiralGrid, TableGrid

      public interface RGrid

  An interface for building two-dimensional grids. These grids should be specified with a bounding box (x, y, width, height). Elements in the grid should be accessible with an index and their should be method to get the positions of all elements in the grid. Elements in the grid are abstracted by a certain position. That position should be handled as a center location when it comes to draw shapes on that position.
  Author:
    Diana Lange

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `processing.core.PVector[]` | `getCoordinates()` Returns all positions of all elements in the grid.
    `java.lang.Float` | `getHeight()` Returns the current height of the grid.
    `java.lang.Float` | `getHeight(java.lang.Integer index)` Returns the current height of the grid.
    `java.lang.Float` | `getPadding()` Returns the space between the elements of the grid.
    `java.lang.Float` | `getWidth()` Returns the width of the element at the given index.
    `java.lang.Float` | `getWidth(java.lang.Integer index)` Returns the current width of the grid.
    `java.lang.Float` | `getX()` Returns the current x-position of the grid.
    `java.lang.Float` | `getX(java.lang.Integer index)` Returns the x-position of the element at the given index.
    `java.lang.Float` | `getY()` Returns the current y-position of the grid.
    `java.lang.Float` | `getY(java.lang.Integer index)` Returns the y-position of the element at the given index.
    `RGrid` | `setPadding(float padding)` Sets the padding (space between elements of the grid).
    `RGrid` | `setX(float x)` Set to x-position of the grid.
    `RGrid` | `setY(float y)` Set to y-position of the grid.
    `java.lang.Integer` | `size()` Returns the number of elements in the grid.

- - ### Method Detail

    - #### setX

          RGrid setX(float x)

      Set to x-position of the grid.
      Parameters:
        `x` - The new x-position of the grid.
      Returns:
        The current grid object.

    - #### setY

          RGrid setY(float y)

      Set to y-position of the grid.
      Parameters:
        `y` - The new y-position of the grid.
      Returns:
        The current grid object.

    - #### setPadding

          RGrid setPadding(float padding)

      Sets the padding (space between elements of the grid).
      Parameters:
        `padding` - The new padding of this grid.
      Returns:
        The current grid object.

    - #### getCoordinates

          processing.core.PVector[] getCoordinates()

      Returns all positions of all elements in the grid.
      Returns:
        The positions.

    - #### getX

          java.lang.Float getX()

      Returns the current x-position of the grid.
      Returns:
        The x-position.

    - #### getY

          java.lang.Float getY()

      Returns the current y-position of the grid.
      Returns:
        The y-position.

    - #### getWidth

          java.lang.Float getWidth()

      Returns the width of the element at the given index.
      Returns:
        The width.

    - #### getHeight

          java.lang.Float getHeight()

      Returns the current height of the grid.
      Returns:
        The height.

    - #### getWidth

          java.lang.Float getWidth(java.lang.Integer index)

      Returns the current width of the grid.
      Parameters:
        `index` - The index of the element.
      Returns:
        The width.

    - #### getHeight

          java.lang.Float getHeight(java.lang.Integer index)

      Returns the current height of the grid.
      Parameters:
        `index` - The index of the element.
      Returns:
        The height.

    - #### getPadding

          java.lang.Float getPadding()

      Returns the space between the elements of the grid.
      Returns:
        The padding.

    - #### size

          java.lang.Integer size()

      Returns the number of elements in the grid. This is usefull if you want to iterate over all elements of the grid. Example:

           for (int i = 0; i < myGrid.size(); i++) {
                          float x = myGrid.getX(i);
                          float y = myGrid.getY(i):
           }

      Returns:
        The number of elements of the grid.

    - #### getX

          java.lang.Float getX(java.lang.Integer index)

      Returns the x-position of the element at the given index. index should be in the range of this grid [0, myGrid.size()], otherwise the call of this function might produce strange results or will produce an ArrayIndexOutOfBoundsException. Usage:

           for (int i = 0; i < myGrid.size(); i++) {
                          float x = myGrid.getX(i);
                          float y = myGrid.getY(i):
           }

      Parameters:
        `index` - The index of the element.
      Returns:
        The x-position of the element.

    - #### getY

          java.lang.Float getY(java.lang.Integer index)

      Returns the y-position of the element at the given index. index should be in the range of this grid [0, myGrid.size()], otherwise the call of this function might produce strange results or will produce an ArrayIndexOutOfBoundsException. Usage:

           for (int i = 0; i < myGrid.size(); i++) {
                          float x = myGrid.getX(i);
                          float y = myGrid.getY(i):
           }

      Parameters:
        `index` - The index of the element.
      Returns:
        The y-position of the element.