lv.lumii.layoutengine

## Class AbstractContainer

- java.lang.Object
- - lv.lumii.layoutengine.Element
  - - lv.lumii.layoutengine.AbstractContainer

- Direct Known Subclasses:
    Container, Label

      public abstract class AbstractContainer
      extends Element

  The `AbstractContainer` class specifies a group of diagram elements, though it allows only labels to be added to the group.

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `contains(java.awt.geom.Point2D.Double point, double epsilon)` Finds whether the point lies inside the bounds of the container rectangle, including sides.
    `InsideLabel` | `createInsideLabel(java.awt.geom.Rectangle2D.Double rectangle, double spacing)` Creates a new inside label as a child of this container.
    `InsideLabel` | `createInsideLabel(java.awt.geom.Rectangle2D.Double rectangle, LayoutConstraints.ConstraintType constraintType, double spacing)` Creates a new inside label as a child of this container.
    `InsideLabel` | `createInsideLabel(java.awt.geom.Rectangle2D.Double rectangle, LayoutConstraints.ConstraintType constraintType, double spacing, java.lang.Integer row, java.lang.Integer column)` Creates a new inside label as a child of this container.
    `java.awt.geom.Rectangle2D.Double` | `findDescendantEnclosingRectangle()` Finds the smallest rectangle containing all of the container's children, including the spacing of the children.
    `java.awt.geom.Rectangle2D.Double` | `findNextRectangleEnclosingRectangle()` Finds the smallest rectangle containing all of the container's direct descendant rectangular container, including the spacing of the rectangles.
    `double` | `getBottom()` Returns the ordinate of the bottom side of the container rectangle.
    `java.awt.geom.Rectangle2D.Double` | `getBounds()` Returns the bounding rectangle of the container.
    `java.awt.geom.Point2D.Double` | `getCenter()` Returns the center point of the container rectangle.
    `double` | `getCenterX()` Returns the center X of the bounding rectangle
    `double` | `getCenterY()` Returns the center Y of the bounding rectangle
    `double` | `getHeight()` Returns the current height of the container rectangle.
    `java.util.ArrayList<InsideLabel>` | `getInsideLabels()` Returns the outside labels of this container.
    `LayoutConstraints` | `getLayoutConstraints()` Gets the layout manager of this container.
    `double` | `getLeft()` Returns the abscissa of the left side of the container rectangle.
    `double` | `getMinHeight()` Returns the minimum height of the container rectangle.
    `double` | `getMinWidth()` Returns the minimum width of the container rectangle.
    `double` | `getRight()` Returns the abscissa of the right side of the container rectangle.
    `double` | `getTop()` Returns the ordinate of the top side of the container rectangle.
    `double` | `getWidth()` Returns the current width of the container rectangle.
    `void` | `remove()` Removes the element and its descendant elements.
    `void` | `setConstraintType(LayoutConstraints.ConstraintType constraintType)` Sets the layout manager to the specified type.

    - ### Methods inherited from class lv.lumii.layoutengine.Element

      `getDiagram, getOwner, getSpacing, remove, setSpacing`

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

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

