Java 类org.w3c.dom.css.RGBColor 实例源码

项目:VISNode    文件:StylerValueConverter.java   
/**
 * Converts a value to a color
 * 
 * @param value
 * @return Color
 */
public static Color color(CSSValue value) {
    RGBColor rgbColorValue = ((CSSPrimitiveValue)value).getRGBColorValue();
    int r = (int)rgbColorValue.getRed().getFloatValue(CSSPrimitiveValue.CSS_NUMBER);
    int g = (int)rgbColorValue.getGreen().getFloatValue(CSSPrimitiveValue.CSS_NUMBER);
    int b = (int)rgbColorValue.getBlue().getFloatValue(CSSPrimitiveValue.CSS_NUMBER);
    return new Color(r, g, b);
}
项目:tm4e    文件:CSSDocumentHandler.java   
private RGB createRGB(LexicalUnit value) {
    RGBColor rgbColor = new RGBColorImpl(value);
    int green = ((int) rgbColor.getGreen().getFloatValue(CSSPrimitiveValue.CSS_NUMBER));
    int red = ((int) rgbColor.getRed().getFloatValue(CSSPrimitiveValue.CSS_NUMBER));
    int blue = ((int) rgbColor.getBlue().getFloatValue(CSSPrimitiveValue.CSS_NUMBER));
    return new RGB(red, green, blue);
}
项目:PDFReporter-Studio    文件:SVGUtils.java   
public static Color toSWTColor(Element element, String attributeName) {
    Document document = element.getOwnerDocument();
    ViewCSS viewCSS = (ViewCSS) document.getDocumentElement();
    CSSStyleDeclaration computedStyle = viewCSS.getComputedStyle(element, null);
    SVGPaint svgPaint = (SVGPaint) computedStyle.getPropertyCSSValue(attributeName);
    if (svgPaint.getPaintType() == SVGPaint.SVG_PAINTTYPE_RGBCOLOR) {
        RGBColor rgb = svgPaint.getRGBColor();
        float red = rgb.getRed().getFloatValue(CSSValue.CSS_PRIMITIVE_VALUE);
        float green = rgb.getGreen().getFloatValue(CSSValue.CSS_PRIMITIVE_VALUE);
        float blue = rgb.getBlue().getFloatValue(CSSValue.CSS_PRIMITIVE_VALUE);
        return SWTResourceManager.getColor((int) red, (int) green, (int) blue);
    }
    return null;
}
项目:LoboEvolution    文件:CSSValueImpl.java   
@Override
public RGBColor getRGBColorValue() throws DOMException {
    if (value_ instanceof RGBColor) {
        return (RGBColor) value_;
    }

    throw new DOMExceptionImpl(DOMException.INVALID_ACCESS_ERR, DOMExceptionImpl.RGBCOLOR_ERROR);
}
项目:birt    文件:AbstractColorManager.java   
/**
 * Implements {@link
 * ValueManager#computeValue(CSSStylableElement,String,CSSEngine,int,StyleMap,Value)}.
 */
public Value computeValue( CSSStylableElement elt, CSSEngine engine,
        int idx, Value value )
{
    if ( value.getCssValueType( ) == CSSValue.CSS_PRIMITIVE_VALUE )
    {
        CSSPrimitiveValue pvalue = (CSSPrimitiveValue) value;
        int primitiveType = pvalue.getPrimitiveType( );
        if ( primitiveType == CSSPrimitiveValue.CSS_IDENT )
        {
            String ident = pvalue.getStringValue( );
            // Search for a direct computed value.
            Value v = (Value) computedValues.get( ident );
            if ( v != null )
            {
                return v;
            }
            // Must be a system color...
            if ( values.get( ident ) == null )
            {
                throw new InternalError( );
            }
            return (Value) engine.getCSSContext( ).getSystemColor( ident );
        }
        if ( primitiveType == CSSPrimitiveValue.CSS_RGBCOLOR )
        {
            RGBColor color = value.getRGBColorValue( );
            CSSPrimitiveValue red = color.getRed( );
            CSSPrimitiveValue green = color.getGreen( );
            CSSPrimitiveValue blue = color.getBlue( );

            return createRGBColor( createColorComponent( red ),
                    createColorComponent( green ),
                    createColorComponent( blue ) );
        }
    }
    return super.computeValue( elt, engine, idx, value );
}
项目:tm4e    文件:RGBColorImpl.java   
public RGBColor getRGBColorValue() throws DOMException {
    return this;
}
项目:tm4e    文件:CSSValueImpl.java   
public RGBColor getRGBColorValue() throws DOMException {
    throw new DOMException(DOMException.INVALID_ACCESS_ERR, "RGBCOLOR_ERROR");
}
项目:icetone    文件:CssUtil.java   
public static ColorRGBA toColor(RGBColor rgb) {
    return new ColorRGBA(rgb.getRed().getPrimitiveType() / 255f, rgb.getGreen().getPrimitiveType() / 255f,
            rgb.getBlue().getPrimitiveType() / 255f, 1f);
}
项目:birt    文件:RGBColorValue.java   
public RGBColor getRGBColorValue( ) throws DOMException
{
    return this;
}
项目:birt    文件:Value.java   
public RGBColor getRGBColorValue( ) throws DOMException
{
    throw createDOMException( );
}
项目:birt    文件:CSSValue.java   
public RGBColor getRGBColorValue( ) throws DOMException
{
    return null;
}
项目:Push2Display    文件:CSSOMValue.java   
/**
 * <b>DOM</b>: Implements {@link
 * org.w3c.dom.css.CSSPrimitiveValue#getRGBColorValue()}.
 */
