Class GFXTextAttr

java.lang.Object
com.adobe.xfa.gfx.GFXAttr
com.adobe.xfa.gfx.GFXTextAttr

public class GFXTextAttr extends GFXAttr
The graphic text attribute object holds information about attribute values specific for text drawing.
  • Field Details

    • UNDER_TYPE

      public static final int UNDER_TYPE
      enumeration UnderCode.

      Low four bits are type (unknown, none, all or word). High four bits are style (single, double, strikeout). Combined by using bit-wise OR.

      See Also:
    • UNDER_UNKNOWN

      public static final int UNDER_UNKNOWN
      See Also:
    • UNDER_NONE

      public static final int UNDER_NONE
      See Also:
    • UNDER_ALL

      public static final int UNDER_ALL
      See Also:
    • UNDER_WORD

      public static final int UNDER_WORD
      See Also:
    • UNDER_STYLE

      public static final int UNDER_STYLE
      See Also:
    • UNDER_SINGLE

      public static final int UNDER_SINGLE
      See Also:
    • UNDER_DOUBLE

      public static final int UNDER_DOUBLE
      See Also:
    • LINETHROUGH_TYPE

      public static final int LINETHROUGH_TYPE
      enumeration LineThroughCode.

      Low four bits are type (unknown, none, all or word). High four bits are style (single, double, strikeout). Combined by using bit-wise OR.

      See Also:
    • LINETHROUGH_UNKNOWN

      public static final int LINETHROUGH_UNKNOWN
      See Also:
    • LINETHROUGH_NONE

      public static final int LINETHROUGH_NONE
      See Also:
    • LINETHROUGH_ALL

      public static final int LINETHROUGH_ALL
      See Also:
    • LINETHROUGH_WORD

      public static final int LINETHROUGH_WORD
      See Also:
    • LINETHROUGH_STYLE

      public static final int LINETHROUGH_STYLE
      See Also:
    • LINETHROUGH_SINGLE

      public static final int LINETHROUGH_SINGLE
      See Also:
    • LINETHROUGH_DOUBLE

      public static final int LINETHROUGH_DOUBLE
      See Also:
    • OVER_TYPE

      public static final int OVER_TYPE
      enumeration OverCode.

      Low four bits are type (unknown, none, all or word). High four bits are style (single, double, strikeout). Combined by using bit-wise OR.

      See Also:
    • OVER_UNKNOWN

      public static final int OVER_UNKNOWN
      See Also:
    • OVER_NONE

      public static final int OVER_NONE
      See Also:
    • OVER_ALL

      public static final int OVER_ALL
      See Also:
    • OVER_WORD

      public static final int OVER_WORD
      See Also:
    • OVER_STYLE

      public static final int OVER_STYLE
      See Also:
    • OVER_SINGLE

      public static final int OVER_SINGLE
      See Also:
    • OVER_DOUBLE

      public static final int OVER_DOUBLE
      See Also:
    • STRIKEOUT_UNKNOWN

      public static final int STRIKEOUT_UNKNOWN
      enumeration StrikeoutCode.

      Legacy enumeration for inconsistent strikeout handling

      See Also:
    • STRIKEOUT_NONE

      public static final int STRIKEOUT_NONE
      See Also:
    • STRIKEOUT_SINGLE

      public static final int STRIKEOUT_SINGLE
      See Also:
    • STRIKEOUT_DOUBLE

      public static final int STRIKEOUT_DOUBLE
      See Also:
    • defaultTextAttr

      public static final GFXTextAttr defaultTextAttr
  • Constructor Details

    • GFXTextAttr

      public GFXTextAttr()
      Default constructor.

      Populates the graphic attribute with the following settings:

               Underline        = none
               Overline         = none
               Strikeout        = none
       
    • GFXTextAttr

      public GFXTextAttr(GFXTextAttr oSource)
      Copy constructor.

      Creates a new Text attribute with the same settings as the source attribute.

      Parameters:
      oSource - Text attribute to copy
    • GFXTextAttr

      public GFXTextAttr(int nNewUnderline, int nNewStyle, int lNewShade, GFXColour oNewColour, GFXColour oNewColourBg)
      Constructor.

      Creates a new Text attribute with the specified settings.

      Parameters:
      nNewUnderline - The underline setting for this attribute
      nNewStyle - The style setting for this attribute
      lNewShade - The shade setting for this attribute
      oNewColour - The foreground colour to be used
      oNewColourBg - The background colour to be used
    • GFXTextAttr

      public GFXTextAttr(int nNewUnderline, int nNewStyle, int lNewShade, GFXColour oNewColour, GFXColour oNewColourBg, int nNewStrikeout, int nNewOverline)
      Constructor.

      Creates a new Text attribute with the specified settings.

      Parameters:
      nNewUnderline - The underline setting for this attribute
      nNewStyle - The style setting for this attribute
      lNewShade - The shade setting for this attribute
      oNewColour - The foreground colour to be used
      oNewColourBg - The background colour to be used
      nNewStrikeout - The strikeout setting for this attribute
      nNewOverline - The overline setting for this attribute
  • Method Details

    • defaultText

      public static GFXTextAttr defaultText()
      Get a default Text Attribute.

      This will return a Text Attribute with the following settings:

               Underline                 = none
               Style                     = solid
               Shade scale       = maximum
               Foreground colour = black
               Background colour = white
       
      Returns:
      A Text Attribute with default settings
    • underline

      public int underline()
      Get the underline value for this attribute.
      Returns:
      the underline value as a UnderCode enumeration
    • underline

      public void underline(int nNewUnderline)
      Set the underline value for this attribute.
      Parameters:
      nNewUnderline - New underline value
    • overline

      public int overline()
      Get the overline value for this attribute.
      Returns:
      the overline value as a OverCode enumeration
    • overline

      public void overline(int nNewOverline)
      Set the overline value for this attribute.
      Parameters:
      nNewOverline - New overline value
    • strikeout

      public int strikeout()
      Get the strikeout value for this attribute.
      Returns:
      The strikeout value as a StrikeoutCode enumeration
    • strikeout

      public void strikeout(int nNewStrikeout)
      Set the strikeout value for this attribute.
      Parameters:
      nNewStrikeout - New strikeout value
    • textContext

      public GFXTextContext textContext()
      Return the text context associated with this graphic text attribute object.
      Returns:
      Pointer to the text context. A null pointer is returned if the context has never been set.
    • textContext

      public void textContext(GFXTextContext poTextContext)
      Set a new text context for this attribute object.
      Parameters:
      poTextContext - - New text context to associate with this graphic text attribute object.
    • equivalent

      public boolean equivalent(GFXTextAttr oCompare)
      Equality comparison.

      Compares on an attribute value basis. Two attributes are considered equal if their values compare for equality.

      Parameters:
      oCompare - Attribute object to compare against.
      Returns:
      TRUE if all members are equal, FALSE otherwise.
    • equals

      public boolean equals(Object object)
      Equality comparison operator.

      Compares on an attribute value basis. Two attributes are considered equal if their values compare for equality.

      Overrides:
      equals in class GFXAttr
      Parameters:
      object - Attribute object to compare against.
      Returns:
      TRUE if the attribute objects are considered equal; FALSE otherwise.

      This implementation of Object.equals does not follow standard Java semantics.

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class GFXAttr
    • notEqual

      public boolean notEqual(Object oCompare)
      Non equality comparison operator.

      Compares on an attribute value basis. Two attributes are only considered equal if their values compare for equality.

      Parameters:
      oCompare - Attribute object to compare against.
      Returns:
      TRUE if the attribute objects are considered not equal; FALSE otherwise.
    • copyFrom

      public void copyFrom(GFXTextAttr oSource)
      Assigment operator.

      Replace all attribute settings with those from the source object.

      Parameters:
      oSource - Source attribute object to copy.
    • extractDecoration

      public static GFXDecorationInfo extractDecoration(int nDecoration)
      Extract text decoration into usable values.

      Given an underline, line-through or overline value, extract the two component values from it for further processing.

      Parameters:
      nDecoration - Input text decoration value.
      Returns:
      TRUE if there is any decoration; FALSE if no decoration.