lv.lumii.layoutengine

## Class OutsideLabel

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

- Direct Known Subclasses:
    OutsideLabel.BoxOutsideLabel, OutsideLabel.LineLabel

      public abstract class OutsideLabel
      extends Label

  This class describes labels that are on the outer perimeter of some element.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `OutsideLabel.BoxOutsideLabel` A class for box outside labels.
    `static class` | `OutsideLabel.LineLabel` A class for line outside labels.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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.
    `void` | `flip()` Rotates this label sideways, i.e., swaps the width and the height of the label.
    `boolean` | `isAutoFlipped()` Checks whether the auto flip parameter for this label is set.
    `boolean` | `isFlipped()` Checks whether the label currently is rotated.
    `void` | `resize(double width, double height)` Resizes this label to the given dimensions while keeping its center unchanged if possible.
    `void` | `resize(java.awt.geom.Rectangle2D.Double rectangle)` Resizes the label, moving it from its current relative position to the position defined by the given rectangle center point.
    `abstract void` | `setAutoFlip(boolean state)` Sets the auto flip parameter for this label.
    `void` | `setSpacing(double spacing)` Sets the spacing of the element.

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

      `_convertToBoxOutsideLabel, _convertToInsideLabel, convertToBoxOutsideLabel, convertToBoxOutsideLabel, convertToInsideLabel, convertToInsideLabel, convertToLineLabel, convertToLineLabel, setMinHeight, setMinSize, setMinWidth`

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

      `contains, 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`

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

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

- - ### Method Detail

    - #### flip

          public void flip()

      Rotates this label sideways, i.e., swaps the width and the height of the label. The whole diagram is reordered afterwards, or at the end of the current transaction. Use the method `isFlipped()` to check whether the label currently is flipped.

    - #### isFlipped

          public boolean isFlipped()

      Checks whether the label currently is rotated.
      Returns:
        whether the label currently is rotated.

    - #### setAutoFlip

          public abstract void setAutoFlip(boolean state)

      Sets the auto flip parameter for this label. If auto flip is set, then the label will be always flipped sideways (its width and height swapped) when placed on a vertical segment, so that it always runs along the segment (unless `flipped` is set, in which case this ensures the label always runs perpendicular to the segment).
      Parameters:
        `state` - whether to set or unset the auto flip parameter

    - #### isAutoFlipped

          public boolean isAutoFlipped()

      Checks whether the auto flip parameter for this label is set.
      Returns:
        whether the auto flip parameter for this label is set.

    - #### resize

          public void resize(java.awt.geom.Rectangle2D.Double rectangle)

      Description copied from class: `Label`
      Resizes the label, moving it from its current relative position to the position defined by the given rectangle center point. Changes the minimum size of the label to the given size. The actual size may differ due to children. The whole diagram is reordered afterwards, or at the end of the current transaction.
      Parameters:
        `rectangle` - the new position of the label to resize it to

    - #### resize

          public void resize(double width,
                             double height)

      Resizes this label to the given dimensions while keeping its center unchanged if possible.
      Parameters:
        `width` - the new width of the label
        `height` - the new height of the label

    - #### setSpacing

          public void setSpacing(double spacing)

      Description copied from class: `Element`
      Sets the spacing of the element.
      Specified by:
        `setSpacing` in class `Element`
      Parameters:
        `spacing` - the value to set

    - #### createInsideLabel

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

      Description copied from class: `AbstractContainer`
      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.
      Overrides:
        `createInsideLabel` in class `AbstractContainer`
      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.