public RGBColor getRGBColorValue() throws DOMException {
    return this;
}
项目:Push2Display    文件:CSSOMValue.java   
/**
 * <b>DOM</b>: Implements {@link
 * org.w3c.dom.css.CSSPrimitiveValue#getRGBColorValue()}.
 */
public RGBColor getRGBColorValue() throws DOMException {
    throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");
}
项目:Push2Display    文件:CSSOMSVGColor.java   
/**
 * <b>DOM</b>: Implements {@link
 * org.w3c.dom.svg.SVGColor#getRGBColor()}.
 */
public RGBColor getRGBColor() {
    return this;
}
项目:Push2Display    文件:CSSOMSVGColor.java   
/**
 * Returns the RGBColor value for this SVGColor.
 * For the SVG 1.1 ECMAScript binding.
 */
public RGBColor getRgbColor() {
    return this;
}
项目:Push2Display    文件:CSSOMSVGColor.java   
/**
 * <b>DOM</b>: Implements {@link
 * org.w3c.dom.css.CSSPrimitiveValue#getRGBColorValue()}.
 */
public RGBColor getRGBColorValue() throws DOMException {
    throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");
}
项目:Push2Display    文件:CSSOMValue.java   
/**
 * <b>DOM</b>: Implements {@link
 * org.w3c.dom.css.CSSPrimitiveValue#getRGBColorValue()}.
 */
public RGBColor getRGBColorValue() throws DOMException {
    return this;
}
项目:Push2Display    文件:CSSOMValue.java   
/**
 * <b>DOM</b>: Implements {@link
 * org.w3c.dom.css.CSSPrimitiveValue#getRGBColorValue()}.
 */
public RGBColor getRGBColorValue() throws DOMException {
    throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");
}
项目:Push2Display    文件:CSSOMSVGColor.java   
/**
 * <b>DOM</b>: Implements {@link
 * org.w3c.dom.svg.SVGColor#getRGBColor()}.
 */
public RGBColor getRGBColor() {
    return this;
}
项目:Push2Display    文件:CSSOMSVGColor.java   
/**
 * Returns the RGBColor value for this SVGColor.
 * For the SVG 1.1 ECMAScript binding.
 */
public RGBColor getRgbColor() {
    return this;
}
项目:Push2Display    文件:CSSOMSVGColor.java   
/**
 * <b>DOM</b>: Implements {@link
 * org.w3c.dom.css.CSSPrimitiveValue#getRGBColorValue()}.
 */
public RGBColor getRGBColorValue() throws DOMException {
    throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");
}
项目:feathers-sdk    文件:CSSOMValue.java   
/**
 * <b>DOM</b>: Implements {@link
 * org.w3c.dom.css.CSSPrimitiveValue#getRGBColorValue()}.
 */
public RGBColor getRGBColorValue() throws DOMException {
    return this;
}
项目:feathers-sdk    文件:CSSOMValue.java   
/**
 * <b>DOM</b>: Implements {@link
 * org.w3c.dom.css.CSSPrimitiveValue#getRGBColorValue()}.
 */
public RGBColor getRGBColorValue() throws DOMException {
    throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");
}
项目:feathers-sdk    文件:CSSOMSVGColor.java   
/**
 * <b>DOM</b>: Implements {@link
 * org.w3c.dom.svg.SVGColor#getRGBColor()}.
 */
public RGBColor getRGBColor() {
    return this;
}
项目:feathers-sdk    文件:CSSOMSVGColor.java   
/**
 * Returns the RGBColor value for this SVGColor.
 * For the SVG 1.1 ECMAScript binding.
 */
public RGBColor getRgbColor() {
    return this;
}
项目:feathers-sdk    文件:CSSOMSVGColor.java   
/**
 * <b>DOM</b>: Implements {@link
 * org.w3c.dom.css.CSSPrimitiveValue#getRGBColorValue()}.
 */
public RGBColor getRGBColorValue() throws DOMException {
    throw new DOMException(DOMException.INVALID_ACCESS_ERR, "");
}
项目:LoboEvolution    文件:SVGColor.java   
public RGBColor getRGBColor();