Class PageSequence

    • Field Detail

      • masterReference

        private java.lang.String masterReference
      • referenceOrientation

        private Numeric referenceOrientation
      • locale

        private java.util.Locale locale
      • flowMap

        private java.util.Map<java.lang.String,​FONode> flowMap
        Map of flows to their flow name (flow-name, Flow)
      • simplePageMaster

        private SimplePageMaster simplePageMaster
        The currentSimplePageMaster is either the page master for the whole page sequence if master-reference refers to a simple-page-master, or the simple page master produced by the page sequence master otherwise. The pageSequenceMaster is null if master-reference refers to a simple-page-master.
      • titleFO

        private Title titleFO
        The fo:title object for this page-sequence.
      • mainFlow

        private Flow mainFlow
        The fo:flow object for this page-sequence.
      • changeBarList

        private final java.util.List<ChangeBar> changeBarList
        Active change bars
    • Constructor Detail

      • PageSequence

        public PageSequence​(FONode parent)
        Create a PageSequence instance that is a child of the given FONode.
        Parameters:
        parent - the parent FONode
    • 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 AbstractPageSequence
        Parameters:
        pList - the PropertyList where the properties can be found.
        Throws:
        FOPException - if there is a problem binding the values
      • endOfNode

        public void endOfNode()
                       throws FOPException
        Primarily used for making final content model validation checks and/or informing the FOEventHandler that the end of this FO has been reached. The default implementation simply calls FONode.finalizeNode(), without sending any event to the FOEventHandler.

        Note: the recommended way to override this method in subclasses is

        super.endOfNode(); // invoke finalizeNode()

        getFOEventHandler().endXXX(); // send endOfNode() notification

        Overrides:
        endOfNode in class FObj
        Throws:
        FOPException - FOP Exception
      • 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. XSL Content Model: (title?,static-content*,flow)
        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
      • addChildNode

        public void addChildNode​(FONode child)
                          throws FOPException
        Adds a node as a child of this node. The default implementation of this method just ignores any child node being added. TODO see if addChildNode() should also be called for fo's other than fo:flow.
        Overrides:
        addChildNode in class FObj
        Parameters:
        child - child node to be added to the childNodes of this node
        Throws:
        FOPException - if there's a problem during processing
      • addFlow

        private void addFlow​(Flow flow)
                      throws ValidationException
        Add a flow or static content, mapped by its flow-name. The flow-name is used to associate the flow with a region on a page, based on the region-names given to the regions in the page-master used to generate that page.
        Parameters:
        flow - the Flow instance to be added
        Throws:
        ValidationException - if the fo:flow maps to an invalid page-region
      • hasRegion

        private boolean hasRegion​(java.lang.String flowName)
      • getStaticContent

        public StaticContent getStaticContent​(java.lang.String name)
        Get the static content FO node from the flow map. This gets the static content flow for the given flow name.
        Parameters:
        name - the flow name to find
        Returns:
        the static content FO node
      • getTitleFO

        public Title getTitleFO()
        Accessor method for the fo:title associated with this fo:page-sequence
        Returns:
        titleFO for this object
      • getMainFlow

        public Flow getMainFlow()
        Public accessor for getting the MainFlow to which this PageSequence is attached.
        Returns:
        the MainFlow object to which this PageSequence is attached.
      • hasFlowName

        public boolean hasFlowName​(java.lang.String flowName)
        Determine if this PageSequence already has a flow with the given flow-name Used for validation of incoming fo:flow or fo:static-content objects
        Parameters:
        flowName - The flow-name to search for
        Returns:
        true if flow-name already defined within this page sequence, false otherwise
      • getFlowMap

        public java.util.Map<java.lang.String,​FONode> getFlowMap()
        Returns:
        the flow map for this page-sequence
      • getNextSimplePageMaster

        public SimplePageMaster getNextSimplePageMaster​(int page,
                                                        boolean isFirstPage,
                                                        boolean isLastPage,
                                                        boolean isBlank,
                                                        boolean skipPagePositionOnly)
                                                 throws PageProductionException
        Public accessor for determining the next page master to use within this page sequence.
        Parameters:
        page - the page number of the page to be created
        isFirstPage - indicator whether this page is the first page of the page sequence
        isLastPage - indicator whether this page is the last page of the page sequence
        isBlank - indicator whether the page will be blank
        Returns:
        the SimplePageMaster to use for this page
        Throws:
        PageProductionException - if there's a problem determining the page master
      • goToPreviousSimplePageMaster

        public boolean goToPreviousSimplePageMaster()
        Used to set the "cursor position" for the page masters to the previous item.
        Returns:
        true if there is a previous item, false if the current one was the first one.
      • hasPagePositionLast

        public boolean hasPagePositionLast()
        Returns:
        true if the page-sequence has a page-master with page-position="last"
      • hasPagePositionOnly

        public boolean hasPagePositionOnly()
        Returns:
        true if the page-sequence has a page-master with page-position="only"
      • getMasterReference

        public java.lang.String getMasterReference()
        Get the value of the master-reference trait.
        Returns:
        the "master-reference" trait
      • getLocalName

        public java.lang.String getLocalName()
        Returns the local name (i.e. without namespace prefix) of the node
        Specified by:
        getLocalName in class FONode
        Returns:
        the local name of this node
      • getLocale

        public java.util.Locale getLocale()
      • getReferenceOrientation

        public int getReferenceOrientation()
        Get the value of the reference-orientation trait.
        Overrides:
        getReferenceOrientation in class AbstractPageSequence
        Returns:
        the reference orientation trait value
      • collectDelimitedTextRanges

        protected java.util.Stack<DelimitedTextRange> collectDelimitedTextRanges​(java.util.Stack<DelimitedTextRange> ranges,
                                                                                 DelimitedTextRange currentRange)
        Description copied from class: FONode
        Collect the sequence of delimited text ranges, where each new range is pushed onto RANGES, where default implementation collects ranges of child nodes.
        Overrides:
        collectDelimitedTextRanges in class FONode
        Parameters:
        ranges - a stack of delimited text ranges
        currentRange - the current range or null (if none)
        Returns:
        the (possibly) updated stack of delimited text ranges
      • isBidiBoundary

        protected boolean isBidiBoundary​(boolean propagate)
        Overrides:
        isBidiBoundary in class FObj
      • releasePageSequence

        public void releasePageSequence()
        Releases a page-sequence's children after the page-sequence has been fully processed.
      • getLastSimplePageMaster

        public SimplePageMaster getLastSimplePageMaster​(int page,
                                                        boolean isFirstPage,
                                                        boolean isBlank)
      • pushChangeBar

        public void pushChangeBar​(ChangeBar changeBarBegin)
        Adds the specified change bar to the active change bar list.
        Parameters:
        changeBarBegin - The starting change bar element
      • popChangeBar

        public void popChangeBar​(ChangeBar changeBarEnd)
        Removes the couple of the specified change bar from the active change bar list.
        Parameters:
        changeBarEnd - The ending change bar element
      • getChangeBarBegin

        public ChangeBar getChangeBarBegin​(ChangeBar changeBarEnd)
        Returns the starting counterpart of the specified ending change bar.
        Parameters:
        changeBarEnd - The ending change bar element
        Returns:
        The starting counterpart of the specified ending change bar
      • hasChangeBars

        public boolean hasChangeBars()
        Tests if there are any active change bars.
        Returns:
        A boolean value true if there are any active change bars
      • getChangeBarList

        public java.util.List<ChangeBar> getChangeBarList()
        Returns the list of active change bars.
        Overrides:
        getChangeBarList in class FONode
        Returns:
        The list of active change bars
      • getClonedChangeBarList

        public java.util.List<ChangeBar> getClonedChangeBarList()
        Returns the copy of active change bars list.
        Returns:
        The list containing a copy of the active change bars
      • setOnlyTryInfinite

        public void setOnlyTryInfinite​(boolean b)