- - ### Method Detail

    - #### getBounds

          public java.awt.geom.Rectangle2D.Double getBounds()

      Returns the bounding rectangle of the container.
      Returns:
        the bounding rectangle of the container.

    - #### getCenterX

          public double getCenterX()

      Returns the center X of the bounding rectangle
      Returns:
        the center X of the bounding rectangle

    - #### getCenterY

          public double getCenterY()

      Returns the center Y of the bounding rectangle
      Returns:
        the center Y of the bounding rectangle

    - #### getCenter

          public final java.awt.geom.Point2D.Double getCenter()

      Returns the center point of the container rectangle.
      Returns:
        the center point of the container rectangle.

    - #### getMinHeight

          public double getMinHeight()

      Returns the minimum height of the container rectangle.
      Returns:
        the minimum height of the container rectangle.

    - #### getMinWidth

          public double getMinWidth()

      Returns the minimum width of the container rectangle.
      Returns:
        the minimum width of the container rectangle.

    - #### getLeft

          public double getLeft()

      Returns the abscissa of the left side of the container rectangle.
      Returns:
        the abscissa of the left side of the container rectangle.

    - #### getTop

          public double getTop()

      Returns the ordinate of the top side of the container rectangle.
      Returns:
        the ordinate of the top side of the container rectangle.

    - #### getRight

          public double getRight()

      Returns the abscissa of the right side of the container rectangle.
      Returns:
        the abscissa of the right side of the container rectangle.

    - #### getBottom

          public double getBottom()

      Returns the ordinate of the bottom side of the container rectangle.
      Returns:
        the ordinate of the bottom side of the container rectangle.

    - #### getWidth

          public double getWidth()

      Returns the current width of the container rectangle.
      Returns:
        the current width of the container rectangle.

    - #### getHeight

          public double getHeight()

      Returns the current height of the container rectangle.
      Returns:
        the current height of the container rectangle.

    - #### getLayoutConstraints

          public LayoutConstraints getLayoutConstraints()

      Gets the layout manager of this container.
      Returns:
        the layout manager of this container.

    - #### setConstraintType

          public final void setConstraintType(LayoutConstraints.ConstraintType constraintType)

      Sets the layout manager to the specified type.
      Parameters:
        `constraintType` - the new layout constraint type of this container

    - #### contains

          public boolean contains(java.awt.geom.Point2D.Double point,
                                  double epsilon)

      Finds whether the point lies inside the bounds of the container rectangle, including sides. Use `strictContains(java.awt.geom.Point2D.Double)` to exclude sides.
      Parameters:
        `point` - the point to check
        `epsilon` - the width of a buffer around the container rectangle points in which are also considered to be contained by it
      Returns:
        whether the point lies inside the bounds of the container rectangle.

    - #### createInsideLabel

          public InsideLabel createInsideLabel(java.awt.geom.Rectangle2D.Double rectangle,
                                               double spacing)

      Creates a new inside label as a child of this container. The minimum size of the new label is the size of the given rectangle. The whole diagram is reordered afterwards, or at the end of the current transaction.
      Parameters:
        `rectangle` - the position of the new label
        `spacing` - the spacing value for the new label
      Returns:
        the new inside label object.

    - #### createInsideLabel

          public InsideLabel createInsideLabel(java.awt.geom.Rectangle2D.Double rectangle,
                                               LayoutConstraints.ConstraintType constraintType,
                                               double spacing)

      Creates a new inside label as a child of this container. The minimum size of the new label is the size of the given rectangle. The whole diagram is reordered afterwards, or at the end of the current transaction.
      Parameters:
        `rectangle` - the position of the new label
        `constraintType` - the type of the layout constraints for the new label
        `spacing` - the spacing value for the new label
      Returns:
        the new inside label object.

    - #### createInsideLabel

          public InsideLabel createInsideLabel(java.awt.geom.Rectangle2D.Double rectangle,
                                               LayoutConstraints.ConstraintType constraintType,
                                               double spacing,
                                               java.lang.Integer row,
                                               java.lang.Integer column)

      Creates a new inside label as a child of this container. The minimum size of the new label is the size of the given rectangle. The whole diagram is reordered afterwards, or at the end of the current transaction.
      Parameters:
        `rectangle` - the position of the new label
        `constraintType` - the type of the layout constraints for the new label
        `spacing` - the spacing value for the new label
        `row` - the row of the new label in this container's grid
        `column` - the column of the new label in this container's grid
      Returns:
        the new inside label object.

    - #### getInsideLabels

          public java.util.ArrayList<InsideLabel> getInsideLabels()

      Returns the outside labels of this container.
      Returns:
        the outside labels of this container.

    - #### findNextRectangleEnclosingRectangle

          public java.awt.geom.Rectangle2D.Double findNextRectangleEnclosingRectangle()

      Finds the smallest rectangle containing all of the container's direct descendant rectangular container, including the spacing of the rectangles.
      Returns:
        the smallest child rectangle enclosing rectangle, or `null` is the container has no child rectangles

    - #### findDescendantEnclosingRectangle

          public java.awt.geom.Rectangle2D.Double findDescendantEnclosingRectangle()

      Finds the smallest rectangle containing all of the container's children, including the spacing of the children.
      Returns:
        the smallest children enclosing rectangle, or `null` is the container has no children with dimensions

    - #### remove

          public void remove()

      Description copied from class: `Element`
      Removes the element and its descendant elements. The whole diagram is reordered afterwards, or at the end of the current transaction.
      Overrides:
        `remove` in class `Element`