Package org.apache.batik.dom.svg

Source Code of org.apache.batik.dom.svg.SVGOMRectElement

/*****************************************************************************
* Copyright (C) The Apache Software Foundation. All rights reserved.        *
* ------------------------------------------------------------------------- *
* This software is published under the terms of the Apache Software License *
* version 1.1, a copy of which has been included with this distribution in  *
* the LICENSE file.                                                         *
*****************************************************************************/

package org.apache.batik.dom.svg;

import java.lang.ref.WeakReference;
import org.apache.batik.dom.AbstractDocument;

import org.w3c.dom.Node;
import org.w3c.dom.svg.SVGAnimatedLength;
import org.w3c.dom.svg.SVGRectElement;

/**
* This class implements {@link org.w3c.dom.svg.SVGRectElement}.
*
* @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
* @version $Id: SVGOMRectElement.java,v 1.2 2000/12/06 21:23:21 hillion Exp $
*/
public class SVGOMRectElement
    extends    SVGGraphicsElement
    implements SVGRectElement {

    /**
     * The reference to the x attribute.
     */
    protected WeakReference xReference;

    /**
     * The reference to the y attribute.
     */
    protected WeakReference yReference;

    /**
     * The reference to the width attribute.
     */
    protected WeakReference widthReference;

    /**
     * The reference to the height attribute.
     */
    protected WeakReference heightReference;

    /**
     * The reference to the rx attribute.
     */
    protected WeakReference rxReference;

    /**
     * The reference to the ry attribute.
     */
    protected WeakReference ryReference;

    /**
     * Creates a new SVGOMRectElement object.
     */
    protected SVGOMRectElement() {
    }

    /**
     * Creates a new SVGOMRectElement object.
     * @param prefix The namespace prefix.
     * @param owner The owner document.
     */
    public SVGOMRectElement(String prefix, AbstractDocument owner) {
        super(prefix, owner);
    }

    /**
     * <b>DOM</b>: Implements {@link org.w3c.dom.Node#getLocalName()}.
     */
    public String getLocalName() {
        return "rect";
    }

    /**
     * <b>DOM</b>: Implements {@link org.w3c.dom.svg.SVGRectElement#getX()}.
     */
    public SVGAnimatedLength getX() {
  SVGAnimatedLength result;
  if (xReference == null ||
      (result = (SVGAnimatedLength)xReference.get()) == null) {
      result = new SVGOMAnimatedLength(this, null, "x", null);
      xReference = new WeakReference(result);
  }
  return result;
    }

    /**
     * <b>DOM</b>: Implements {@link org.w3c.dom.svg.SVGRectElement#getY()}.
     */
    public SVGAnimatedLength getY() {
  SVGAnimatedLength result;
  if (yReference == null ||
      (result = (SVGAnimatedLength)yReference.get()) == null) {
      result = new SVGOMAnimatedLength(this, null, "y", null);
      yReference = new WeakReference(result);
  }
  return result;
    }

    /**
     * <b>DOM</b>: Implements {@link
     * org.w3c.dom.svg.SVGRectElement#getWidth()}.
     */
    public SVGAnimatedLength getWidth() {
  SVGAnimatedLength result;
  if (widthReference == null ||
      (result = (SVGAnimatedLength)widthReference.get()) == null) {
      result = new SVGOMAnimatedLength(this, null, "width", null);
      widthReference = new WeakReference(result);
  }
  return result;
    }

    /**
     * <b>DOM</b>: Implements {@link
     * org.w3c.dom.svg.SVGRectElement#getHeight()}.
     */
    public SVGAnimatedLength getHeight() {
  SVGAnimatedLength result;
  if (heightReference == null ||
      (result = (SVGAnimatedLength)heightReference.get()) == null) {
      result = new SVGOMAnimatedLength(this, null, "height", null);
      heightReference = new WeakReference(result);
  }
  return result;
    }

    /**
     * <b>DOM</b>: Implements {@link org.w3c.dom.svg.SVGRectElement#getRx()}.
     */
    public SVGAnimatedLength getRx() {
  SVGAnimatedLength result;
  if (rxReference == null ||
      (result = (SVGAnimatedLength)rxReference.get()) == null) {
      result = new SVGOMAnimatedLength(this, null, "rx", null);
      rxReference = new WeakReference(result);
  }
  return result;
    }

    /**
     * <b>DOM</b>: Implements {@link org.w3c.dom.svg.SVGRectElement#getRy()}.
     */
    public SVGAnimatedLength getRy() {
  SVGAnimatedLength result;
  if (ryReference == null ||
      (result = (SVGAnimatedLength)ryReference.get()) == null) {
      result = new SVGOMAnimatedLength(this, null, "ry", null);
      ryReference = new WeakReference(result);
  }
  return result;
    }

    /**
     * Returns a new uninitialized instance of this object's class.
     */
    protected Node newNode() {
        return new SVGOMRectElement();
    }
}
TOP

Related Classes of org.apache.batik.dom.svg.SVGOMRectElement

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.