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.ObjectThe 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 intDEFAULT_SHADESCALEstatic intSTYLE_CROSSstatic intSTYLE_DASHstatic intSTYLE_DIAG_CROSSstatic intSTYLE_DIAG_LEFTstatic intSTYLE_DIAG_RIGHTstatic intSTYLE_DOTstatic intSTYLE_DOT_DASHstatic intSTYLE_DOT_DOT_DASHstatic intSTYLE_HORZstatic intSTYLE_NONEstatic intSTYLE_SOLIDstatic intSTYLE_UNKNOWNenumeration StyleCode: Specifies the style of the attributes.static intSTYLE_VERT
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GFXColourcolour()Get the foreground colour for this attribute.voidcolour(GFXColour oNewColour)Set the foreground colour for this attribute.GFXColourcolourBg()Get the background colour for this attribute.voidcolourBg(GFXColour oNewColourBg)Set the background colour for this attribute.voidcopyFrom(GFXAttr oSource)Replace all attributes with those from the source object.static intdefaultShadeScale()Get the default upper bound for shadingbooleanequals(java.lang.Object object)Equality comparison operator.booleanequivalent(GFXAttr oCompare)Equality comparison.GFXGraphicContextgraphicContext()Return the graphic context associated with this graphic attribute object.voidgraphicContext(GFXGraphicContext poGraphicContext)Set a new graphic context for this attribute object.inthashCode()intshade()Get the shading value for this attribute.voidshade(int lNewShade)Set the shading value for this attribute.GFXColourshadeColour()Get the shading colour.intshadeScale()Get the upper bound for shading.voidshadeScale(int lNewScale)Set the upper bound for shading.intstyle()Get the style for this attributevoidstyle(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
jfGfxColourobject
-
colour
public void colour(GFXColour oNewColour)
Set the foreground colour for this attribute.- Parameters:
oNewColour- The new foreground colour as ajfGfxColourobject
-
colourBg
public GFXColour colourBg()
Get the background colour for this attribute.- Returns:
- The background colour as a
jfGfxColourobject
-
colourBg
public void colourBg(GFXColour oNewColourBg)
Set the background colour for this attribute.- Parameters:
oNewColourBg- The new background colour as ajfGfxColourobject
-
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
jfGfxColourobject
-
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:
equalsin 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:
hashCodein 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.
-
-