Class LineRoot


public class LineRoot extends LineBox
LineRoot is the top-most container on a line of text displayed in Draw2d. Hence, a LineRoot can tell you of things like the highest ascent or descent on a line, which is required to display selection and such. All fragments know of the LineRoot they belong to.
Since:
3.1
  • Constructor Details

    • LineRoot

      public LineRoot(boolean isMirrored)
      Constructor
      Parameters:
      isMirrored - true if the line is to be displayed in a mirrored control
  • Method Details

    • add

      public void add(FlowBox child)
      Description copied from class: CompositeBox
      Adds the given box and updates properties of this composite box.
      Overrides:
      add in class LineBox
      Parameters:
      child - the child being added
      See Also:
    • commit

      public void commit()
      Committing a LineRoot will position its children correctly. All children boxes are made to have the same baseline, and are laid out according to the Unicode BiDi Algorithm, or left-to-right if Bidi is not necessary.
    • containsPoint

      public boolean containsPoint(int x, int y)
      A LineRoot cannot be targetted.
      Specified by:
      containsPoint in class FlowBox
      Parameters:
      x - X
      y - Y
      Returns:
      true if the FlowBox contains the point
      See Also:
    • getBaseline

      public int getBaseline()
      Description copied from class: FlowBox
      Returns y coordinate for the box's baseline.
      Specified by:
      getBaseline in class FlowBox
      Returns:
      the baseline location
      See Also:
    • setBaseline

      public void setBaseline(int baseline)
      Positions the line vertically by settings its baseline.
      Parameters:
      baseline - the baseline
    • setLineTop

      public void setLineTop(int top)
      Description copied from class: CompositeBox
      Positions the box vertically by setting the y coordinate for the top of the content of the line. For internal use only.
      Specified by:
      setLineTop in class CompositeBox
      Parameters:
      top - the y coordinate
      See Also: