Class VBox

All Implemented Interfaces:
Dimensions
Direct Known Subclasses:
Footnote, Page

public class VBox extends Box
Represents a page in the output medium.
  • Constructor Details

    • VBox

      public VBox(List<Element> elements, Dimensions dimensions, long shift)
      The elements are listed top to bottom.
    • VBox

      public VBox(List<Element> elements, long shift)
      The elements are listed top to bottom.
    • VBox

      public VBox(List<Element> elements)
      The elements are listed top to bottom.
  • Method Details

    • getElements

      public List<Element> getElements()
    • fixed

      public VBox fixed(long newSize, VerticalAlignment verticalAlignment)
      Return a new VBox with all the elements stretches or shrunk to be newSize.
    • layOut

      public void layOut(long x, long y, org.apache.pdfbox.pdmodel.PDPageContentStream contents) throws IOException
      Lay out all the elements back to back vertically. Y is the upper-left, not the baseline.
      Throws:
      IOException
    • layOutHorizontally

      public long layOutHorizontally(long x, long y, org.apache.pdfbox.pdmodel.PDPageContentStream contents) throws IOException
      Description copied from class: Element
      Add the element to the contents as part of a horizontal sequence.
      Overrides:
      layOutHorizontally in class Box
      Parameters:
      x - the left-most point of the element.
      y - the baseline of the element.
      contents - the stream to add the element to.
      Returns:
      how much to move right afterward.
      Throws:
      IOException
    • layOutVertically

      public long layOutVertically(long x, long y, org.apache.pdfbox.pdmodel.PDPageContentStream contents) throws IOException
      Description copied from class: Element
      Add the element to the contents as part of a vertical sequence.
      Overrides:
      layOutVertically in class Box
      Parameters:
      x - the left-most point of the element.
      y - the upper-left point of the element.
      contents - the stream to add the element to.
      Returns:
      how much to move down afterward.
      Throws:
      IOException
    • visit

      public void visit(Consumer<Element> consumer)
      Description copied from class: Element
      Calls the consumer on this element and all child elements in pre-order. The default implementation just calls the consumer on this element.
      Overrides:
      visit in class Element
    • println

      public void println(PrintStream stream, String indent)
      Description copied from class: Element
      Pretty prints the element to the PrintWriter with the given indent. The method must print its own newline.
      Overrides:
      println in class Element