Class BlockBox


public class BlockBox extends CompositeBox
A CompositeBox suitable for containing multiple LineBox fragments.
Since:
2.1
  • Method Details

    • add

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

      public boolean containsPoint(int x, int y)
      Description copied from class: FlowBox
      This method must be called on a block that is completely positioned and committed.
      Specified by:
      containsPoint in class FlowBox
      Parameters:
      x - X
      y - Y
      Returns:
      true if the FlowBox contains the point
      See Also:
    • getAscent

      public int getAscent()
      Description copied from class: FlowBox
      Returns the amount of line content in pixels which is above the baseline. Ascent and descent are used to space consecutive lines apart. Certain types of line content, such as borders, extend beyond the ascent and descent.
      Specified by:
      getAscent in class FlowBox
      Returns:
      the descent in pixels below the baseline
      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:
    • getDescent

      public int getDescent()
      Description copied from class: FlowBox
      Returns the amount of line content in pixels which is below the baseline.
      Specified by:
      getDescent in class FlowBox
      Returns:
      the descent in pixels
      See Also:
    • getHeight

      public int getHeight()
      Returns:
      Returns the height.
    • setHeight

      public void setHeight(int h)
      Sets the height.
      Parameters:
      h - The height
    • setLineTop

      public void setLineTop(int y)
      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:
      y - the y coordinate
      See Also: