Examples of FSRGBColor


Examples of org.xhtmlrenderer.css.parser.FSRGBColor

            //when background color is set, need to use the BasicButtonUI, certainly when using XP l&f
            BasicButtonUI ui = new BasicButtonUI();
            button.setUI(ui);

            if (backgroundColor instanceof FSRGBColor) {
                FSRGBColor rgb = (FSRGBColor)backgroundColor;
                button.setBackground(new Color(rgb.getRed(), rgb.getGreen(), rgb.getBlue()));
            }

            if (disableOSBorder)
                button.setBorder(new BasicBorders.MarginBorder());
            else
View Full Code Here

Examples of org.xhtmlrenderer.css.parser.FSRGBColor

    }

    private static Color toColor(FSColor color)
    {
        if (color instanceof FSRGBColor) {
            FSRGBColor rgb = (FSRGBColor)color;
            return new Color(rgb.getRed(), rgb.getGreen(), rgb.getBlue());
        }
        throw new RuntimeException("internal error: unsupported color class " + color.getClass().getName());
    }
View Full Code Here

Examples of org.xhtmlrenderer.css.parser.FSRGBColor

            checkInheritAllowed(value, false);
           
            boolean processingBackgroundPosition = false;
            short type = value.getPrimitiveType();
            if (type == CSSPrimitiveValue.CSS_IDENT) {
                FSRGBColor color = Conversions.getColor(value.getStringValue());
                if (color != null) {
                    if (backgroundColor != null) {
                        throw new CSSParseException("A background-color value cannot be set twice", -1);
                    }
                   
View Full Code Here

Examples of org.xhtmlrenderer.css.parser.FSRGBColor

            }
           
            if (type == CSSPrimitiveValue.CSS_RGBCOLOR) {
                return value;
            } else {
                FSRGBColor color = Conversions.getColor(value.getStringValue());
                if (color != null) {
                    return new PropertyValue(color);
                }
               
                IdentValue ident = IdentValue.valueOf(value.getCssText());
View Full Code Here

Examples of org.xhtmlrenderer.css.parser.FSRGBColor

            style.setDefaultValue(CSSName.FONT_SIZE, new LengthValue(style, CSSName.FONT_SIZE,
                    new PropertyValue(CSSPrimitiveValue.CSS_PX, getFont().getSize(), Integer
                            .toString(getFont().getSize()))));
            Color c = getForeground();
            style.setDefaultValue(CSSName.COLOR, new ColorValue(CSSName.COLOR,
                    new PropertyValue(new FSRGBColor(c.getRed(), c.getGreen(), c.getBlue()))));

            if (getFont().isBold()) {
                style.setDefaultValue(CSSName.FONT_WEIGHT, IdentValue.BOLD);
            }
View Full Code Here

Examples of org.xhtmlrenderer.css.parser.FSRGBColor

        }
    }
   
    public void setColor(FSColor color) {
        if (color instanceof FSRGBColor) {
            FSRGBColor rgb = (FSRGBColor)color;
            _graphics.setColor(new Color(rgb.getRed(), rgb.getGreen(), rgb.getBlue()));
        } else {
            throw new RuntimeException("internal error: unsupported color class " + color.getClass().getName());
        }
    }
View Full Code Here

Examples of org.xhtmlrenderer.css.parser.FSRGBColor

            checkInheritAllowed(value, inheritAllowed);
            if (value.getCssValueType() != CSSPrimitiveValue.CSS_INHERIT) {
                checkIdentOrColorType(cssName, value);

                if (value.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) {
                    FSRGBColor color = Conversions.getColor(value.getStringValue());
                    if (color != null) {
                        return Collections.singletonList(
                                new PropertyDeclaration(
                                        cssName,
                                        new PropertyValue(color),
View Full Code Here

Examples of org.xhtmlrenderer.css.parser.FSRGBColor

        });
    }

    private static Color createFromAWT(Device device, FSColor fsColor) {
        if (fsColor instanceof FSRGBColor) {
            FSRGBColor fsrgbcolor = ((FSRGBColor) fsColor);

            return new Color(device, fsrgbcolor.getRed(), fsrgbcolor.getGreen(),
                    fsrgbcolor.getBlue());
        } else {
            throw new IllegalArgumentException("Don't currently support CMYK in SWT rendering");
        }
    }
View Full Code Here

Examples of org.xhtmlrenderer.css.parser.FSRGBColor

    private void drawFontMetrics(RenderingContext c, InlineText inlineText) {
        InlineLayoutBox iB = inlineText.getParent();
        String text = inlineText.getSubstring();

        setColor(new FSRGBColor(0xFF, 0x33, 0xFF));

        FSFontMetrics fm = iB.getStyle().getFSFontMetrics(null);
        int width = c.getTextRenderer().getWidth(
                c.getFontContext(),
                iB.getStyle().getFSFont(c), text);
View Full Code Here

Examples of org.xhtmlrenderer.css.parser.FSRGBColor

   
    protected void setStrokeColor(PdfTemplate template, FSColor color)
    {
        if (color instanceof FSRGBColor)
        {
            FSRGBColor rgb = (FSRGBColor)color;
            template.setRGBColorStroke(rgb.getRed(), rgb.getGreen(), rgb.getBlue());
        }
        else if (color instanceof FSCMYKColor)
        {
            FSCMYKColor cmyk = (FSCMYKColor)color;
            template.setCMYKColorStroke(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.