lv.lumii.layoutengine

## Class OutsideLabel.LineLabel

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

- Enclosing class:
    OutsideLabel

      public static class OutsideLabel.LineLabel
      extends OutsideLabel

  A class for line outside labels.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `OutsideLabel.LineLabel.Orientation` This enumeration defines the options for limiting on which side of their line can labels be placed.

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

      `OutsideLabel.BoxOutsideLabel, OutsideLabel.LineLabel`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `OutsideLabel.LineLabel.Orientation` | `getOrientation()` Returns the orientation of this line label.
    `Line` | `getOwner()` Each element can be owned by some other element.
    `double` | `getRotationAngle()` Returns the clockwise rotation angle for this label if this label is to be rotated.
    `boolean` | `isRotated()` Returns whether the label is rotated.Labels for orthogonal lines are never rotated, even if this method returns `true`.
    `void` | `move(double position, Line line)` Moves this label to the given relative position on the given line.
    `void` | `move(java.awt.geom.Point2D.Double point, Line line)` Moves this label to the given point on the given line.
    `void` | `setAutoFlip(boolean state)` Sets the auto flip parameter for this label.
    `void` | `setOrientation(OutsideLabel.LineLabel.Orientation orientation)` Sets the orientation of this line label.
    `void` | `setRotation(boolean state)` Sets whether to rotate this label.

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

      `createInsideLabel, flip, isAutoFlipped, isFlipped, resize, resize, setSpacing`

    - ### 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, getSpacing, remove`

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

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

- - ### Method Detail

    - #### getOrientation

          public OutsideLabel.LineLabel.Orientation getOrientation()

      Returns the orientation of this line label. The orientation is a parameter which defines on which side of the line the label should be placed.
      Returns:
        the orientation of this line label

    - #### setOrientation

          public void setOrientation(OutsideLabel.LineLabel.Orientation orientation)

      Sets the orientation of this line label. The orientation is a parameter which defines on which side of the line the label should be placed.
      Parameters:
        `orientation` - the new orientation of this line label

    - #### getRotationAngle

          public double getRotationAngle()

      Returns the clockwise rotation angle for this label if this label is to be rotated. Otherwise returns 0. Labels for orthogonal lines are never rotated (the method also returns 0).
      Returns:
        the angle this label should be rotated clockwise.

    - #### setRotation

          public void setRotation(boolean state)

      Sets whether to rotate this label. Labels for orthogonal lines are never rotated, even if this is set to `true`.
      Parameters:
        `state` - the rotation state of the label.

    - #### isRotated

          public boolean isRotated()

      Returns whether the label is rotated.Labels for orthogonal lines are never rotated, even if this method returns `true`.
      Returns:
        whether the label is rotated.

    - #### getOwner

          public Line getOwner()

      Description copied from class: `Element`
      Each element can be owned by some other element. When an owner is deleted, it deletes all objects owned by it. A box's owner is a container (or one of its derived classes — another box or diagram), a line is owned by a container. A label is owned by a box, a line, a label or a container. Container's owner is a container. A diagram is not owned by any other element.
      Overrides:
        `getOwner` in class `Element`
      Returns:
        the owner of this object, or possibly `null`, if this element is a diagram.

    - #### setAutoFlip

          public void setAutoFlip(boolean state)

      Description copied from class: `OutsideLabel`
      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 `OutsideLabel.flipped` is set, in which case this ensures the label always runs perpendicular to the segment).
      Specified by:
        `setAutoFlip` in class `OutsideLabel`
      Parameters:
        `state` - whether to set or unset the auto flip parameter

    - #### move

          public void move(java.awt.geom.Point2D.Double point,
                           Line line)

      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
        `line` - the line on which to place this label

    - #### move

          public void move(double position,
                           Line line)

      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)
        `line` - the line on which to place this label