org.vectomatic.dom.svg
Class OMSVGPaint

java.lang.Object
  extended by org.vectomatic.dom.svg.OMCSSValue
      extended by org.vectomatic.dom.svg.OMSVGColor
          extended by org.vectomatic.dom.svg.OMSVGPaint

public class OMSVGPaint
extends OMSVGColor

The OMSVGPaint interface corresponds to basic type <paint> and represents the values of properties fill and stroke.

Note: The OMSVGPaint interface is deprecated, and may be dropped from future versions of the SVG specification.


Field Summary
static short SVG_PAINTTYPE_CURRENTCOLOR
          Corresponds to a currentColor value on a <paint> specification.
static short SVG_PAINTTYPE_NONE
          Corresponds to a none value on a <paint> specification.
static short SVG_PAINTTYPE_RGBCOLOR
          An sRGB color has been specified without an alterICC color specification.
static short SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR
          An sRGB color has been specified along with an alterICC color specification.
static short SVG_PAINTTYPE_UNKNOWN
          The paint type is not one of predefined types.
static short SVG_PAINTTYPE_URI
          Only a URI has been specified.
static short SVG_PAINTTYPE_URI_CURRENTCOLOR
          A URI has been specified, along with an sRGB color as the backup paint method in case the URI is unavailable or invalid.
static short SVG_PAINTTYPE_URI_NONE
          A URI has been specified, along with an explicit none as the backup paint method in case the URI is unavailable or invalid.
static short SVG_PAINTTYPE_URI_RGBCOLOR
          A URI has been specified, along with an sRGB color as the backup paint method in case the URI is unavailable or invalid.
static short SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR
          A URI has been specified, along with both an sRGB color and alternate ICC color as the backup paint method in case the URI is unavailable or invalid.
 
Fields inherited from class org.vectomatic.dom.svg.OMSVGColor
colorType, iccColor, rgbColor, SVG_COLORTYPE_CURRENTCOLOR, SVG_COLORTYPE_RGBCOLOR, SVG_COLORTYPE_RGBCOLOR_ICCCOLOR, SVG_COLORTYPE_UNKNOWN
 
Fields inherited from class org.vectomatic.dom.svg.OMCSSValue
CSS_CUSTOM, CSS_INHERIT, CSS_PRIMITIVE_VALUE, CSS_VALUE_LIST, cssText, cssValueType
 
Constructor Summary
OMSVGPaint(short paintType)
           
 
Method Summary
 boolean equals(Object obj)
           
 String getDescription()
           
 short getPaintType()
          The type of paint, identified by one of the SVG_PAINTTYPE_ constants defined on this interface.
 String getUri()
          When the getPaintType() specifies a URI, this attribute holds the URI string.
 int hashCode()
           
 void setPaint(short paintType, String uri, String rgbColor, String iccColor)
          Sets the paint as specified by the parameters.
 void setUri(String uri)
          Sets the getPaintType() to SVG_PAINTTYPE_URI_NONE and sets getUri() to the specified value.
 
Methods inherited from class org.vectomatic.dom.svg.OMSVGColor
getColorType, getIccColor, getRgbColor, setColor, setRGBColor, setRGBColorICCColor
 
Methods inherited from class org.vectomatic.dom.svg.OMCSSValue
getCssText, getCssValueType, setCssText, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SVG_PAINTTYPE_UNKNOWN

public static final short SVG_PAINTTYPE_UNKNOWN
The paint type is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.

See Also:
Constant Field Values

SVG_PAINTTYPE_RGBCOLOR

public static final short SVG_PAINTTYPE_RGBCOLOR
An sRGB color has been specified without an alterICC color specification.

See Also:
Constant Field Values

SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR

public static final short SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR
An sRGB color has been specified along with an alterICC color specification.

See Also:
Constant Field Values

SVG_PAINTTYPE_NONE

public static final short SVG_PAINTTYPE_NONE
Corresponds to a none value on a <paint> specification.

See Also:
Constant Field Values

SVG_PAINTTYPE_CURRENTCOLOR

public static final short SVG_PAINTTYPE_CURRENTCOLOR
Corresponds to a currentColor value on a <paint> specification.

See Also:
Constant Field Values

SVG_PAINTTYPE_URI_NONE

public static final short SVG_PAINTTYPE_URI_NONE
A URI has been specified, along with an explicit none as the backup paint method in case the URI is unavailable or invalid.

See Also:
Constant Field Values

SVG_PAINTTYPE_URI_CURRENTCOLOR

public static final short SVG_PAINTTYPE_URI_CURRENTCOLOR
A URI has been specified, along with an sRGB color as the backup paint method in case the URI is unavailable or invalid.

See Also:
Constant Field Values

SVG_PAINTTYPE_URI_RGBCOLOR

public static final short SVG_PAINTTYPE_URI_RGBCOLOR
A URI has been specified, along with an sRGB color as the backup paint method in case the URI is unavailable or invalid.

See Also:
Constant Field Values

SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR

public static final short SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR
A URI has been specified, along with both an sRGB color and alternate ICC color as the backup paint method in case the URI is unavailable or invalid.

See Also:
Constant Field Values

SVG_PAINTTYPE_URI

public static final short SVG_PAINTTYPE_URI
Only a URI has been specified.

See Also:
Constant Field Values
Constructor Detail

OMSVGPaint

public OMSVGPaint(short paintType)
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getPaintType

public final short getPaintType()
The type of paint, identified by one of the SVG_PAINTTYPE_ constants defined on this interface.


getUri

public final String getUri()
When the getPaintType() specifies a URI, this attribute holds the URI string. When the getPaintType() does not specify a URI, this attribute is null.


setUri

public final void setUri(String uri)
Sets the getPaintType() to SVG_PAINTTYPE_URI_NONE and sets getUri() to the specified value.

Parameters:
uri - The URI for the desired paint server.

setPaint

public final void setPaint(short paintType,
                           String uri,
                           String rgbColor,
                           String iccColor)
                    throws com.google.gwt.core.client.JavaScriptException
Sets the paint as specified by the parameters. If paintType requires a URI, then uri must be non-null; otherwise, uri must be null. If paintType requires an RGBColor, then rgbColor must be a string that matches <color>; otherwise, rgbColor must be null. If paintType requires an OMSVGICCColor, then iccColor must be a string that matches <icccolor>; otherwise, iccColor must be null.

Parameters:
paintType - One of the defined constants for getPaintType().
uri - The URI for the desired paint server, or null.
rgbColor - The specification of an sRGB color, or null.
iccColor - The specification of an ICC color, or null.
Throws:
SVGException(SVG_INVALID_VALUE_ERR) - Raised if one of the parameters has an invalid value.
com.google.gwt.core.client.JavaScriptException

getDescription

public String getDescription()
Specified by:
getDescription in class OMCSSValue


Copyright © 2012. All Rights Reserved.