Class UnresolvedPageNumber

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

    public class UnresolvedPageNumber
    extends TextArea
    implements Resolvable
    Unresolvable page number area. This is a word area that resolves itself to a page number from an id reference.
    See Also:
    Serialized Form
    • Field Detail

      • resolved

        private boolean resolved
      • pageIDRef

        private java.lang.String pageIDRef
      • text

        private java.lang.String text
      • pageType

        private boolean pageType
      • FIRST

        public static final boolean FIRST
        Indicates that the reference refers to the first area generated by a formatting object.
        See Also:
        Constant Field Values
      • LAST

        public static final boolean LAST
        Indicates that the reference refers to the last area generated by a formatting object.
        See Also:
        Constant Field Values
      • font

        private transient Font font
    • Constructor Detail

      • UnresolvedPageNumber

        public UnresolvedPageNumber()
      • UnresolvedPageNumber

        public UnresolvedPageNumber​(java.lang.String id,
                                    Font f)
        Create a new unresolved page number.
        Parameters:
        id - the id reference for resolving this
        f - the font for formatting the page number
      • UnresolvedPageNumber

        public UnresolvedPageNumber​(java.lang.String id,
                                    Font f,
                                    boolean type)
        Create a new unresolved page number.
        Parameters:
        id - the id reference for resolving this
        f - the font for formatting the page number
        type - indicates whether the reference refers to the first or last area generated by a formatting object
    • Method Detail

      • readObject

        private void readObject​(java.io.ObjectInputStream ois)
                         throws java.lang.ClassNotFoundException,
                                java.io.IOException
        Throws:
        java.lang.ClassNotFoundException
        java.io.IOException
      • getIDRefs

        public java.lang.String[] getIDRefs()
        Get the id references for this area.
        Specified by:
        getIDRefs in interface Resolvable
        Returns:
        the id reference for this unresolved page number
      • getText

        public java.lang.String getText()
        Get the (resolved or unresolved) text.
        Overrides:
        getText in class TextArea
        Returns:
        the text
      • resolveIDRef

        public void resolveIDRef​(java.lang.String id,
                                 java.util.List<PageViewport> pages)
        Resolve the page number idref This resolves the idref for this object by getting the page number string from the first page in the list of pages that apply for this ID. The page number text is then set to the String value of the page number. TODO: [GA] May need to run bidi algorithm and script processor on resolved page number.
        Specified by:
        resolveIDRef in interface Resolvable
        Parameters:
        id - an id whose PageViewports have been determined
        pages - the list of PageViewports associated with this ID
      • isResolved

        public boolean isResolved()
        Check if this is resolved.
        Specified by:
        isResolved in interface Resolvable
        Returns:
        true when this has been resolved
      • applyVariationFactor

        public boolean applyVariationFactor​(double variationFactor,
                                            int lineStretch,
                                            int lineShrink)
        recursively apply the variation factor to all descendant areas
        Overrides:
        applyVariationFactor in class AbstractTextArea
        Parameters:
        variationFactor - the variation factor that must be applied to adjustment ratios
        lineStretch - the total stretch of the line
        lineShrink - the total shrink of the line
        Returns:
        true if there is an UnresolvedArea descendant
      • collectInlineRuns

        public java.util.List collectInlineRuns​(java.util.List runs)
        Collection bidi inline runs. Override of @{link InlineParent} implementation. N.B. [GA] without this override, the page-number-citation_writing_mode_rl layout engine test will fail. It may be that the test needs to be updated rather than using this override.
        Overrides:
        collectInlineRuns in class InlineParent
        Parameters:
        runs - current list of inline runs
        Returns:
        modified list of inline runs, having appended new run