Package com.adobe.xfa.gfx
Class GFXAttr
- java.lang.Object
-
- com.adobe.xfa.gfx.GFXAttr
-
- Direct Known Subclasses:
GFXFillAttr
,GFXLineAttr
,GFXTextAttr
public class GFXAttr extends java.lang.Object
The graphic attribute object is a base class for different display attributes and holds information about common attibute values such as background and foreground colour, shading, style etc.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_SHADESCALE
static int
STYLE_CROSS
static int
STYLE_DASH
static int
STYLE_DIAG_CROSS
static int
STYLE_DIAG_LEFT
static int
STYLE_DIAG_RIGHT
static int
STYLE_DOT
static int
STYLE_DOT_DASH
static int
STYLE_DOT_DOT_DASH
static int
STYLE_HORZ
static int
STYLE_NONE
static int
STYLE_SOLID
static int
STYLE_UNKNOWN
enumeration StyleCode: Specifies the style of the attributes.static int
STYLE_VERT
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GFXColour
colour()
Get the foreground colour for this attribute.void
colour(GFXColour oNewColour)
Set the foreground colour for this attribute.GFXColour
colourBg()
Get the background colour for this attribute.void
colourBg(GFXColour oNewColourBg)
Set the background colour for this attribute.void
copyFrom(GFXAttr oSource)
Replace all attributes with those from the source object.static int
defaultShadeScale()
Get the default upper bound for shadingboolean
equals(java.lang.Object object)
Equality comparison operator.boolean
equivalent(GFXAttr oCompare)
Equality comparison.GFXGraphicContext
graphicContext()
Return the graphic context associated with this graphic attribute object.void
graphicContext(GFXGraphicContext poGraphicContext)
Set a new graphic context for this attribute object.int
hashCode()
int
shade()
Get the shading value for this attribute.void
shade(int lNewShade)
Set the shading value for this attribute.GFXColour
shadeColour()
Get the shading colour.int
shadeScale()
Get the upper bound for shading.void
shadeScale(int lNewScale)
Set the upper bound for shading.int
style()
Get the style for this attributevoid
style(int nNewStyle)
Set the style for this attribute
-
-
-
Field Detail
-
STYLE_UNKNOWN
public static final int STYLE_UNKNOWN
enumeration StyleCode: Specifies the style of the attributes.STYLE_UNKNOWN to STYLE_DIAG_CROSS inclusive is valid for line, fill and text attributes. STYLE_DOT, STYLE_DASH, STYLE_DOT_DASH and STYLE_DOT_DOT_DASH are only valid style values for line attributes
- See Also:
- Constant Field Values
-
STYLE_NONE
public static final int STYLE_NONE
- See Also:
- Constant Field Values
-
STYLE_SOLID
public static final int STYLE_SOLID
- See Also:
- Constant Field Values
-
STYLE_HORZ
public static final int STYLE_HORZ
- See Also:
- Constant Field Values
-
STYLE_VERT
public static final int STYLE_VERT
- See Also:
- Constant Field Values
-
STYLE_CROSS
public static final int STYLE_CROSS
- See Also:
- Constant Field Values
-
STYLE_DIAG_LEFT
public static final int STYLE_DIAG_LEFT
- See Also:
- Constant Field Values
-
STYLE_DIAG_RIGHT
public static final int STYLE_DIAG_RIGHT
- See Also:
- Constant Field Values
-
STYLE_DIAG_CROSS
public static final int STYLE_DIAG_CROSS
- See Also:
- Constant Field Values
-
STYLE_DOT
public static final int STYLE_DOT
- See Also:
- Constant Field Values
-
STYLE_DASH
public static final int STYLE_DASH
- See Also:
- Constant Field Values
-
STYLE_DOT_DASH
public static final int STYLE_DOT_DASH
- See Also:
- Constant Field Values
-
STYLE_DOT_DOT_DASH
public static final int STYLE_DOT_DOT_DASH
- See Also:
- Constant Field Values
-
DEFAULT_SHADESCALE
public static final int DEFAULT_SHADESCALE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GFXAttr
public GFXAttr()
Default constructor.Populates the graphic attribute with the following settings:
Style = solid Shading scale = full shading Shade = solid Foreground colour = black Background colour = white
-
GFXAttr
public GFXAttr(GFXAttr oSource)
Copy consturctor.Copies all attribute values.
- Parameters:
oSource
- Source attribute object to copy
-
GFXAttr
public GFXAttr(int nNewStyle, int lNewShade, GFXColour oNewColour, GFXColour oNewColourBg)
Constructor.Creates an Attribute object with the settings as specified by the input values.
- Parameters:
nNewStyle
- Specifies the style of the attributelNewShade
- Specifies the shade of the attributeoNewColour
- Specifies the foreground colouroNewColourBg
- Specifies the background colour
-
-
Method Detail
-
colour
public GFXColour colour()
Get the foreground colour for this attribute.- Returns:
- The foreground colour as a
jfGfxColour
object
-
colour
public void colour(GFXColour oNewColour)
Set the foreground colour for this attribute.- Parameters:
oNewColour
- The new foreground colour as ajfGfxColour
object
-
colourBg
public GFXColour colourBg()
Get the background colour for this attribute.- Returns:
- The background colour as a
jfGfxColour
object
-
colourBg
public void colourBg(GFXColour oNewColourBg)
Set the background colour for this attribute.- Parameters:
oNewColourBg
- The new background colour as ajfGfxColour
object
-
shade
public int shade()
Get the shading value for this attribute. This is a value between 0 (invisible) to the value of ShadeScale (solid).- Returns:
- The shading value
-
shade
public void shade(int lNewShade)
Set the shading value for this attribute. This is a value between 0 (invisible) to the value of ShadeScale (solid).- Parameters:
lNewShade
- The new shading value
-
shadeScale
public int shadeScale()
Get the upper bound for shading.- Returns:
- The upper bound for shading.
-
shadeScale
public void shadeScale(int lNewScale)
Set the upper bound for shading.- Parameters:
lNewScale
- The new upper bound for shading.
-
shadeColour
public GFXColour shadeColour()
Get the shading colour.- Returns:
- The shading colour as a
jfGfxColour
object
-
defaultShadeScale
public static int defaultShadeScale()
Get the default upper bound for shading- Returns:
- The default upper bound for shading.
-
style
public int style()
Get the style for this attribute- Returns:
- The style as a StyleCode enumeration
-
style
public void style(int nNewStyle)
Set the style for this attribute- Parameters:
nNewStyle
- The new style as a StyleCode enumeration
-
graphicContext
public GFXGraphicContext graphicContext()
Return the graphic context associated with this graphic attribute object.- Returns:
- Pointer to the graphic context. A null pointer is returned if the context has never been set.
-
graphicContext
public void graphicContext(GFXGraphicContext poGraphicContext)
Set a new graphic context for this attribute object.- Parameters:
poGraphicContext
- - New graphic context to associate with this graphic attribute object.
-
equivalent
public boolean equivalent(GFXAttr 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 classjava.lang.Object
- Parameters:
object
- Attribute object to compare against.- Returns:
- TRUE if the attribute objects are considered equal; FALSE otherwise.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
copyFrom
public void copyFrom(GFXAttr oSource)
Replace all attributes with those from the source object.The standard assignment copies everything, including enabled and disabled status. Graphic source information is also copied.
- Parameters:
oSource
- Source attribute object to copy.
-
-