001package com.hfg.xml.msofficexml.xlsx.spreadsheetDrawing;
002
003
004import com.hfg.xml.msofficexml.xlsx.Xlsx;
005import com.hfg.xml.msofficexml.xlsx.spreadsheetml.SsmlXMLTag;
006
007//------------------------------------------------------------------------------
008/**
009 Represents an Office Open XML non-visual shape drawing properties (<xdr:nvSpPr>) tag.
010 <div>
011 @author J. Alex Taylor, hairyfatguy.com
012 </div>
013 */
014//------------------------------------------------------------------------------
015// com.hfg XML/HTML Coding Library
016//
017// This library is free software; you can redistribute it and/or
018// modify it under the terms of the GNU Lesser General Public
019// License as published by the Free Software Foundation; either
020// version 2.1 of the License, or (at your option) any later version.
021//
022// This library is distributed in the hope that it will be useful,
023// but WITHOUT ANY WARRANTY; without even the implied warranty of
024// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
025// Lesser General Public License for more details.
026//
027// You should have received a copy of the GNU Lesser General Public
028// License along with this library; if not, write to the Free Software
029// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
030//
031// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com
032// jataylor@hairyfatguy.com
033//------------------------------------------------------------------------------
034
035public class SsDrawNonVisualShapeDrawingProperties extends SsmlXMLTag
036{
037   private SsDrawNonVisualDrawingProperties    mNonVisualDrawingProperties;
038   private SsDrawNonVisualShapeProperties      mNonVisualShapeProperties;
039
040   //---------------------------------------------------------------------------
041   public SsDrawNonVisualShapeDrawingProperties(Xlsx inXlsx)
042   {
043      super(SsDrawXML.NON_VISUAL_SHAPE_DRAWING_PROPS, inXlsx);
044      init();
045   }
046
047   //---------------------------------------------------------------------------
048   private void init()
049   {
050      getNonVisualDrawingProperties();
051      getNonVisualShapeProperties();
052   }
053
054   //---------------------------------------------------------------------------
055   /**
056    * Returns the non-visual drawing properties (&lt;xdr:cNvPr&gt;) tag if one exists or else instantiates a new one.
057    * @return the non-visual drawing properties (&lt;xdr:cNvPr&gt;) tag
058    */
059   public SsDrawNonVisualDrawingProperties getNonVisualDrawingProperties()
060   {
061      if (null == mNonVisualDrawingProperties)
062      {
063         // Check if it has been added via addSubtag()...
064         mNonVisualDrawingProperties = getOptionalSubtagByName(SsDrawXML.NON_VISUAL_DRAWING_PROPS);
065         if (null == mNonVisualDrawingProperties)
066         {
067            mNonVisualDrawingProperties = new SsDrawNonVisualDrawingProperties(getParentDoc());
068            addSubtag(mNonVisualDrawingProperties);
069         }
070      }
071
072      return mNonVisualDrawingProperties;
073   }
074
075   //---------------------------------------------------------------------------
076   /**
077    * Returns the non-visual shape properties (&lt;xdr:cNvSpPr&gt;) tag if one exists or else instantiates a new one.
078    * @return the non-visual shape properties (&lt;xdr:cNvSpPr&gt;) tag
079    */
080   public SsDrawNonVisualShapeProperties getNonVisualShapeProperties()
081   {
082      if (null == mNonVisualShapeProperties)
083      {
084         // Check if it has been added via addSubtag()...
085         mNonVisualShapeProperties = getOptionalSubtagByName(SsDrawXML.NON_VISUAL_SHAPE_PROPS);
086         if (null == mNonVisualShapeProperties)
087         {
088            mNonVisualShapeProperties = new SsDrawNonVisualShapeProperties(getParentDoc());
089            addSubtag(mNonVisualShapeProperties);
090         }
091      }
092
093      return mNonVisualShapeProperties;
094   }
095
096}