Class Region

  • All Implemented Interfaces:
    java.lang.Cloneable, Constants
    Direct Known Subclasses:
    RegionBody, SideRegion

    public abstract class Region
    extends FObj
    This is an abstract base class for pagination regions.
    • Constructor Detail

      • Region

        protected Region​(FONode parent)
        Base constructor
        Parameters:
        parent - FONode that is the parent of this object
    • Method Detail

      • bind

        public void bind​(PropertyList pList)
                  throws FOPException
        Bind property values from the property list to the FO node. Must be overridden in all FObj subclasses that have properties applying to it.
        Overrides:
        bind in class FObj
        Parameters:
        pList - the PropertyList where the properties can be found.
        Throws:
        FOPException - if there is a problem binding the values
      • validateChildNode

        protected void validateChildNode​(org.xml.sax.Locator loc,
                                         java.lang.String nsURI,
                                         java.lang.String localName)
                                  throws ValidationException
        Checks to make sure, during SAX processing of input document, that the incoming node is valid for this (parent) node (e.g., checking to see that fo:table is not an immediate child of fo:root) called from FOTreeBuilder.startElement(String, String, String, Attributes) before constructing the child FObj. String, String)
        XSL Content Model: empty
        Overrides:
        validateChildNode in class FONode
        Parameters:
        loc - location in the FO source file
        nsURI - namespace of incoming node
        localName - name of the incoming node (without namespace prefix)
        Throws:
        ValidationException - if incoming node not valid for parent
      • getViewportRectangle

        public abstract java.awt.Rectangle getViewportRectangle​(FODimension pageRefRect)
        Parameters:
        pageRefRect - reference dimension of the page area.
        Returns:
        the rectangle for the viewport area
      • getDefaultRegionName

        protected abstract java.lang.String getDefaultRegionName()
        Returns the default region name (xsl-region-before, xsl-region-start, etc.)
        Returns:
        the default region name
      • isReserved

        protected boolean isReserved​(java.lang.String name)
        Checks to see if a given region name is one of the reserved names
        Parameters:
        name - a region name to check
        Returns:
        true if the name parameter is a reserved region name
      • getPageWidthContext

        protected PercentBaseContext getPageWidthContext​(int lengthBase)
        Get the page-width context
        Parameters:
        lengthBase - the lengthBase to use for resolving percentages
        Returns:
        context for the width of the page-reference-area
      • getPageHeightContext

        protected PercentBaseContext getPageHeightContext​(int lengthBase)
        Get the page-width context
        Parameters:
        lengthBase - the lengthBase to use for resolving percentages
        Returns:
        context for the width of the page-reference-area
      • generatesReferenceAreas

        public boolean generatesReferenceAreas()
        Check if this formatting object generates reference areas.
        Overrides:
        generatesReferenceAreas in class FObj
        Returns:
        true if generates reference areas TODO see if needed
      • getSiblingRegion

        protected Region getSiblingRegion​(int regionId)
        Returns a sibling region for this region.
        Parameters:
        regionId - the Constants ID of the FO representing the region
        Returns:
        the requested region
      • getCommonBorderPaddingBackground

        public CommonBorderPaddingBackground getCommonBorderPaddingBackground()
        Returns:
        the Background Properties (border and padding are not used here).
      • getRegionName

        public java.lang.String getRegionName()
        Returns:
        the "region-name" FO trait.
      • getOverflow

        public int getOverflow()
        Returns:
        the "overflow" FO trait.
      • getDisplayAlign

        public int getDisplayAlign()
        Returns:
        the display-align FO trait.
      • getReferenceOrientation

        public int getReferenceOrientation()
        Returns:
        the "reference-orientation" FO trait.
      • getWritingMode

        public WritingMode getWritingMode()
        Returns:
        the "writing-mode" FO trait.