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