lv.lumii.layoutengine

## Class Label

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

- Direct Known Subclasses:
    InsideLabel, OutsideLabel

      public abstract class Label
      extends AbstractContainer

  The base class of all labels. Label can contain other labels.

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `OutsideLabel.BoxOutsideLabel` | `_convertToBoxOutsideLabel(Box newOwner)` Converts this label to a box outside label belonging to the new owner.
    `InsideLabel` | `_convertToInsideLabel(AbstractContainer newOwner)` Converts this label to an inside label belonging to the new owner.
    `OutsideLabel.BoxOutsideLabel` | `convertToBoxOutsideLabel(Box.BoxSide side, double position, Box box)` Converts this label to a box outside label (if it wasn't already), then moves this label to the given side of the given box at the given position.
    `OutsideLabel.BoxOutsideLabel` | `convertToBoxOutsideLabel(java.awt.geom.Point2D.Double point, Box box)` Converts this label to a box outside label (if it wasn't already), then moves this box outside label to the given point onto the given box.
    `InsideLabel` | `convertToInsideLabel(java.awt.geom.Point2D.Double newCenter, AbstractContainer newOwner, java.awt.geom.Point2D.Double growPoint)` Converts this label to an inside label (if it wasn't already), then places it at the given position, along with its children.
    `InsideLabel` | `convertToInsideLabel(java.awt.geom.Point2D.Double newCenter, AbstractContainer newOwner, java.awt.geom.Point2D.Double growPoint, java.lang.Integer row, java.lang.Integer column)` Converts this label to an inside label (if it wasn't already), then places it at the given position, along with its children.
    `OutsideLabel.LineLabel` | `convertToLineLabel(double position, Line newOwner, OutsideLabel.LineLabel.Orientation orientation)` Converts this label to a line label (if it wasn't already), then moves this label to the given relative position on the given line.
    `OutsideLabel.LineLabel` | `convertToLineLabel(java.awt.geom.Point2D.Double point, Line newOwner, OutsideLabel.LineLabel.Orientation orientation)` Converts this label to a line label (if it wasn't already), then moves this label to the given point on the given line.
    `void` | `setMinHeight(double minHeight)` Sets the minimum height.
    `void` | `setMinSize(double width, double height)` Sets the minimum size of the label.
    `void` | `setMinWidth(double minWidth)` Sets the minimum width.

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

      `contains, createInsideLabel, createInsideLabel, createInsideLabel, findDescendantEnclosingRectangle, findNextRectangleEnclosingRectangle, getBottom, getBounds, getCenter, getCenterX, getCenterY, getHeight, getInsideLabels, getLayoutConstraints, getLeft, getMinHeight, getMinWidth, getRight, getTop, getWidth, remove, setConstraintType`

    - ### 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

    - #### setMinHeight

          public void setMinHeight(double minHeight)

      Sets the minimum height. The whole diagram is reordered afterwards, or at the end of the current transaction.
      Parameters:
        `minHeight` - the new minimum height

    - #### setMinWidth

          public void setMinWidth(double minWidth)

      Sets the minimum width. The whole diagram is reordered afterwards, or at the end of the current transaction.
      Parameters:
        `minWidth` - the new minimum width

    - #### setMinSize

          public void setMinSize(double width,
                                 double height)

      Sets the minimum size of the label.
      Parameters:
        `width` - the new minimum width
        `height` - the new minimum height

    - #### _convertToInsideLabel

          public InsideLabel _convertToInsideLabel(AbstractContainer newOwner)

      Converts this label to an inside label belonging to the new owner. Copies all parameters and children. Does nothing if this label already is an inside label (not even changes the owner; that will be handled by the move operation).
      Parameters:
        `newOwner` - the owner of the new inside label.
      Returns:
        the new inside label, or this label if it already is an inside label

    - #### convertToInsideLabel

          public InsideLabel convertToInsideLabel(java.awt.geom.Point2D.Double newCenter,
                                                  AbstractContainer newOwner,
                                                  java.awt.geom.Point2D.Double growPoint)

      Converts this label to an inside label (if it wasn't already), then places it at the given position, along with its children. The actual size may differ due to children. The new owner of the label will be stretched to accommodate the label at its desired new position. The whole diagram is reordered afterwards, or at the end of the current transaction.
      Parameters:
        `newCenter` - the new desired center of the label
        `newOwner` - the new owner of the label
        `growPoint` - the exact point at which to insert the label, it will then be grow from that point to its desired position as per `resize(java.awt.geom.Rectangle2D.Double)`
      Returns:
        the new inside label, or this label if it already is an inside label

    - #### convertToInsideLabel

          public InsideLabel convertToInsideLabel(java.awt.geom.Point2D.Double newCenter,
                                                  AbstractContainer newOwner,
                                                  java.awt.geom.Point2D.Double growPoint,
                                                  java.lang.Integer row,
                                                  java.lang.Integer column)

      Converts this label to an inside label (if it wasn't already), then places it at the given position, along with its children. The actual size may differ due to children. The new owner of the label will be stretched to accommodate the label at its desired new position. The whole diagram is reordered afterwards, or at the end of the current transaction.
      Parameters:
        `newCenter` - the new desired center of the label
        `newOwner` - the new owner of the label
        `growPoint` - the exact point at which to insert the label, it will then be grow from that point to its desired position as per `resize(java.awt.geom.Rectangle2D.Double)`
        `row` - the row of the label in new owner's grid
        `column` - the column of the label in new owner's grid
      Returns:
        the new inside label, or this label if it already is an inside label

    - #### _convertToBoxOutsideLabel

          public OutsideLabel.BoxOutsideLabel _convertToBoxOutsideLabel(Box newOwner)

      Converts this label to a box outside label belonging to the new owner. Copies all parameters and children. Does nothing if this label already is a box outside label (not even changes the owner; that will be handled by the move operation).
      Parameters:
        `newOwner` - the owner of the new box outside label.
      Returns:
        the new box outside label, or this label if it already is a box outside label

    - #### convertToBoxOutsideLabel

          public OutsideLabel.BoxOutsideLabel convertToBoxOutsideLabel(java.awt.geom.Point2D.Double point,
                                                                       Box box)

      Converts this label to a box outside label (if it wasn't already), then moves this box outside label to the given point onto the given box. The point is moved to the perimeter of the box if necessary. This operation can change this label's box side.
      Parameters:
        `point` - the point to move this label to. If this point is not on the perimeter of this label's box, it is moved there.
        `box` - the new box owner of this label
      Returns:
        the new box outside label, or this label if it already is a box outside label

    - #### convertToBoxOutsideLabel

          public OutsideLabel.BoxOutsideLabel convertToBoxOutsideLabel(Box.BoxSide side,
                                                                       double position,
                                                                       Box box)

      Converts this label to a box outside label (if it wasn't already), then moves this label to the given side of the given box at the given position.
      Parameters:
        `side` - the side of this labels box to move it to
        `position` - the position on this side to place the label at, as a proportion of the whole length of the side. Must be between 0 and 1, inclusive.
        `box` - the new box owner of this label
      Returns:
        the new box outside label, or this label if it already is a box outside label

    - #### convertToLineLabel

          public OutsideLabel.LineLabel convertToLineLabel(java.awt.geom.Point2D.Double point,
                                                           Line newOwner,
                                                           OutsideLabel.LineLabel.Orientation orientation)

      Converts this label to a line label (if it wasn't already), then moves this label to the given point on the given line. If the point is not on the line, first moves the point onto the line.
      Parameters:
        `point` - the point where to move this label
        `newOwner` - the line on which to place this label
        `orientation` - the orientation of the new line label
      Returns:
        the new line label, or this label if it already is a line label

    - #### convertToLineLabel

          public OutsideLabel.LineLabel convertToLineLabel(double position,
                                                           Line newOwner,
                                                           OutsideLabel.LineLabel.Orientation orientation)

      Converts this label to a line label (if it wasn't already), then moves this label to the given relative position on the given line.
      Parameters:
        `position` - the relative position where to place this label on the line (should be between 0 and 1, inclusive)
        `newOwner` - the line on which to place this label
        `orientation` - the orientation of the new line label
      Returns:
        the new line label, or this label if it already is a line label