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

com.hfg.xml.msofficexml.docx.drawingml.DmlPicture 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.wordprocessingml.WmlXMLTag;

public class DmlPicture extends WmlXMLTag
{
   private DmlNonVisualPictureProperties mNonVisualPictureProperties;
   private DmlBlipFill                   mBlipFill;
   private DmlShapeProperties            mShapeProperties;

   //---------------------------------------------------------------------------
   public DmlPicture(Docx inDocx)
   {
      super(DmlXML.PIC, inDocx);
      init();
   }

   //---------------------------------------------------------------------------
   private void init()
   {
   }


   //---------------------------------------------------------------------------
   /**
    * Returns the non-visible picture properties tag if one exists or else instantiates a new one.
    * @return the non-visible picture properties for this picture tag
    */
   public DmlNonVisualPictureProperties getNonVisualPictureProperties()
   {
      if (null == mNonVisualPictureProperties)
      {
         // Check if it has been added via addSubtag()...
         mNonVisualPictureProperties = (DmlNonVisualPictureProperties) getOptionalSubtagByName(DmlXML.NON_VISUAL_PIC_PROPS);
         if (null == mNonVisualPictureProperties)
         {
            mNonVisualPictureProperties = new DmlNonVisualPictureProperties();
            addSubtag(mNonVisualPictureProperties);
         }
      }

      return mNonVisualPictureProperties;
   }

   //---------------------------------------------------------------------------
   /**
    * Returns the blipFill tag if one exists or else instantiates a new one.
    * @return the blipFill for this picture tag
    */
   public DmlBlipFill getBlipFill()
   {
      if (null == mBlipFill)
      {
         // Check if it has been added via addSubtag()...
         mBlipFill = (DmlBlipFill) getOptionalSubtagByName(DmlXML.BLIP_FILL);
         if (null == mBlipFill)
         {
            mBlipFill = new DmlBlipFill(getParentDoc());
            addSubtag(mBlipFill);
         }
      }

      return mBlipFill;
   }

   //---------------------------------------------------------------------------
   /**
    * Returns the shape properties tag if one exists or else instantiates a new one.
    * @return the shape properties for this picture tag
    */
   public DmlShapeProperties getShapeProperties()
   {
      if (null == mShapeProperties)
      {
         // Check if it has been added via addSubtag()...
         mShapeProperties = (DmlShapeProperties) getOptionalSubtagByName(DmlXML.SHAPE_PROPS);
         if (null == mShapeProperties)
         {
            mShapeProperties = new DmlShapeProperties(getParentDoc());
            addSubtag(mShapeProperties);
         }
      }

      return mShapeProperties;
   }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy