org.vectomatic.dom.svg
Class OMSVGColor

java.lang.Object
  extended by org.vectomatic.dom.svg.OMCSSValue
      extended by org.vectomatic.dom.svg.OMSVGColor
Direct Known Subclasses:
OMSVGPaint

public abstract class OMSVGColor
extends OMCSSValue

The OMSVGColor interface corresponds to color value definition for properties stop-color, flood-color and lighting-color and is a base class for interface OMSVGPaint. It incorporates SVG's extended notion of color, which incorporates ICC-based color specifications.

Interface OMSVGColor does not correspond to the <color> basic data type. For the <color> basic data type, the applicable DOM interfaces are defined in DOM Level 2 Style; in particular, see the RGBColor interface ([DOM2STYLE], section 2.2).

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


Field Summary
protected  short colorType
           
protected  OMSVGICCColor iccColor
           
protected  OMRGBColor rgbColor
           
static short SVG_COLORTYPE_CURRENTCOLOR
          Corresponds to when keyword currentColor has been specified.
static short SVG_COLORTYPE_RGBCOLOR
          An sRGB color has been specified without an alterICC color specification.
static short SVG_COLORTYPE_RGBCOLOR_ICCCOLOR
          An sRGB color has been specified along with an alterICC color specification.
static short SVG_COLORTYPE_UNKNOWN
          The color type is not one of predefined types.
 
Fields inherited from class org.vectomatic.dom.svg.OMCSSValue
CSS_CUSTOM, CSS_INHERIT, CSS_PRIMITIVE_VALUE, CSS_VALUE_LIST, cssText, cssValueType
 
Constructor Summary
protected OMSVGColor()
           
 
Method Summary
 short getColorType()
          The type of the value as specified by one of the SVG_COLORTYPE_ constants defined on this interface.
 OMSVGICCColor getIccColor()
          The alternate ICC color specification.
 OMRGBColor getRgbColor()
          The color specified in the sRGB color space.
 void setColor(short colorType, String rgbColor, String iccColor)
          Sets the color value as specified by the parameters.
 void setRGBColor(String rgbColor)
          Modifies the color value to be the specified sRGB color without an alternate ICC color specification.
 void setRGBColorICCColor(String rgbColor, String iccColor)
          Modifies the color value to be the specified sRGB color with an alternate ICC color specification.
 
Methods inherited from class org.vectomatic.dom.svg.OMCSSValue
getCssText, getCssValueType, getDescription, setCssText, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SVG_COLORTYPE_UNKNOWN

public static final short SVG_COLORTYPE_UNKNOWN
The color 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_COLORTYPE_RGBCOLOR

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

See Also:
Constant Field Values

SVG_COLORTYPE_RGBCOLOR_ICCCOLOR

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

See Also:
Constant Field Values

SVG_COLORTYPE_CURRENTCOLOR

public static final short SVG_COLORTYPE_CURRENTCOLOR
Corresponds to when keyword currentColor has been specified.

See Also:
Constant Field Values

colorType

protected short colorType

rgbColor

protected OMRGBColor rgbColor

iccColor

protected OMSVGICCColor iccColor
Constructor Detail

OMSVGColor

protected OMSVGColor()
Method Detail

getColorType

public final short getColorType()
The type of the value as specified by one of the SVG_COLORTYPE_ constants defined on this interface.


getRgbColor

public final OMRGBColor getRgbColor()
The color specified in the sRGB color space.


getIccColor

public final OMSVGICCColor getIccColor()
The alternate ICC color specification.


setRGBColor

public final void setRGBColor(String rgbColor)
                       throws com.google.gwt.core.client.JavaScriptException
Modifies the color value to be the specified sRGB color without an alternate ICC color specification.

Parameters:
rgbColor - A string that matches <color>, which specifies the new sRGB color value.
Throws:
SVGException(SVG_INVALID_VALUE_ERR) - Raised if rgbColor does not match <color>.
com.google.gwt.core.client.JavaScriptException

setRGBColorICCColor

public final void setRGBColorICCColor(String rgbColor,
                                      String iccColor)
                               throws com.google.gwt.core.client.JavaScriptException
Modifies the color value to be the specified sRGB color with an alternate ICC color specification.

Parameters:
rgbColor - A string that matches <color>, which specifies the new sRGB color value.
iccColor - A string that matches <icccolor>, which specifies the alternate ICC color specification.
Throws:
SVGException(SVG_INVALID_VALUE_ERR) - Raised if rgbColor does not match <color> or if iccColor does not match <icccolor>.
com.google.gwt.core.client.JavaScriptException

setColor

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

Parameters:
colorType - One of the defined constants for getColorType().
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


Copyright © 2012. All Rights Reserved.