Package org.w3c.dom.css

Examples of org.w3c.dom.css.CSSStyleDeclaration


    /**
     * Updates a property value in this target.
     */
    public void updatePropertyValue(String pn, AnimatableValue val) {
        CSSStyleDeclaration over = getOverrideStyle();
        if (val == null) {
            over.removeProperty(pn);
        } else {
            over.setProperty(pn, val.getCssText(), "");
        }
    }
View Full Code Here


                    source = (Filter)filterMap.get(SVG_SOURCE_GRAPHIC_VALUE);
                    source = new FilterAlphaRable(source);
                }
            } else if (SVG_STROKE_PAINT_VALUE.equals(s)) {
                    // StrokePaint
                    CSSStyleDeclaration cssDecl
                        = CSSUtilities.getComputedStyle(filteredElement);
                    Paint paint = PaintServer.convertStrokePaint
                        (filteredElement,filteredNode, ctx);
                    // <!> FIXME: Should we create a transparent flood ???
                    source = new FloodRable8Bit(INFINITE_FILTER_REGION, paint);
            }
            break;
        case 15:
            if (s.charAt(10) == SVG_BACKGROUND_IMAGE_VALUE.charAt(10)) {
                if (SVG_BACKGROUND_IMAGE_VALUE.equals(s)) {
                    // BackgroundImage
                    source = new BackgroundRable8Bit
                        (filteredNode, ctx.getGraphicsNodeRenderContext());
                }
            } else if (SVG_BACKGROUND_ALPHA_VALUE.equals(s)) {
                // BackgroundAlpha
                source = new BackgroundRable8Bit
                    (filteredNode, ctx.getGraphicsNodeRenderContext());
                source = new FilterAlphaRable(source);
            }
            break;
        case 9:
            if (SVG_FILL_PAINT_VALUE.equals(s)) {
                // FillPaint
                CSSStyleDeclaration cssDecl
                    = CSSUtilities.getComputedStyle(filteredElement);
                Paint paint = PaintServer.convertFillPaint
                    (filteredElement,filteredNode, ctx);
                if (paint == null) {
                    paint = new Color(0, 0, 0, 0); // create a transparent flood
View Full Code Here

                                                     SVGDocument imgDocument) {

        // viewport is automatically created by the svg element of the image
        SVGSVGElement svgElement = imgDocument.getRootElement();
        CompositeGraphicsNode result = new CompositeGraphicsNode();
        CSSStyleDeclaration decl = CSSUtilities.getComputedStyle(element);
        UnitProcessor.Context uctx = UnitProcessor.createContext(ctx, element);

        Rectangle2D r
            = CSSUtilities.convertEnableBackground(element, uctx);
        if (r != null) {
View Full Code Here

     * @param ctx the bridge context
     */
    protected static ICCColorSpaceExt extractColorSpace(Element element,
                                                        BridgeContext ctx) {

        CSSStyleDeclaration decl = CSSUtilities.getComputedStyle(element);
        String colorProfileProperty
            = ((CSSPrimitiveValue)decl.getPropertyCSSValue
               (CSS_COLOR_PROFILE_PROPERTY)).getStringValue();

        // The only cases that need special handling are 'sRGB' and 'name'
        ICCColorSpaceExt colorSpace = null;
        if (CSS_SRGB_VALUE.equalsIgnoreCase(colorProfileProperty)) {
View Full Code Here

    /**
     * <b>DOM</b>: Implements {@link org.w3c.dom.svg.SVGStylable#getStyle()}.
     */
    public CSSStyleDeclaration getStyle() {
        CSSStyleDeclaration result =
            (CSSStyleDeclaration)getLiveAttributeValue(null,
                                                       SVG_STYLE_ATTRIBUTE);
        if (result == null) {
            CSSEngine eng = ((SVGOMDocument)getOwnerDocument()).getCSSEngine();
            result = new StyleDeclaration(eng);
View Full Code Here

      addMatchingRules(userAgentStyleSheet.getCssRules(), e, pe,
                             uaRules);
      uaRules = sortRules(uaRules, e, pe);
      for (int i = 0; i < uaRules.getLength(); i++) {
    CSSStyleRule rule = (CSSStyleRule)uaRules.item(i);
    CSSStyleDeclaration decl = rule.getStyle();
    int len = decl.getLength();
    for (int j = 0; j < len; j++) {
        setUserAgentProperty(decl.item(j), decl, rd);
    }
      }
  }
    }
View Full Code Here

  if (userStyleSheet != null) {
      addMatchingRules(userStyleSheet.getCssRules(), e, pe, uaRules);
      uaRules = sortRules(uaRules, e, pe);
      for (int i = 0; i < uaRules.getLength(); i++) {
    CSSStyleRule rule = (CSSStyleRule)uaRules.item(i);
    CSSStyleDeclaration decl = rule.getStyle();
    int len = decl.getLength();
    for (int j = 0; j < len; j++) {
        setUserProperty(decl.item(j), decl, rd);
    }
      }
  }
    }
View Full Code Here

        (Element e, String pe, CSSOMReadOnlyStyleDeclaration rd) {
  if ((pe == null || pe.equals("")) &&
      e instanceof ElementNonCSSPresentationalHints) {
      ElementNonCSSPresentationalHints elt;
      elt = (ElementNonCSSPresentationalHints)e;
      CSSStyleDeclaration nonCSSDecl;
            nonCSSDecl = elt.getNonCSSPresentationalHints();
      if (nonCSSDecl != null) {
    int len = nonCSSDecl.getLength();
    for (int i = 0; i < len; i++) {
        setAuthorProperty(nonCSSDecl.item(i), nonCSSDecl, rd);
    }
      }
  }
    }
View Full Code Here

                                 authorRules);
            }
            authorRules = sortRules(authorRules, e, pe);
            for (int i = 0; i < authorRules.getLength(); i++) {
                CSSStyleRule rule = (CSSStyleRule)authorRules.item(i);
                CSSStyleDeclaration decl = rule.getStyle();
                int len = decl.getLength();
                for (int j = 0; j < len; j++) {
                    setAuthorProperty(decl.item(j), decl, rd);
                }
            }
  } catch (DOMException ex) {
            throw CSSDOMExceptionFactory.createDOMException
                (ex.code, "style.sheet",
View Full Code Here

                if (pe == null || pe.equals("") ||
                    e instanceof ExtendedElementCSSInlineStyle) {
                    hasStyle = ((ExtendedElementCSSInlineStyle)e).hasStyle();
                }
                if (hasStyle) {
                    CSSStyleDeclaration inlineDecl;
                    inlineDecl = ((ElementCSSInlineStyle)e).getStyle();
                    int len = inlineDecl.getLength();
                    for (int i = 0; i < len; i++) {
                        setAuthorProperty(inlineDecl.item(i), inlineDecl, rd);
                    }
                }
            }
  } catch (DOMException ex) {
            throw CSSDOMExceptionFactory.createDOMException
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.