001package com.hfg.xml.msofficexml.xlsx.spreadsheetml;
002
003import com.hfg.util.StringUtil;
004import com.hfg.xml.msofficexml.xlsx.CellRef;
005import com.hfg.xml.msofficexml.xlsx.Xlsx;
006
007//------------------------------------------------------------------------------
008/**
009 Represents an Office Open XML worksheet pane (<ssml:pane>) tag.
010
011 @author J. Alex Taylor, hairyfatguy.com
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 SsmlPane extends SsmlXMLTag
035{
036   //###########################################################################
037   // CONSTRUCTORS
038   //###########################################################################
039
040   //---------------------------------------------------------------------------
041   public SsmlPane(Xlsx inXlsx)
042   {
043      super(SsmlXML.PANE, inXlsx);
044   }
045
046   //###########################################################################
047   // PUBLIC METHODS
048   //###########################################################################
049
050   //---------------------------------------------------------------------------
051   /**
052    Specifies the horizontal split position - the right-most col index of the left pane.
053    */
054   public SsmlPane setXSplit(int inValue)
055   {
056      setAttribute(SsmlXML.X_SPLIT_ATT, inValue);
057      return this;
058   }
059
060   //---------------------------------------------------------------------------
061   /**
062    Returns the horizontal split position - the right-most col index of the left pane.
063    */
064   public Integer getXSplit()
065   {
066      String stringValue = getAttributeValue(SsmlXML.X_SPLIT_ATT);
067      Integer value =  null;
068      if (StringUtil.isSet(stringValue))
069      {
070         value = Integer.parseInt(stringValue);
071      }
072
073      return value;
074   }
075
076   //---------------------------------------------------------------------------
077   /**
078    Specifies the vertical split position - the bottom-most row index of the top pane.
079    */
080   public SsmlPane setYSplit(int inValue)
081   {
082      setAttribute(SsmlXML.Y_SPLIT_ATT, inValue);
083      return this;
084   }
085
086   //---------------------------------------------------------------------------
087   /**
088    Returns the vertical split position - the bottom-most row index of the top pane.
089    */
090   public Integer getYSplit()
091   {
092      String stringValue = getAttributeValue(SsmlXML.Y_SPLIT_ATT);
093      Integer value =  null;
094      if (StringUtil.isSet(stringValue))
095      {
096         value = Integer.parseInt(stringValue);
097      }
098
099      return value;
100   }
101
102   //---------------------------------------------------------------------------
103   /**
104    Specifies the top left visible cell.
105    */
106   public SsmlPane setTopLeftVisibleCell(CellRef inValue)
107   {
108      setAttribute(SsmlXML.TOP_LEFT_CELL_ATT, inValue);
109      return this;
110   }
111
112   //---------------------------------------------------------------------------
113   /**
114    Returns the top left visible cell.
115    */
116   public CellRef getTopLeftVisibleCell()
117   {
118      String stringValue = getAttributeValue(SsmlXML.TOP_LEFT_CELL_ATT);
119      CellRef value =  null;
120      if (StringUtil.isSet(stringValue))
121      {
122         value = new CellRef(stringValue);
123      }
124
125      return value;
126   }
127
128   //---------------------------------------------------------------------------
129   /**
130    Specifies the active portion of the pane.
131    */
132   public SsmlPane setActivePane(SsmlActivePane inValue)
133   {
134      setAttribute(SsmlXML.ACTIVE_PANE_ATT, inValue);
135      return this;
136   }
137
138   //---------------------------------------------------------------------------
139   /**
140    Returns the active portion of the pane.
141    */
142   public SsmlActivePane getActivePane()
143   {
144      String stringValue = getAttributeValue(SsmlXML.ACTIVE_PANE_ATT);
145      SsmlActivePane value =  null;
146      if (StringUtil.isSet(stringValue))
147      {
148         value = SsmlActivePane.valueOf(stringValue);
149      }
150
151      return value;
152   }
153
154   //---------------------------------------------------------------------------
155   /**
156    Specifies the split state of the pane.
157    */
158   public SsmlPane setState(SsmlPaneState inValue)
159   {
160      setAttribute(SsmlXML.STATE_ATT, inValue);
161      return this;
162   }
163
164   //---------------------------------------------------------------------------
165   /**
166    Returns the split state of the pane.
167    */
168   public SsmlPaneState getState()
169   {
170      String stringValue = getAttributeValue(SsmlXML.STATE_ATT);
171      SsmlPaneState value =  null;
172      if (StringUtil.isSet(stringValue))
173      {
174         value = SsmlPaneState.valueOf(stringValue);
175      }
176
177      return value;
178   }
179
180}