Class MainReference

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class MainReference
    extends Area
    The main-reference-area generated by an fo:region-body This object holds one or more span-reference-areas (block-areas stacked in the block progression direction) See fo:region-body definition in the XSL Rec for more information.
    See Also:
    Serialized Form
    • Constructor Detail

      • MainReference

        public MainReference​(BodyRegion parent)
        Constructor
        Parameters:
        parent - the body region this reference area is placed in.
    • Method Detail

      • createSpan

        public Span createSpan​(boolean spanAll)
        Add a span area to this area.
        Parameters:
        spanAll - whether to make a single-column span
        Returns:
        the created span area.
      • getSpans

        public java.util.List<Span> getSpans()
        Get the span areas from this area.
        Returns:
        the list of span areas
      • setSpans

        public void setSpans​(java.util.List<Span> spans)
        Do not use. Used to handle special page-master for last page: transfer the content that had already been added to a normal page to this main reference for the last page. TODO this is hacky.
        Parameters:
        spans - content already laid out
      • getCurrentSpan

        public Span getCurrentSpan()
        Get the span area currently being filled (i.e., the last span created).
        Returns:
        the active span.
      • isEmpty

        public boolean isEmpty()
        Indicates whether any child areas have been added to this reference area. This is achieved by looping through each span.
        Returns:
        true if no child areas have been added yet.
      • getColumnCount

        public int getColumnCount()
        Returns:
        the number of columns
      • getColumnGap

        public int getColumnGap()
        Returns:
        the column gap in millipoints
      • setWritingModeTraits

        public void setWritingModeTraits​(WritingModeTraitsGetter wmtg)
        Sets the writing mode traits for the spans of this main reference area.
        Overrides:
        setWritingModeTraits in class Area
        Parameters:
        wmtg - a WM traits getter