Class TextDisplay


  • public class TextDisplay
    extends java.lang.Object
    The text display plays a key role in the presentation of text, and in operations that map between graphic locations and text positions (e.g., move up one line).

    An application never creates a display directly. Instead, it asks a displayable stream (derived class of TextDispStr) to create one. Once created, the text display instance belongs to the displayable stream instance until the latter is destroyed. The application must never destroy a text display.

    While the presence of a text display enables a large number of operations, the display API is fairly light. Many display-related operations are handled through the text stream, position and range APIs.

    For more information, please see the external documentation.

    • Field Detail

      • mpoEnv

        public GFXEnv mpoEnv
      • mnLineCount

        public int mnLineCount
      • mnSuppressFormat

        public int mnSuppressFormat
      • mnIgnoreUpdates

        public int mnIgnoreUpdates
      • moChange

        public final com.adobe.xfa.text.DispChange moChange
      • moTabs

        public final Storage<com.adobe.xfa.text.DispTab> moTabs
      • moLocaleInfo

        public com.adobe.xfa.text.LocaleInfo moLocaleInfo
      • meLayoutOrientation

        public int meLayoutOrientation
      • mbHasFontSubstitution

        public boolean mbHasFontSubstitution
    • Constructor Detail

      • TextDisplay

        public TextDisplay()
    • Method Detail

      • gfxDraw

        public boolean gfxDraw​(TextDrawInfo oDrawInfo)
        Render the display contents, using the properties provided.

        Given a set of rendering properties in an instance of class {link TextDrawInfo}, this method performs the appropriate rendering.

        Parameters:
        oDrawInfo - - Rendering properties. For more information, please see the description of {link TextDrawInfo}.
        Returns:
        False if truncate was requested and some text was truncated. true in all other cases.
      • lines

        public int lines()
        Obtain the number of lines of text.
        Returns:
        Number of lines of text in the display.
      • suppressFormat

        public boolean suppressFormat()
        Determine whether formatting is suppressed.

        An application that plans to make a number of changes to a text stream can turn off formatting (layout) of the display after each change, and restore it after the last change. This may improve performance.

        Returns:
        TRUE if formatting is currently suppressed; FALSE otherwise.
      • pushSuppressFormat

        public void pushSuppressFormat()
        Push request to suppress formatting.

        In a complex application, there may be many levels in the call stack that wish to suppress formatting. This method pushes a suppress format request onto a stack managed by the text display.

      • popSuppressFormat

        public void popSuppressFormat()
        Pop request to suppress formatting.

        In a complex application, there may be many levels in the call stack that wish to suppress formatting. This method pops a suppress format request from a stack managed by the text display. When the stack is empty, formatting is turned back on.

      • clearSuppressFormat

        public void clearSuppressFormat()
        Clear the suppress formatting request stack.

        This method pops all outstanding requests off the supress formatting stack and turns formatting back on.

      • hasFontSubstitution

        public boolean hasFontSubstitution()
        Query whether there is any font substitution in this display.

        This method exists to assist text layout caching. A text display with font substitution cannot be cached. As the display is built, it records a Boolean indicating whether any substitution takes place. Note that an incremental re-layout may clear the condition causing the font substitution; that will not be reflected in the value of this Boolean. However, in expected usage, this will not be an issue.

        Returns:
        TRUE if there has been any font substitution; FALSE if there is no substitution.
      • setFontSubstitution

        public void setFontSubstitution​(boolean bSubstitution)
        Initialize the font substitution flag.

        This method allows the caller to pre-populate the font substitution flag, typically when the caller knows something that AXTE doesn't.

        Parameters:
        bSubstitution - - TRUE to indicate that font substitution has taken place; FALSE to indicate it hasn't.
      • updateSuspectLayout

        public void updateSuspectLayout()
      • runtimeExtent

        public Rect runtimeExtent()
      • releaseDisposableMaps

        public void releaseDisposableMaps​(com.adobe.xfa.text.DispMapSet poMaps)