Class GFXTextAttr


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

      • 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 Detail

      • 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​(java.lang.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.

      • notEqual

        public boolean notEqual​(java.lang.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.