Package org.w3c.dom.css

Examples of org.w3c.dom.css.CSSValue


    /**
     * <b>DOM</b>: Implements {@link
     * org.w3c.dom.svg.SVGStylable#getPresentationAttribute(String)}.
     */
    public CSSValue getPresentationAttribute(String name) {
        CSSValue result = (CSSValue)getLiveAttributeValue(null, name);
        if (result != null)
            return result;

        CSSEngine eng = ((SVGOMDocument)getOwnerDocument()).getCSSEngine();
        int idx = eng.getPropertyIndex(name);
View Full Code Here


    /**
     * <b>DOM</b>: Implements {@link
     * org.w3c.dom.css.CSSStyleDeclaration#getPropertyCSSValue(String)}.
     */
    public CSSValue getPropertyCSSValue(String propertyName) {
        CSSValue result = (CSSValue)values.get(propertyName);
        if (result == null) {
            int idx = cssEngine.getPropertyIndex(propertyName);
            if (idx != -1) {
                result = createCSSValue(idx);
                values.put(propertyName, result);
View Full Code Here

    /**
     * Gets the CSS value associated with the given property.
     */
    protected CSSValue getCSSValue(String name) {
        CSSValue result = null;
        if (values != null) {
            result = (CSSValue)values.get(name);
        }
        if (result == null) {
            result = createCSSValue(name);
View Full Code Here

  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) {
        result = meta.calculateHTMLAttributeOverride(_element,
            getHTMLTag(), propertyName, this);
View Full Code Here

                             Element paintedElement,
                             GraphicsNode paintedNode,
                             float opacity) {
        CSSOMReadOnlyStyleDeclaration decl;
        decl = CSSUtilities.getComputedStyle(paintElement);
        CSSValue opacityVal = decl.getPropertyCSSValueInternal
            (BATIK_EXT_SOLID_OPACITY_PROPERTY);
        if (opacityVal != null) {
            float attr = PaintServer.convertOpacity(opacityVal);
            opacity *= attr;
        }

        CSSValue colorDef
            = decl.getPropertyCSSValueInternal(BATIK_EXT_SOLID_COLOR_PROPERTY);
        if (colorDef == null)
            return new Color(0f, 0f, 0f, opacity);

        Color ret = null;
        if (colorDef.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
            CSSPrimitiveValue v = (CSSPrimitiveValue)colorDef;
            ret = PaintServer.convertColor(v.getRGBColorValue(), opacity);
        } else {
            ret = PaintServer.convertRGBICCColor
                (paintElement, (SVGColor)colorDef, opacity, ctx);
View Full Code Here

     * Fires an existing CSSPropertyChangeEvent to any registered listeners.
     * No event is fired if the given event's old and new values are equal.
     * @param evt  The CSSPropertyChangeEvent object.
     */
    public void fireCSSPropertyChange(CSSPropertyChangeEvent evt) {
  CSSValue old = evt.getOldValue();
        if (old != null && old.equals(evt.getNewValue())) {
            return;
        }

  List targets = null;
  if (listeners != null) {
View Full Code Here

     */
    public void setCssText(String cssText) throws DOMException {
  if (listener == null) {
      value = factory.createValue(cssText);
  } else {
      CSSValue old = new CSSOMReadOnlyValue(value);
      value = factory.createValue(cssText);
      listener.cssValueChange(factory.getPropertyName(), old, this);
  }
    }
View Full Code Here

    public void setFloatValue(short unitType, float floatValue)
        throws DOMException {
  if (listener == null) {
      value = factory.createFloatValue(unitType, floatValue);
  } else {
      CSSValue old = new CSSOMReadOnlyValue(value);
      value = factory.createFloatValue(unitType, floatValue);
      listener.cssValueChange(factory.getPropertyName(), old, this);
  }
    }
View Full Code Here

    public void setStringValue(short stringType, String stringValue)
        throws DOMException {
  if (listener == null) {
      value = factory.createStringValue(stringType, stringValue);
  } else {
      CSSValue old = new CSSOMReadOnlyValue(value);
      value = factory.createStringValue(stringType, stringValue);
      listener.cssValueChange(factory.getPropertyName(), old, this);
  }
    }
View Full Code Here

        AbstractViewCSS viewCss = CSSUtilities.getViewCSS(element);
        CSSOMReadOnlyStyleDeclaration styleDecl = viewCss.getCascadedStyle(element, null);

        // determine if text-decoration was explicity set on this element
        CSSValue cssVal = styleDecl.getLocalPropertyCSSValue(CSS_TEXT_DECORATION_PROPERTY);
        if (cssVal == null) {
            // not explicitly set so return the copy of the parent's decoration
            return textDecoration;
        }

        short t = cssVal.getCssValueType();

        if (t == CSSValue.CSS_VALUE_LIST) {

            // first check to see if its a valid list,
            // ie. if it contains none then that is the only element
View Full Code Here

TOP

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

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.