Package org.w3c.dom.css

Examples of org.w3c.dom.css.CSSStyleDeclaration


        if(in1 == sourceGraphics) {
            defaultRegion = filterRegion;
        }

        CSSStyleDeclaration cssDecl
            = bridgeContext.getViewCSS().getComputedStyle(filterElement, null);

        UnitProcessor.Context uctx
            = new DefaultUnitProcessorContext(bridgeContext, cssDecl);
View Full Code Here


public abstract class SVGShapeElementBridge implements GraphicsNodeBridge,
                                                       SVGConstants {

    public GraphicsNode createGraphicsNode(BridgeContext ctx, Element element){
        SVGElement svgElement = (SVGElement) element;
        CSSStyleDeclaration cssDecl
            = ctx.getViewCSS().getComputedStyle(element, null);
        UnitProcessor.Context uctx
            = new DefaultUnitProcessorContext(ctx,
                                              cssDecl);
        ShapeNode node = ctx.getGVTFactory().createShapeNode();
View Full Code Here

    public void buildGraphicsNode(GraphicsNode gn, BridgeContext ctx,
                                  Element element) {
        ShapeNode node = (ShapeNode)gn;

        SVGElement svgElement = (SVGElement) element;
        CSSStyleDeclaration cssDecl
            = ctx.getViewCSS().getComputedStyle(element, null);
        UnitProcessor.Context uctx
            = new DefaultUnitProcessorContext(ctx,
                                              cssDecl);

        // Initialize the style properties
        ShapePainter painter
            = CSSUtilities.convertStrokeAndFill(svgElement, node,
                                                ctx, cssDecl, uctx);
        node.setShapePainter(painter);

        // Set node composite
        CSSPrimitiveValue opacityVal =
            (CSSPrimitiveValue)cssDecl.getPropertyCSSValue(ATTR_OPACITY);
        Composite composite =
            CSSUtilities.convertOpacityToComposite(opacityVal);
        node.setComposite(composite);

        // Set node filter
View Full Code Here

                                                ATTR_TRANSFORM,
                                                ctx.getParserFactory());

        gn.setTransform(at);

        CSSStyleDeclaration decl;
        decl = ctx.getViewCSS().getComputedStyle(element, null);
        UnitProcessor.Context uctx
            = new DefaultUnitProcessorContext(ctx, decl);

        Rectangle2D rect = CSSUtilities.convertEnableBackground((SVGElement)element,
View Full Code Here

        return gn;
    }

    public void buildGraphicsNode(GraphicsNode gn, BridgeContext ctx,
                                  Element element) {
        CSSStyleDeclaration decl;
        decl = ctx.getViewCSS().getComputedStyle(element, null);
        CSSPrimitiveValue val =
            (CSSPrimitiveValue)decl.getPropertyCSSValue(ATTR_OPACITY);
        Composite composite = CSSUtilities.convertOpacityToComposite(val);
        gn.setComposite(composite);

        Filter filter = CSSUtilities.convertFilter(element, gn, ctx);
        gn.setFilter(filter);
View Full Code Here

        //
        // feImage's default region is that of the filter chain.
        //
        Rectangle2D defaultRegion = filterRegion;

        CSSStyleDeclaration cssDecl
            = bridgeContext.getViewCSS().getComputedStyle(filterElement, null);

        UnitProcessor.Context uctx
            = new DefaultUnitProcessorContext(bridgeContext, cssDecl);
View Full Code Here

        if (in == sourceGraphics){
            defaultRegion = filterRegion;
        }

        CSSStyleDeclaration cssDecl
            = bridgeContext.getViewCSS().getComputedStyle(filterElement, null);

        UnitProcessor.Context uctx
            = new DefaultUnitProcessorContext(bridgeContext, cssDecl);
View Full Code Here

            SVGUtilities.convertAffineTransform(element,
                                                ATTR_TRANSFORM,
                                                ctx.getParserFactory());
        gn.setTransform(at);

        CSSStyleDeclaration decl;
        decl = ctx.getViewCSS().getComputedStyle(element, null);
        UnitProcessor.Context uctx
            = new DefaultUnitProcessorContext(ctx, decl);

        Rectangle2D rect = CSSUtilities.convertEnableBackground((SVGElement)element,
View Full Code Here

        return gn;
    }

    public void buildGraphicsNode(GraphicsNode node, BridgeContext ctx,
                                  Element element) {
        CSSStyleDeclaration decl;
        decl = ctx.getViewCSS().getComputedStyle(element, null);
        CSSPrimitiveValue val =
            (CSSPrimitiveValue)decl.getPropertyCSSValue(ATTR_OPACITY);
        Composite composite = CSSUtilities.convertOpacityToComposite(val);
        node.setComposite(composite);

        // Set the node filter
        Filter filter = CSSUtilities.convertFilter(element, node, ctx);
View Full Code Here

    public Clip createClip(BridgeContext ctx,
                            GraphicsNode gn,
                            Element clipElement,
                            Element clipedElement) {

        CSSStyleDeclaration decl
            = ctx.getViewCSS().getComputedStyle(clipElement, null);

        // Build the GVT tree that represents the clip path
        //
        // The silhouettes of the child elements are logically OR'd
        // together to create a single silhouette which is then used to
        // restrict the region onto which paint can be applied.
        //
        // The 'clipPath' element or any of its children can specify
        // property 'clip-path'.
        //
        Area clipPath = new Area();
        GVTBuilder builder = ctx.getGVTBuilder();
        GVTFactory gvtFactory = ctx.getGVTFactory();

        // parse the transform attribute
        AffineTransform Tx =
            SVGUtilities.convertAffineTransform(clipElement,
                                                ATTR_TRANSFORM,
                                                ctx.getParserFactory());

        // parse the clipPathUnits attribute
        Viewport oldViewport = ctx.getCurrentViewport();
        String units = clipElement.getAttributeNS(null, ATTR_CLIP_PATH_UNITS);
        if (units.length() == 0) {
            units = VALUE_USER_SPACE_ON_USE;
        }
        int unitsType;
        try {
            unitsType = SVGUtilities.parseCoordinateSystem(units);
        } catch (IllegalArgumentException ex) {
            throw new IllegalAttributeValueException(
                Messages.formatMessage("clipPath.units.invalid",
                                       new Object[] {units,
                                                     ATTR_CLIP_PATH_UNITS}));
        }
        if (unitsType == SVGUtilities.OBJECT_BOUNDING_BOX) {
            // units are resolved using objectBoundingBox
            ctx.setCurrentViewport(new ObjectBoundingBoxViewport());
        }
        // compute an additional transform related the clipPathUnits
        Tx = SVGUtilities.convertAffineTransform(Tx, gn, unitsType);

        // build the clipPath according to the clipPath's children
        boolean hasChildren = false;
        for(Node node=clipElement.getFirstChild();
                node != null;
                node = node.getNextSibling()){

            // check if the node is a valid Element
            if (node.getNodeType() != node.ELEMENT_NODE) {
                continue;
            }
            Element child = (Element)node;
            GraphicsNode clipNode = builder.build(ctx, child) ;
            // check if a GVT node has been created
            if (clipNode == null) {
                throw new IllegalAttributeValueException(
                    Messages.formatMessage("clipPath.subelement.illegal",
                                        new Object[] {node.getLocalName()}));
            }
            hasChildren = true;
            // compute the outline of the current Element
            CSSStyleDeclaration c =
                ctx.getViewCSS().getComputedStyle(child, null);
            CSSPrimitiveValue v = (CSSPrimitiveValue)c.getPropertyCSSValue
                (CSS_CLIP_RULE_PROPERTY);
            int wr = (CSSUtilities.rule(v) == CSSUtilities.RULE_NONZERO)
                ? GeneralPath.WIND_NON_ZERO
                : GeneralPath.WIND_EVEN_ODD;
            GeneralPath path = new GeneralPath(clipNode.getOutline());
View Full Code Here

TOP

Related Classes of org.w3c.dom.css.CSSStyleDeclaration

Copyright © 2018 www.massapicom. 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.