001package com.hfg.html;
002
003
004import com.hfg.xml.XMLNode;
005
006//------------------------------------------------------------------------------
007/**
008 * Represents a frameset (<frameset>) tag.
009 *
010 * @author J. Alex Taylor, hairyfatguy.com
011 */
012//------------------------------------------------------------------------------
013// com.hfg XML/HTML Coding Library
014//
015// This library is free software; you can redistribute it and/or
016// modify it under the terms of the GNU Lesser General Public
017// License as published by the Free Software Foundation; either
018// version 2.1 of the License, or (at your option) any later version.
019//
020// This library is distributed in the hope that it will be useful,
021// but WITHOUT ANY WARRANTY; without even the implied warranty of
022// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
023// Lesser General Public License for more details.
024//
025// You should have received a copy of the GNU Lesser General Public
026// License along with this library; if not, write to the Free Software
027// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
028//
029// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com
030// jataylor@hairyfatguy.com
031//------------------------------------------------------------------------------
032
033public class Frameset extends HTMLTag
034{
035
036   //##########################################################################
037   // PRIVATE FIELDS
038   //##########################################################################
039
040
041   //##########################################################################
042   // CONSTRUCTORS
043   //##########################################################################
044
045   //--------------------------------------------------------------------------
046   public Frameset()
047   {
048      super(HTML.FRAMESET);
049   }
050
051   //--------------------------------------------------------------------------
052   public Frameset(XMLNode inXMLNode)
053   {
054      this();
055      initFromXMLNode(inXMLNode);
056   }
057
058   //##########################################################################
059   // PUBLIC METHODS
060   //##########################################################################
061
062   //--------------------------------------------------------------------------
063   public Frame addFrame()
064   {
065      Frame frame = new Frame();
066      addSubtag(frame);
067
068      return frame;
069   }
070
071   //--------------------------------------------------------------------------
072   public Frame addFrame(String inName, String inSrc)
073   {
074      Frame frame = new Frame(inName, inSrc);
075      addSubtag(frame);
076
077      return frame;
078   }
079
080
081   //--------------------------------------------------------------------------
082   public Frameset setId(String inValue)
083   {
084      setAttribute(HTML.ID, inValue);
085      return this;
086   }
087
088
089   //--------------------------------------------------------------------------
090   public Frameset setRows(String inValue)
091   {
092      setAttribute(HTML.ROWS, inValue);
093      return this;
094   }
095
096   //--------------------------------------------------------------------------
097   public String getRows()
098   {
099      return getAttributeValue(HTML.ROWS);
100   }
101
102
103   //--------------------------------------------------------------------------
104   public Frameset setCols(String inValue)
105   {
106      setAttribute(HTML.COLS, inValue);
107      return this;
108   }
109
110   //--------------------------------------------------------------------------
111   public String getCols()
112   {
113      return getAttributeValue(HTML.COLS);
114   }
115
116
117   //--------------------------------------------------------------------------
118   public Frameset setBorder(int inBorder)
119   {
120      setAttribute(HTML.BORDER, inBorder + "");
121
122      return this;
123   }
124
125   //--------------------------------------------------------------------------
126   public Integer getBorder()
127   {
128      Integer border = null;
129
130      String value = getAttributeValue(HTML.BORDER);
131      if (value != null)
132      {
133         border = new Integer(value);
134      }
135
136      return border;
137   }
138
139   //--------------------------------------------------------------------------
140   public Frameset setFrameBorder(int inBorder)
141   {
142      setAttribute(HTML.FRAMEBORDER, inBorder + "");
143
144      return this;
145   }
146
147   //--------------------------------------------------------------------------
148   public Integer getFrameBorder()
149   {
150      Integer frameBorder = null;
151
152      String value = getAttributeValue(HTML.FRAMEBORDER);
153      if (value != null)
154      {
155         frameBorder = new Integer(value);
156      }
157
158      return frameBorder;
159   }
160
161   //--------------------------------------------------------------------------
162   public Frameset setFrameSpacing(int inSpacing)
163   {
164      setAttribute(HTML.FRAMESPACING, inSpacing + "");
165
166      return this;
167   }
168
169   //--------------------------------------------------------------------------
170   public Integer getFrameSpacing()
171   {
172      Integer frameSpacing = null;
173
174      String value = getAttributeValue(HTML.FRAMESPACING);
175      if (value != null)
176      {
177         frameSpacing = new Integer(value);
178      }
179
180      return frameSpacing;
181   }
182
183}