Package org.w3c.dom.css

Examples of org.w3c.dom.css.CSSStyleDeclaration


    protected static GraphicsNode createSVGImageNode(BridgeContext ctx,
                                                     Element e,
                                                     SVGDocument imgDocument) {

        CompositeGraphicsNode result = new CompositeGraphicsNode();
        CSSStyleDeclaration decl = CSSUtilities.getComputedStyle(e);
        UnitProcessor.Context uctx = UnitProcessor.createContext(ctx, e);

        Rectangle2D r
            = CSSUtilities.convertEnableBackground(e, 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

                     new Object [] {SVG_ORIENT_ATTRIBUTE, s});
            }
        }

        // 'stroke-width' property
        CSSStyleDeclaration decl
            = CSSUtilities.getComputedStyle(paintedElement);
        CSSValue v = decl.getPropertyCSSValue(CSS_STROKE_WIDTH_PROPERTY);
        float strokeWidth = UnitProcessor.cssOtherLengthToUserSpace
            (v, CSS_STROKE_WIDTH_PROPERTY, uctx);

        // 'markerUnits' attribute - default is 'strokeWidth'
        short unitsType;
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);
                }
            } else if (SVG_BACKGROUND_ALPHA_VALUE.equals(s)) {
                // BackgroundAlpha
                source = new BackgroundRable8Bit(filteredNode);
                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

    /**
     * <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

    public abstract void visitUnknownRule(CSSUnknownRule rule);

    public void visitStyleRule(CSSStyleRule rule) {
        startStyleRule(rule);
        CSSStyleDeclaration style = rule.getStyle();
        visitStyleDeclaration(style);
        endStyleRule(rule);
    }
View Full Code Here

    protected abstract void endMediaRule(CSSMediaRule rule);

    public void visitFontFaceRule(CSSFontFaceRule rule) {
        startFontRule(rule);
        CSSStyleDeclaration style = rule.getStyle();
        visitStyleDeclaration(style);
        endFontRule(rule);
    }
View Full Code Here

    protected abstract void endFontRule(CSSFontFaceRule rule);

    public void visitPageRule(CSSPageRule rule) {
        startPageRule(rule);
        CSSStyleDeclaration style = rule.getStyle();
        visitStyleDeclaration(style);
        endPageRule(rule);
    }
View Full Code Here

   * @return the inline style property
   */
  public static String getInlineStyleProperty(Element original,
      String cssProperty) {
    if (original instanceof ElementCSSInlineStyle) {
      CSSStyleDeclaration styledecl = ((ElementCSSInlineStyle) original)
          .getStyle();
      if (styledecl == null) {
        if (original.getAttribute("style") == null) { //$NON-NLS-1$
          return null;
        }
        // else mean it has style attribute.
      }

      if (styledecl != null) {
        return styledecl.getPropertyValue(cssProperty);
      }
    }

    // when we reach here, means we can't use the CSSStyleDeclaration API to
    // get style, we'll take the
View Full Code Here

   * @param original
   * @param map
   */
  public static void insertStyle(Element original, Map map) {
    if (original instanceof ElementCSSInlineStyle) {
      CSSStyleDeclaration styledecl = ((ElementCSSInlineStyle) original)
          .getStyle();
      if (styledecl == null) {
        if (original.getAttribute("style") == null) { //$NON-NLS-1$
          original.setAttribute("style", ""); //$NON-NLS-1$ //$NON-NLS-2$
          styledecl = ((ElementCSSInlineStyle) original).getStyle();
        }
      }

      if (styledecl != null) {
        for (Iterator iter = map.keySet().iterator(); iter.hasNext();) {
          String key = (String) iter.next();
          String value = (String) map.get(key);
          if (value == null) {
            styledecl.removeProperty(key);
          } else {
            styledecl.setProperty(key, value, null);
          }
        }

        return;
      }
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.