public class TextGfxAttr extends Object
The text graphic attribute object can represent any possible combination of graphic attributes that apply to text (e.g., foreground colour, underline). This object is conceptually similar to the graphic attribute object for text (GfxTextAttr), except that this object can represent a sparse set of attributes.
Each graphic attribute calue can be set or queried independently. Additionally, each attribute can be flagged as enabled or disabled. When enabled, the corresponding attribute value has meaning. When disabled, the value can be thought of as unknown or irrelevant.
This object has a large number of accessors, which appear in groups of four, one such group for each attribute. For example, consider the colour attribute. There are two overloads each of Colour() and ColourEnable(). In each overload pair, one sets the value and one retrieves it. In other words, one Colour() overload returns the current colour value and one sets it, and one ColourEnable() overload returns the enabled state and one sets it. Enabled flags are all Boolean, with TRUE indicating the value is enabled. Setting an attribute value in a TextGfxAttr object (e.g., by second Colour() overload) automatically enables it. Enabling a value (e.g., by second ColourEnable() overload) that has never been set usually sets it to a default value. In rare cases, the uninitialized value may be left disabled.
Constructor and Description |
---|
TextGfxAttr()
Default constructor.
|
TextGfxAttr(TextGfxAttr oSource)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
anyGfxEnable()
Query whether any graphic text attribute is enabled.
|
GFXColour |
colour()
Return the foreground colour value if enabled
|
void |
colour(GFXColour oNewColour)
Set and enable the foreground colour value
|
GFXColour |
colourBg()
Return the background colour value if enabled
|
void |
colourBg(GFXColour oNewColourBg)
Set and enable the background colour value
|
boolean |
colourBgEnable()
Query whether the background colour value is enabled
|
void |
colourBgEnable(boolean bNewEnable)
Enable/disable the background colour value
|
boolean |
colourEnable()
Query whether the foreground colour value is enabled
|
void |
colourEnable(boolean bNewEnable)
Enable/disable the foreground colour value
|
void |
copyFrom(TextGfxAttr oSource)
Replace all attributes with those from the source object.
|
boolean |
equals(Object object)
Equality comparison operator.
|
GFXTextAttr |
getGfxTextAttr()
Query the collected graphic text attributes
|
boolean |
gfxTextAttrEnable()
Query whether the graphic text attributes are complete
|
GFXGraphicContext |
graphicContext()
Return the graphic context associated with this text attribute
object.
|
void |
graphicContext(GFXGraphicContext poGraphicContext)
Set a new graphic context for this text attribute object.
|
boolean |
graphicContextEnable()
Query whether the graphic context attribute is enabled.
|
void |
graphicContextEnable(boolean bNewEnable)
Enable/disable graphic context for this text attribute object.
|
int |
hashCode() |
boolean |
notEqual(TextGfxAttr oCompare)
Inequality comparison operator.
|
int |
overline()
Return the overline value if enabled
|
void |
overline(int eNewOverline)
Set and enable the overline value
|
boolean |
overlineEnable()
Query whether the overline value is enabled
|
void |
overlineEnable(boolean bNewEnable)
Enable/disable the overline value
|
void |
setGfxTextAttrDefault(boolean bDefault)
Fill the text graphic attribute holder with default values.
|
int |
shade()
Return the shade level if enabled
|
void |
shade(int lNewShade)
Set and enable the shade level
|
boolean |
shadeEnable()
Query whether the shade level is enabled
|
void |
shadeEnable(boolean bNewEnable)
Enable/disable the shade level
|
int |
shadeScale()
Return the shade scale value if enabled
|
void |
shadeScale(int lNewShadeScale)
Set and enable the shade scale value
|
boolean |
shadeScaleEnable()
Query whether the shade scale value is enabled
|
void |
shadeScaleEnable(boolean bNewEnable)
Enable/disable the shade scale value
|
int |
strikeout()
Return the strikeout value if enabled
|
void |
strikeout(int eNewStrikeout)
Set and enable the strikeout value
|
boolean |
strikeoutEnable()
Query whether the strikeout value is enabled
|
void |
strikeoutEnable(boolean bNewEnable)
Enable/disable the strikeout value
|
int |
style()
Return the style value if enabled
|
void |
style(int eNewStyle)
Set and enable the style value
|
boolean |
styleEnable()
Query whether the style value is enabled
|
void |
styleEnable(boolean bNewEnable)
Enable/disable the style value
|
GFXTextContext |
textContext()
Return the graphic text context associated with this text attribute
object.
|
void |
textContext(GFXTextContext poTextContext)
Set a new graphic text context for this text attribute object.
|
boolean |
textContextEnable()
Query whether the graphic text context attribute is enabled.
|
void |
textContextEnable(boolean bNewEnable)
Enable/disable graphic text context for this text attribute object.
|
int |
underline()
Return the underline value if enabled
|
void |
underline(int eNewUnderline)
Set and enable the underline value
|
boolean |
underlineEnable()
Query whether the underline value is enabled
|
void |
underlineEnable(boolean bNewEnable)
Enable/disable the underline value
|
public TextGfxAttr()
Populates the text graphic attribute object with all attributes disabled.
public TextGfxAttr(TextGfxAttr oSource)
Copies all attributes and their enabled/disabled status.
oSource
- - Source attribute object to copy.public GFXTextAttr getGfxTextAttr()
public boolean gfxTextAttrEnable()
public boolean anyGfxEnable()
public int underline()
public void underline(int eNewUnderline)
eNewUnderline
- - New underline value.public boolean underlineEnable()
public void underlineEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the underline value is to be enabled;
FALSE if it is to be disabled.public int overline()
public void overline(int eNewOverline)
eNewOverline
- - New overline value.public boolean overlineEnable()
public void overlineEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the overline value is to be enabled;
FALSE if it is to be disabled.public int strikeout()
public void strikeout(int eNewStrikeout)
eNewStrikeout
- - New strikeout value.public boolean strikeoutEnable()
public void strikeoutEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the strikeout value is to be enabled;
FALSE if it is to be disabled.public GFXTextContext textContext()
public void textContext(GFXTextContext poTextContext)
poTextContext
- - Pointer to new graphic text context to
associate with this text attribute object.public boolean textContextEnable()
public void textContextEnable(boolean bNewEnable)
bNewEnable
- - True if the graphic text context is to be
enabled; false if it is to be disabled.public GFXGraphicContext graphicContext()
public void graphicContext(GFXGraphicContext poGraphicContext)
poGraphicContext
- - Pointer to new graphic context to associate
with this text attribute object.public boolean graphicContextEnable()
public void graphicContextEnable(boolean bNewEnable)
bNewEnable
- - True if the graphic context is to be enabled;
false if it is to be disabled.public GFXColour colour()
public void colour(GFXColour oNewColour)
oNewColour
- - New foreground colour value.public boolean colourEnable()
public void colourEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the colour value is to be enabled; FALSE
if it is to be disabled.public GFXColour colourBg()
public void colourBg(GFXColour oNewColourBg)
oNewColourBg
- - New background colour value.public boolean colourBgEnable()
public void colourBgEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the background colour value is to be
enabled; FALSE if it is to be disabled.public int style()
public void style(int eNewStyle)
eNewStyle
- - New style value.public boolean styleEnable()
public void styleEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the style value is to be enabled; FALSE
if it is to be disabled.public int shade()
public void shade(int lNewShade)
lNewShade
- - New shade level.public boolean shadeEnable()
public void shadeEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the shade level is to be enabled; FALSE
if it is to be disabled.public int shadeScale()
public void shadeScale(int lNewShadeScale)
lNewShadeScale
- - New shade scale value.public boolean shadeScaleEnable()
public void shadeScaleEnable(boolean bNewEnable)
bNewEnable
- - TRUE if the shade scale value is to be enabled;
FALSE if it is to be disabled.public void setGfxTextAttrDefault(boolean bDefault)
This method behaves like a Clear() or Reset() method might. It replaces all values in the text attribute object with defaults.
bDefault
- - FALSE if all attributes are to be disabled; TRUE if
they are to be enabled with default values.public void copyFrom(TextGfxAttr oSource)
The standard assignment copies everything, including enabled and disabled status.
oSource
- - Source attribute object to copy.public boolean equals(Object object)
Compares on an attribute by attribute basis. Two attributes are considered equal if they are both disabled, or they are both enabled and their values compare for equality.
public boolean notEqual(TextGfxAttr oCompare)
Compares on an attribute by attribute basis. Two attributes are considered unequal if their enabled/disabled settings don't match, or if they are both enabled and their values are unequal.
oCompare
- - Text attribute object to compare against.Copyright © 2010 - 2020 Adobe. All Rights Reserved