All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hfg.xml.msofficexml.docx.drawingml.DmlShape Maven / Gradle / Ivy

There is a newer version: 20240423
Show newest version
package com.hfg.xml.msofficexml.docx.drawingml;


import com.hfg.xml.msofficexml.docx.Docx;
import com.hfg.xml.msofficexml.docx.drawingml.text.DmlTextBody;
import com.hfg.xml.msofficexml.docx.wordprocessingml.WmlXMLTag;

public class DmlShape extends WmlXMLTag
{
   private DmlNonVisualShapeDrawingProperties mDmlNonVisualShapeDrawingProperties;
   private DmlTextBody mTextBox;

   //---------------------------------------------------------------------------
   public DmlShape(Docx inDocx)
   {
      super(DmlXML.SHAPE, inDocx);
   }

   //---------------------------------------------------------------------------
   /**
    * Returns the non-visual shape drawing properties (<p:nvSpPr>) tag if one exists or else instantiates a new one.
    * @return the non-visual shape drawing properties (<p:nvSpPr>) for this shape tag
    */
   public DmlNonVisualShapeDrawingProperties getNonVisualShapeDrawingProperties()
   {
      if (null == mDmlNonVisualShapeDrawingProperties)
      {
         // Check if it has been added via addSubtag()...
         mDmlNonVisualShapeDrawingProperties = getOptionalSubtagByName(DmlXML.NON_VISUAL_SHAPE_DRAWING_PROPS);
         if (null == mDmlNonVisualShapeDrawingProperties)
         {
            mDmlNonVisualShapeDrawingProperties = new DmlNonVisualShapeDrawingProperties(getParentDoc());
            addSubtag(mDmlNonVisualShapeDrawingProperties);
         }
      }

      return mDmlNonVisualShapeDrawingProperties;
   }

   //---------------------------------------------------------------------------
   public DmlTextBody getTextBox()
   {
      if (null == mTextBox)
      {
         // Check if it has been added via addSubtag()...
         mTextBox = getOptionalSubtagByName(DmlXML.TEXT_BODY);
         if (null == mTextBox)
         {
            mTextBox = new DmlTextBody(getParentDoc());
            addSubtag(mTextBox);
         }
      }

      return mTextBox;
   }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy