lv.lumii.layoutengine

## Class LayoutConstraints.GridLayoutConstraints

- java.lang.Object
- - lv.lumii.layoutengine.LayoutConstraints
  - - lv.lumii.layoutengine.LayoutConstraints.GridLayoutConstraints

- Enclosing class:
    LayoutConstraints

      public static class LayoutConstraints.GridLayoutConstraints
      extends LayoutConstraints

  These constraints implement the grid borders in the container. The grid is ensured in both global layout and diagram editing operations.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class lv.lumii.layoutengine.LayoutConstraints

      `LayoutConstraints.ConstraintType, LayoutConstraints.GridLayoutConstraints, LayoutConstraints.NoneLayoutConstraints`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `_setColumnRight(int column, double x)` Sets the x coordinate of the right column border.
    `void` | `_setRowBottom(int row, double y)` Sets the y coordinate of the bottom row border.
    `void` | `addColumns(int count)` Adds new columns to the right of the last column.
    `void` | `addRows(int count)` Adds new rows to the bottom of the last row.
    `java.util.ArrayList<Element>` | `getCellElements(java.lang.Integer row, java.lang.Integer column)` Returns a list of elements belonging to the specified cell.
    `java.lang.Integer` | `getColumn(Element elem)` Returns the column number of the given element, or `null` if none.
    `double` | `getColumnBorderSpacing(int column)` Gets the spacing of the right border of the given column.
    `int` | `getColumnCount()` Returns the number of columns in this grid.
    `java.util.ArrayList<Element>` | `getColumnElements(java.lang.Integer column)` Returns a list of elements belonging to the specified column.
    `double` | `getColumnLeft(int column)` Gets the left coordinate of the column.
    `double` | `getColumnMinWidth(int column)` Gets the minimum width of the given column.
    `double` | `getColumnRight(int column)` Gets the right coordinate of the column.
    `double` | `getColumnWidth(int column)` Returns the current width of the given column.
    `double` | `getDefaultColumnSpacing()` Gets the default spacing for column borders, used when creating new columns.
    `double` | `getDefaultColumnWidth()` Returns the default column width used for new columns and when resetting column widths.
    `double` | `getDefaultRowHeight()` Returns the default row height used for new rows and when resetting row heights.
    `double` | `getDefaultRowSpacing()` Gets the default spacing for row borders, used when creating new rows.
    `java.lang.Integer` | `getRow(Element elem)` Returns the row number of the given element, or `null` if none.
    `double` | `getRowBorderSpacing(int row)` Gets the spacing of the bottom border of the given row.
    `double` | `getRowBottom(int row)` Gets the bottom coordinate of the row.
    `int` | `getRowCount()` Returns the number of rows in this grid.
    `java.util.ArrayList<Element>` | `getRowElements(java.lang.Integer row)` Returns a list of elements belonging to the specified row.
    `double` | `getRowHeight(int row)` Gets the current height of the given row.
    `double` | `getRowMinHeight(int row)` Gets the minimum height of the given row.
    `double` | `getRowTop(int row)` Gets the top coordinate of the row.
    `LayoutConstraints.ConstraintType` | `getType()` Returns this layout's type.
    `void` | `mergeColumns(int first, int last)` Merges consecutive grid columns from `first` to `last`, inclusive, into a single column by erasing intermediate grid constraint lines.
    `void` | `mergeRows(int first, int last)` Merges consecutive grid rows from `first` to `last`, inclusive, into a single row by erasing intermediate grid constraint lines.
    `void` | `resetColumnSpacings()` Resets the spacing of every column border to the current default value.
    `void` | `resetColumnWidths()` Resets the minimum width of all columns to the current default column width.
    `void` | `resetRowHeights()` Resets the minimum height of all rows to the current default row height.
    `void` | `resetRowSpacings()` Resets the spacing of every row border to the current default value.
    `void` | `setCell(Element elem, java.lang.Integer row, java.lang.Integer column)` Sets the cell of the element.
    `void` | `setColumn(Element elem, java.lang.Integer column)` Sets the column of the element.
    `void` | `setColumnBorderSpacing(int column, double spacing)` Sets the spacing of the right border of the given column.
    `void` | `setColumnLeft(int column, double x)` Sets the left coordinate of the column.
    `void` | `setColumnMinWidth(int column, double width)` Sets the minimum width of the column.
    `void` | `setColumnRight(int column, double x)` Sets the right coordinate of the column.
    `void` | `setDefaultColumnSpacing(double spacing)` Sets the default spacing for column borders, used when creating new columns.
    `void` | `setDefaultColumnWidth(double width)` Sets the new default column width used for new columns and when resetting column widths.
    `void` | `setDefaultRowHeight(double height)` Sets the new default row height used for new rows and when resetting row heights.
    `void` | `setDefaultRowSpacing(double spacing)` Sets the default spacing for row borders, used when creating new row.
    `void` | `setRow(Element elem, java.lang.Integer row)` Sets the row of the element.
    `void` | `setRowBorderSpacing(int row, double spacing)` Sets the spacing of the bottom border of the given row.
    `void` | `setRowBottom(int row, double y)` Sets the bottom coordinate of the row.
    `void` | `setRowMinHeight(int row, double height)` Sets the minimum height of the row.
    `void` | `setRowTop(int row, double y)` Sets the top coordinate of the row.

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

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

- - ### Method Detail

    - #### getColumn

          public java.lang.Integer getColumn(Element elem)

      Returns the column number of the given element, or `null` if none. Column numbers are 1-based.
      Parameters:
        `elem` - the element whose column to get.
      Returns:
        the column number of the given element, or `null` if none.

    - #### getRow

          public java.lang.Integer getRow(Element elem)

      Returns the row number of the given element, or `null` if none. Row numbers are 1-based.
      Parameters:
        `elem` - the element whose row number to get.
      Returns:
        the row number of the given element, or `null` if none.

    - #### setColumn

          public void setColumn(Element elem,
                                java.lang.Integer column)

      Sets the column of the element. The element should be one of the elements contained in the associated container. The action is carried out immediately or at the end of transaction of the diagram. Column numbers are 1-based.
      Parameters:
        `elem` - the element whose column to set
        `column` - the new column number of the element, can be `null`

    - #### setRow

          public void setRow(Element elem,
                             java.lang.Integer row)

      Sets the row of the element. The element should be one of the elements contained in the associated container. The action is carried out immediately or at the end of transaction of the diagram. Row numbers are 1-based.
      Parameters:
        `elem` - the element whose row to set
        `row` - the new row number of the element, can be `null`

    - #### setCell

          public void setCell(Element elem,
                              java.lang.Integer row,
                              java.lang.Integer column)

      Sets the cell of the element. The element should be one of the elements contained in the associated container. The action is carried out immediately or at the end of transaction of the diagram. Column and row numbers are 1-based.
      Parameters:
        `elem` - the element whose cell to set
        `row` - the new row of the element, can be `null`
        `column` - the new column of the element, can be `null`

    - #### addColumns

          public void addColumns(int count)

      Adds new columns to the right of the last column. The width of each new column will be equal to the default column width.
      Parameters:
        `count` - the number of the columns to add

    - #### addRows

          public void addRows(int count)

      Adds new rows to the bottom of the last row. The height of each new row will be equal to the default row height.
      Parameters:
        `count` - the number of the rows to add

    - #### setDefaultColumnWidth

          public void setDefaultColumnWidth(double width)

      Sets the new default column width used for new columns and when resetting column widths. The width must be positive.
      Parameters:
        `width` - the new default column width

    - #### setDefaultRowHeight

          public void setDefaultRowHeight(double height)

      Sets the new default row height used for new rows and when resetting row heights.
      Parameters:
        `height` - the new default row height

    - #### getDefaultColumnWidth

          public double getDefaultColumnWidth()

      Returns the default column width used for new columns and when resetting column widths.
      Returns:
        the default column width

    - #### getDefaultRowHeight

          public double getDefaultRowHeight()

      Returns the default row height used for new rows and when resetting row heights.
      Returns:
        the default row height

    - #### resetColumnWidths

          public void resetColumnWidths()

      Resets the minimum width of all columns to the current default column width.

    - #### resetRowHeights

          public void resetRowHeights()

      Resets the minimum height of all rows to the current default row height.

    - #### setColumnBorderSpacing

          public void setColumnBorderSpacing(int column,
                                             double spacing)

      Sets the spacing of the right border of the given column.
      Parameters:
        `column` - the column whose right border's spacing to set.
        `spacing` - the new spacing of the border

    - #### setRowBorderSpacing

          public void setRowBorderSpacing(int row,
                                          double spacing)

      Sets the spacing of the bottom border of the given row.
      Parameters:
        `row` - the row whose bottom border's spacing to set.
        `spacing` - the new spacing of the border

    - #### getColumnBorderSpacing

          public double getColumnBorderSpacing(int column)

      Gets the spacing of the right border of the given column.
      Parameters:
        `column` - the column whose right border's spacing to get.
      Returns:
        the spacing of the border

    - #### getRowBorderSpacing

          public double getRowBorderSpacing(int row)

      Gets the spacing of the bottom border of the given row.
      Parameters:
        `row` - the row whose bottom borders spacing to get.
      Returns:
        the spacing of the border

    - #### setDefaultColumnSpacing

          public void setDefaultColumnSpacing(double spacing)

      Sets the default spacing for column borders, used when creating new columns.
      Parameters:
        `spacing` - the new default column border spacing.

    - #### setDefaultRowSpacing

          public void setDefaultRowSpacing(double spacing)

      Sets the default spacing for row borders, used when creating new row.
      Parameters:
        `spacing` - the new default row border spacing.

    - #### getDefaultColumnSpacing

          public double getDefaultColumnSpacing()

      Gets the default spacing for column borders, used when creating new columns.
      Returns:
        the default spacing for column borders

    - #### getDefaultRowSpacing

          public double getDefaultRowSpacing()

      Gets the default spacing for row borders, used when creating new rows.
      Returns:
        the default spacing for row borders

    - #### resetColumnSpacings

          public void resetColumnSpacings()

      Resets the spacing of every column border to the current default value.

    - #### resetRowSpacings

          public void resetRowSpacings()

      Resets the spacing of every row border to the current default value.

    - #### mergeColumns

          public void mergeColumns(int first,
                                   int last)

      Merges consecutive grid columns from `first` to `last`, inclusive, into a single column by erasing intermediate grid constraint lines. The columns are renumbered automatically.
      Parameters:
        `first` - the index of the first column to merge
        `last` - the index of the last column to merge

    - #### mergeRows

          public void mergeRows(int first,
                                int last)

      Merges consecutive grid rows from `first` to `last`, inclusive, into a single row by erasing intermediate grid constraint lines. The rows are renumbered automatically.
      Parameters:
        `first` - the index of the first row to merge
        `last` - the index of the last row to merge

    - #### getCellElements

          public java.util.ArrayList<Element> getCellElements(java.lang.Integer row,
                                                              java.lang.Integer column)

      Returns a list of elements belonging to the specified cell.
      Parameters:
        `row` - the row of the cell
        `column` - the column of the cell
      Returns:
        a list of elements belonging to the specified cell

    - #### getRowElements

          public java.util.ArrayList<Element> getRowElements(java.lang.Integer row)

      Returns a list of elements belonging to the specified row.
      Parameters:
        `row` - the row whose elements to get
      Returns:
        a list of elements belonging to the specified row

    - #### getColumnElements

          public java.util.ArrayList<Element> getColumnElements(java.lang.Integer column)

      Returns a list of elements belonging to the specified column.
      Parameters:
        `column` - the column whose elements to get
      Returns:
        a list of elements belonging to the specified column

    - #### getColumnCount

          public int getColumnCount()

      Returns the number of columns in this grid.
      Returns:
        the number of columns in this grid.

    - #### getRowCount

          public int getRowCount()

      Returns the number of rows in this grid.
      Returns:
        the number of rows in this grid.

    - #### getColumnLeft

          public double getColumnLeft(int column)

      Gets the left coordinate of the column.
      Parameters:
        `column` - the column whose coordinate to get
      Returns:
        the left coordinate of the column

    - #### getColumnRight

          public double getColumnRight(int column)

      Gets the right coordinate of the column.
      Parameters:
        `column` - the column whose coordinate to get
      Returns:
        the right coordinate of the column

    - #### getRowTop

          public double getRowTop(int row)

      Gets the top coordinate of the row.
      Parameters:
        `row` - the row whose coordinate to get
      Returns:
        the top coordinate of the row

    - #### getRowBottom

          public double getRowBottom(int row)

      Gets the bottom coordinate of the row.
      Parameters:
        `row` - the row whose coordinate to get
      Returns:
        the bottom coordinate of the row

    - #### setColumnLeft

          public void setColumnLeft(int column,
                                    double x)

      Sets the left coordinate of the column.
      Parameters:
        `column` - the column to set left coordinate to
        `x` - the abscissa of the new column left

    - #### setColumnRight

          public void setColumnRight(int column,
                                     double x)

      Sets the right coordinate of the column.
      Parameters:
        `column` - the column to set right coordinate to
        `x` - the abscissa of the new column right

    - #### setRowTop

          public void setRowTop(int row,
                                double y)

      Sets the top coordinate of the row.
      Parameters:
        `row` - the row to set top coordinate to
        `y` - the ordinate of the new row top

    - #### setRowBottom

          public void setRowBottom(int row,
                                   double y)

      Sets the bottom coordinate of the row.
      Parameters:
        `row` - the row to set bottom coordinate to
        `y` - the ordinate of the new row bottom

    - #### _setColumnRight

          public void _setColumnRight(int column,
                                      double x)

      Sets the x coordinate of the right column border. This is an internal function and does not call normalization.
      Parameters:
        `column` - the column whose right border to change
        `x` - the new abscissa of the border

    - #### _setRowBottom

          public void _setRowBottom(int row,
                                    double y)

      Sets the y coordinate of the bottom row border. This is an internal function and does not call normalization.
      Parameters:
        `row` - the row whose bottom border to change
        `y` - the new ordinate of the border

    - #### setColumnMinWidth

          public void setColumnMinWidth(int column,
                                        double width)

      Sets the minimum width of the column. The action is carried out immediately or at the end of transaction of the diagram. The minimum width must be positive.
      Parameters:
        `column` - the column whose minimum width to set
        `width` - the new minimum width of the column

    - #### setRowMinHeight

          public void setRowMinHeight(int row,
                                      double height)

      Sets the minimum height of the row. The action is carried out immediately or at the end of transaction of the diagram. The minimum height must be positive.
      Parameters:
        `row` - the row whose height to set
        `height` - the new minimum height of the row

    - #### getColumnMinWidth

          public double getColumnMinWidth(int column)

      Gets the minimum width of the given column.
      Parameters:
        `column` - the column whose minimum width to get
      Returns:
        the minimum width of the given column.

    - #### getRowMinHeight

          public double getRowMinHeight(int row)

      Gets the minimum height of the given row.
      Parameters:
        `row` - the row whose minimum height to get
      Returns:
        the minimum height of the given row.

    - #### getRowHeight

          public double getRowHeight(int row)

      Gets the current height of the given row.
      Parameters:
        `row` - the row whose height to get
      Returns:
        the current height of the given row.

    - #### getColumnWidth

          public double getColumnWidth(int column)

      Returns the current width of the given column.
      Parameters:
        `column` - the column whose width to get
      Returns:
        the current width of the given column

    - #### getType

          public LayoutConstraints.ConstraintType getType()

      Description copied from class: `LayoutConstraints`
      Returns this layout's type.
      Specified by:
        `getType` in class `LayoutConstraints`
      Returns:
        this layout's type.