lv.lumii.layoutengine

## Class Element

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

- Direct Known Subclasses:
    AbstractContainer, Line

      public abstract class Element
      extends java.lang.Object

  The base class of all diagram elements.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Diagram` | `getDiagram()` The diagram the object is in.
    `Element` | `getOwner()` Each element can be owned by some other element.
    `double` | `getSpacing()` Returns the spacing of the element.
    `void` | `remove()` Removes the element and its descendant elements.
    `void` | `remove(boolean adjust)` Removes the element and its descendant elements.
    `abstract void` | `setSpacing(double spacing)` Sets the spacing of the element.

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

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

- - ### Method Detail

    - #### getOwner

          public Element getOwner()

      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.
      Returns:
        the owner of this object, or possibly `null`, if this element is a diagram.

    - #### getDiagram

          public final Diagram getDiagram()

      The diagram the object is in. Can return `null` if this element itself is a diagram.
      Returns:
        the diagram this object is in, or possibly itself if this object is a top level diagram.

    - #### getSpacing

          public double getSpacing()

      Returns the spacing of the element.
      Returns:
        the spacing of the element.

    - #### setSpacing

          public abstract void setSpacing(double spacing)

      Sets the spacing of the element.
      Parameters:
        `spacing` - the value to set

    - #### remove

          public void remove()

      Removes the element and its descendant elements. The whole diagram is reordered afterwards, or at the end of the current transaction.

    - #### remove

          public void remove(boolean adjust)

      Removes the element and its descendant elements. The whole diagram is reordered afterwards, or at the end of the current transaction if `adjust` is set to `true`.
      Parameters:
        `adjust` - whether to adjust the diagram after the element removal