/** Updates an attribute value in this target. */
 public void updateAttributeValue(String ns, String ln, AnimatableValue val) {
   if (ns == null) {
     if (ln.equals(SVG_X_ATTRIBUTE)) {
       updateNumberAttributeValue(getX(), val);
       return;
     } else if (ln.equals(SVG_Y_ATTRIBUTE)) {
       updateNumberAttributeValue(getY(), val);
       return;
     } else if (ln.equals(SVG_Z_ATTRIBUTE)) {
       updateNumberAttributeValue(getZ(), val);
       return;
     } else if (ln.equals(SVG_POINTS_AT_X_ATTRIBUTE)) {
       updateNumberAttributeValue(getPointsAtX(), val);
       return;
     } else if (ln.equals(SVG_POINTS_AT_Y_ATTRIBUTE)) {
       updateNumberAttributeValue(getPointsAtY(), val);
       return;
     } else if (ln.equals(SVG_POINTS_AT_Z_ATTRIBUTE)) {
       updateNumberAttributeValue(getPointsAtZ(), val);
       return;
     } else if (ln.equals(SVG_SPECULAR_EXPONENT_ATTRIBUTE)) {
       updateNumberAttributeValue(getSpecularExponent(), val);
       return;
     } else if (ln.equals(SVG_LIMITING_CONE_ANGLE_ATTRIBUTE)) {
       updateNumberAttributeValue(getLimitingConeAngle(), val);
       return;
     }
   }
   super.updateAttributeValue(ns, ln, val);
 }
Beispiel #2
0
  /** To implement {@link org.w3c.dom.svg.SVGLocatable#getBBox()}. */
  public static SVGRect getBBox(Element elt) {
    final SVGOMElement svgelt = (SVGOMElement) elt;
    SVGContext svgctx = svgelt.getSVGContext();
    if (svgctx == null) return null;
    if (svgctx.getBBox() == null) return null;

    return new SVGRect() {
      public float getX() {
        return (float) svgelt.getSVGContext().getBBox().getX();
      }

      public void setX(float x) throws DOMException {
        throw svgelt.createDOMException(
            DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.rect", null);
      }

      public float getY() {
        return (float) svgelt.getSVGContext().getBBox().getY();
      }

      public void setY(float y) throws DOMException {
        throw svgelt.createDOMException(
            DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.rect", null);
      }

      public float getWidth() {
        return (float) svgelt.getSVGContext().getBBox().getWidth();
      }

      public void setWidth(float width) throws DOMException {
        throw svgelt.createDOMException(
            DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.rect", null);
      }

      public float getHeight() {
        return (float) svgelt.getSVGContext().getBBox().getHeight();
      }

      public void setHeight(float height) throws DOMException {
        throw svgelt.createDOMException(
            DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.rect", null);
      }
    };
  }
 /** Initializes all live attributes for this element. */
 protected void initializeAllLiveAttributes() {
   super.initializeAllLiveAttributes();
   initializeLiveAttributes();
 }