Examples of CSSStyleDeclaration


Examples of org.w3c.dom.css.CSSStyleDeclaration

      } catch (ClassCastException ex) {
        Logger log = PDPlugin.getLogger(CSSStyleDeclaration.class);
        log.error("Error.CSSUtil.3", ex); //$NON-NLS-1$
      }
    }
    CSSStyleDeclaration declare = query.getDeclaration();
    return declare;
  }
View Full Code Here

Examples of org.w3c.dom.css.CSSStyleDeclaration

   */
  protected Object calculateProperty(String propertyName) {
    ICSSPropertyMeta meta = getPropertyMeta(propertyName);
    Object result = null;
    // get declaration
    CSSStyleDeclaration decl = getDeclaration();
    CSSValue value = decl == null ? null : decl
        .getPropertyCSSValue(propertyName);
    if (value == null) {
      if (meta != null) {
        result = meta.calculateHTMLAttributeOverride(_element,
            getHTMLTag(), propertyName, this);
        if (result != null) {
          return result;
        }
      }
      decl = getDefaultDeclaration();
    }
    value = decl == null ? null : decl.getPropertyCSSValue(propertyName);

    if (value != null && value.getCssValueType() == CSSValue.CSS_INHERIT) {
      result = getParentResultValue(meta, propertyName);
    } else if (value == null) {
      if (meta != null) {
View Full Code Here

Examples of org.w3c.dom.css.CSSStyleDeclaration

   * @return the inline style property
   */
  public static String getInlineStyleProperty(Element original, String styleAttributeName,
      String cssProperty) {
    if (original instanceof ElementCSSInlineStyle) {
      CSSStyleDeclaration styledecl = ((ElementCSSInlineStyle) original)
          .getStyle();
      if (styledecl == null) {
        if (original.getAttribute(styleAttributeName) == null) {
          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

Examples of org.w3c.dom.css.CSSStyleDeclaration

   * @param styleAttrName
   * @param map
   */
  public static void insertStyle(Element original, String styleAttrName, Map map) {
    if (original instanceof ElementCSSInlineStyle) {
      CSSStyleDeclaration styledecl = ((ElementCSSInlineStyle) original)
          .getStyle();
      if (styledecl == null) {
        if (original.getAttribute(styleAttrName) == null) {
          original.setAttribute(styleAttrName, ""); //$NON-NLS-1$
          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

Examples of org.w3c.dom.css.CSSStyleDeclaration

    /**
     * To implement {@link org.w3c.dom.svg.SVGStylable#getStyle()}.
     */
    public static CSSStyleDeclaration getStyle(Element elt) {
  // !!! TODO: getStyle()
        CSSStyleDeclaration style;
        SVGDOMImplementation impl;
        impl = (SVGDOMImplementation)elt.getOwnerDocument().getImplementation();
        style = impl.createCSSStyleDeclaration();
        style.setCssText(elt.getAttribute(SVG_STYLE_ATTRIBUTE));
        return style;
    }
View Full Code Here

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

Examples of org.w3c.dom.css.CSSStyleDeclaration

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

Examples of org.w3c.dom.css.CSSStyleDeclaration

                     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

Examples of org.w3c.dom.css.CSSStyleDeclaration

      addMatchingRules(userAgentStyleSheet.getCssRules(), e, pe,
                             null, 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

Examples of org.w3c.dom.css.CSSStyleDeclaration

  if (userStyleSheet != null) {
      addMatchingRules(userStyleSheet.getCssRules(), e, pe, null, 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
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.