001package com.hfg.xml.msofficexml.docx.drawingml;
002
003
004import com.hfg.xml.msofficexml.docx.Docx;
005import com.hfg.xml.msofficexml.docx.wordprocessingml.WmlXMLTag;
006
007public class DmlGraphic extends WmlXMLTag
008{
009   private DmlGraphicData   mGraphicData;
010
011   //---------------------------------------------------------------------------
012   public DmlGraphic(Docx inDocx)
013   {
014      super(DmlXML.GRAPHIC, inDocx);
015   }
016
017
018   //---------------------------------------------------------------------------
019   /**
020    * Returns the graphicData tag if one exists or else instantiates a new one.
021    * @return the graphicData tag for this graphic tag
022    */
023   public DmlGraphicData getGraphicData()
024   {
025      if (null == mGraphicData)
026      {
027         // Check if it has been added via addSubtag()...
028         mGraphicData = getOptionalSubtagByName(DmlXML.GRAPHIC_DATA);
029         if (null == mGraphicData)
030         {
031            mGraphicData = new DmlGraphicData(getParentDoc());
032            addSubtag(mGraphicData);
033         }
034      }
035
036      return mGraphicData;
037   }
038
039}