DrawMarkerElement.java

  1. /**
  2.  * **********************************************************************
  3.  *
  4.  * <p>DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
  5.  *
  6.  * <p>Copyright 2008, 2010 Oracle and/or its affiliates. All rights reserved.
  7.  *
  8.  * <p>Use is subject to license terms.
  9.  *
  10.  * <p>Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
  11.  * except in compliance with the License. You may obtain a copy of the License at
  12.  * http://www.apache.org/licenses/LICENSE-2.0. You can also obtain a copy of the License at
  13.  * http://odftoolkit.org/docs/license.txt
  14.  *
  15.  * <p>Unless required by applicable law or agreed to in writing, software distributed under the
  16.  * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  17.  * express or implied.
  18.  *
  19.  * <p>See the License for the specific language governing permissions and limitations under the
  20.  * License.
  21.  *
  22.  * <p>**********************************************************************
  23.  */

  24. /*
  25.  * This file is automatically generated.
  26.  * Don't edit manually.
  27.  */
  28. package org.odftoolkit.odfdom.dom.element.draw;

  29. import org.odftoolkit.odfdom.dom.DefaultElementVisitor;
  30. import org.odftoolkit.odfdom.dom.OdfDocumentNamespace;
  31. import org.odftoolkit.odfdom.dom.attribute.draw.DrawDisplayNameAttribute;
  32. import org.odftoolkit.odfdom.dom.attribute.draw.DrawNameAttribute;
  33. import org.odftoolkit.odfdom.dom.attribute.svg.SvgDAttribute;
  34. import org.odftoolkit.odfdom.dom.attribute.svg.SvgViewBoxAttribute;
  35. import org.odftoolkit.odfdom.pkg.ElementVisitor;
  36. import org.odftoolkit.odfdom.pkg.OdfElement;
  37. import org.odftoolkit.odfdom.pkg.OdfFileDom;
  38. import org.odftoolkit.odfdom.pkg.OdfName;

  39. /** DOM implementation of OpenDocument element {@odf.element draw:marker}. */
  40. public class DrawMarkerElement extends OdfElement {

  41.   public static final OdfName ELEMENT_NAME = OdfName.newName(OdfDocumentNamespace.DRAW, "marker");

  42.   /**
  43.    * Create the instance of <code>DrawMarkerElement</code>
  44.    *
  45.    * @param ownerDoc The type is <code>OdfFileDom</code>
  46.    */
  47.   public DrawMarkerElement(OdfFileDom ownerDoc) {
  48.     super(ownerDoc, ELEMENT_NAME);
  49.   }

  50.   /**
  51.    * Get the element name
  52.    *
  53.    * @return return <code>OdfName</code> the name of element {@odf.element draw:marker}.
  54.    */
  55.   public OdfName getOdfName() {
  56.     return ELEMENT_NAME;
  57.   }

  58.   /**
  59.    * Receives the value of the ODFDOM attribute representation <code>DrawDisplayNameAttribute</code>
  60.    * , See {@odf.attribute draw:display-name}
  61.    *
  62.    * @return - the <code>String</code> , the value or <code>null</code>, if the attribute is not set
  63.    *     and no default value defined.
  64.    */
  65.   public String getDrawDisplayNameAttribute() {
  66.     DrawDisplayNameAttribute attr =
  67.         (DrawDisplayNameAttribute) getOdfAttribute(OdfDocumentNamespace.DRAW, "display-name");
  68.     if (attr != null) {
  69.       return String.valueOf(attr.getValue());
  70.     }
  71.     return null;
  72.   }

  73.   /**
  74.    * Sets the value of ODFDOM attribute representation <code>DrawDisplayNameAttribute</code> , See
  75.    * {@odf.attribute draw:display-name}
  76.    *
  77.    * @param drawDisplayNameValue The type is <code>String</code>
  78.    */
  79.   public void setDrawDisplayNameAttribute(String drawDisplayNameValue) {
  80.     DrawDisplayNameAttribute attr = new DrawDisplayNameAttribute((OdfFileDom) this.ownerDocument);
  81.     setOdfAttribute(attr);
  82.     attr.setValue(drawDisplayNameValue);
  83.   }

  84.   /**
  85.    * Receives the value of the ODFDOM attribute representation <code>DrawNameAttribute</code> , See
  86.    * {@odf.attribute draw:name}
  87.    *
  88.    * <p>Attribute is mandatory.
  89.    *
  90.    * @return - the <code>String</code> , the value or <code>null</code>, if the attribute is not set
  91.    *     and no default value defined.
  92.    */
  93.   public String getDrawNameAttribute() {
  94.     DrawNameAttribute attr = (DrawNameAttribute) getOdfAttribute(OdfDocumentNamespace.DRAW, "name");
  95.     if (attr != null) {
  96.       return String.valueOf(attr.getValue());
  97.     }
  98.     return null;
  99.   }

  100.   /**
  101.    * Sets the value of ODFDOM attribute representation <code>DrawNameAttribute</code> , See
  102.    * {@odf.attribute draw:name}
  103.    *
  104.    * @param drawNameValue The type is <code>String</code>
  105.    */
  106.   public void setDrawNameAttribute(String drawNameValue) {
  107.     DrawNameAttribute attr = new DrawNameAttribute((OdfFileDom) this.ownerDocument);
  108.     setOdfAttribute(attr);
  109.     attr.setValue(drawNameValue);
  110.   }

  111.   /**
  112.    * Receives the value of the ODFDOM attribute representation <code>SvgDAttribute</code> , See
  113.    * {@odf.attribute svg:d}
  114.    *
  115.    * <p>Attribute is mandatory.
  116.    *
  117.    * @return - the <code>String</code> , the value or <code>null</code>, if the attribute is not set
  118.    *     and no default value defined.
  119.    */
  120.   public String getSvgDAttribute() {
  121.     SvgDAttribute attr = (SvgDAttribute) getOdfAttribute(OdfDocumentNamespace.SVG, "d");
  122.     if (attr != null) {
  123.       return String.valueOf(attr.getValue());
  124.     }
  125.     return null;
  126.   }

  127.   /**
  128.    * Sets the value of ODFDOM attribute representation <code>SvgDAttribute</code> , See
  129.    * {@odf.attribute svg:d}
  130.    *
  131.    * @param svgDValue The type is <code>String</code>
  132.    */
  133.   public void setSvgDAttribute(String svgDValue) {
  134.     SvgDAttribute attr = new SvgDAttribute((OdfFileDom) this.ownerDocument);
  135.     setOdfAttribute(attr);
  136.     attr.setValue(svgDValue);
  137.   }

  138.   /**
  139.    * Receives the value of the ODFDOM attribute representation <code>SvgViewBoxAttribute</code> ,
  140.    * See {@odf.attribute svg:viewBox}
  141.    *
  142.    * <p>Attribute is mandatory.
  143.    *
  144.    * @return - the <code>Integer</code> , the value or <code>null</code>, if the attribute is not
  145.    *     set and no default value defined.
  146.    */
  147.   public Integer getSvgViewBoxAttribute() {
  148.     SvgViewBoxAttribute attr =
  149.         (SvgViewBoxAttribute) getOdfAttribute(OdfDocumentNamespace.SVG, "viewBox");
  150.     if (attr != null) {
  151.       return Integer.valueOf(attr.intValue());
  152.     }
  153.     return null;
  154.   }

  155.   /**
  156.    * Sets the value of ODFDOM attribute representation <code>SvgViewBoxAttribute</code> , See
  157.    * {@odf.attribute svg:viewBox}
  158.    *
  159.    * @param svgViewBoxValue The type is <code>Integer</code>
  160.    */
  161.   public void setSvgViewBoxAttribute(Integer svgViewBoxValue) {
  162.     SvgViewBoxAttribute attr = new SvgViewBoxAttribute((OdfFileDom) this.ownerDocument);
  163.     setOdfAttribute(attr);
  164.     attr.setIntValue(svgViewBoxValue.intValue());
  165.   }

  166.   @Override
  167.   public void accept(ElementVisitor visitor) {
  168.     if (visitor instanceof DefaultElementVisitor) {
  169.       DefaultElementVisitor defaultVisitor = (DefaultElementVisitor) visitor;
  170.       defaultVisitor.visit(this);
  171.     } else {
  172.       visitor.visit(this);
  173.     }
  174.   }
  175. }