001package com.hfg.html; 002 003 004import com.hfg.xml.XMLNode; 005 006//------------------------------------------------------------------------------ 007/** 008 * Represents a center (<center>) 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 Center extends HTMLTagWithCoreEvents 034{ 035 036 //########################################################################## 037 // CONSTRUCTORS 038 //########################################################################## 039 040 //-------------------------------------------------------------------------- 041 public Center() 042 { 043 super(HTML.CENTER); 044 } 045 046 //-------------------------------------------------------------------------- 047 public Center(String inContent) 048 { 049 this(); 050 addContent(inContent); 051 } 052 053 //-------------------------------------------------------------------------- 054 public Center(HTMLTag inContent) 055 { 056 this(); 057 addSubtag(inContent); 058 } 059 060 //-------------------------------------------------------------------------- 061 public Center(XMLNode inXMLNode) 062 { 063 this(); 064 initFromXMLNode(inXMLNode); 065 } 066 067 //########################################################################## 068 // PUBLIC METHODS 069 //########################################################################## 070 071 //--------------------------------------------------------------------------- 072 public Div addDiv() 073 { 074 Div div = new Div(); 075 addSubtag(div); 076 077 return div; 078 } 079 080 //-------------------------------------------------------------------------- 081 public Form addForm() 082 { 083 Form form = new Form(); 084 addSubtag(form); 085 086 return form; 087 } 088 089 //-------------------------------------------------------------------------- 090 public Form addForm(String inFormName) 091 { 092 Form form = new Form(inFormName); 093 addSubtag(form); 094 095 return form; 096 } 097 098 099 //-------------------------------------------------------------------------- 100 public Img addImage(String inSrc) 101 { 102 Img image = new Img(inSrc); 103 addSubtag(image); 104 105 return image; 106 } 107 108 //-------------------------------------------------------------------------- 109 public Link addLink() 110 { 111 Link link = new Link(); 112 addSubtag(link); 113 114 return link; 115 } 116 117 //-------------------------------------------------------------------------- 118 public Link addLink(CharSequence inURL) 119 { 120 Link link = new Link(inURL); 121 addSubtag(link); 122 123 return link; 124 } 125 126 //-------------------------------------------------------------------------- 127 public Link addLink(CharSequence inURL, String inContent) 128 { 129 Link link = new Link(inURL, inContent); 130 addSubtag(link); 131 132 return link; 133 } 134 135 //-------------------------------------------------------------------------- 136 public Nobr addNobr() 137 { 138 Nobr nobr = new Nobr(); 139 addSubtag(nobr); 140 141 return nobr; 142 } 143 144 //-------------------------------------------------------------------------- 145 public Nobr addNobr(String inContent) 146 { 147 Nobr nobr = new Nobr(inContent); 148 addSubtag(nobr); 149 150 return nobr; 151 } 152 153 //-------------------------------------------------------------------------- 154 public Nobr addNobr(HTMLTag inContent) 155 { 156 Nobr nobr = new Nobr(inContent); 157 addSubtag(nobr); 158 159 return nobr; 160 } 161 162 //-------------------------------------------------------------------------- 163 public Pre addPre() 164 { 165 Pre pre = new Pre(); 166 addSubtag(pre); 167 168 return pre; 169 } 170 171 //-------------------------------------------------------------------------- 172 public Pre addPre(String inContent) 173 { 174 Pre pre = new Pre(inContent); 175 addSubtag(pre); 176 177 return pre; 178 } 179 180 //-------------------------------------------------------------------------- 181 public Pre addPre(HTMLTag inContent) 182 { 183 Pre pre = new Pre(inContent); 184 addSubtag(pre); 185 186 return pre; 187 } 188 189 //-------------------------------------------------------------------------- 190 public Span addSpan() 191 { 192 Span span = new Span(); 193 addSubtag(span); 194 195 return span; 196 } 197 198 //-------------------------------------------------------------------------- 199 public Span addSpan(String inContent) 200 { 201 Span span = new Span(inContent); 202 addSubtag(span); 203 204 return span; 205 } 206 207 //-------------------------------------------------------------------------- 208 public Span addSpan(HTMLTag inContent) 209 { 210 Span span = new Span(inContent); 211 addSubtag(span); 212 213 return span; 214 } 215 216 //-------------------------------------------------------------------------- 217 public Table addTable() 218 { 219 Table table = new Table(); 220 addSubtag(table); 221 222 return table; 223 } 224 225 //-------------------------------------------------------------------------- 226 public Ul addUnorderedList() 227 { 228 Ul ul = new Ul(); 229 addSubtag(ul); 230 231 return ul; 232 } 233 234 235 //-------------------------------------------------------------------------- 236 public Center setStyle(String inValue) 237 { 238 setAttribute(HTML.STYLE, inValue); 239 240 return this; 241 } 242 243 //-------------------------------------------------------------------------- 244 public void br() 245 { 246 HTMLUtil.br(this); 247 } 248 249 //-------------------------------------------------------------------------- 250 public void br(int inNumber) 251 { 252 HTMLUtil.br(this, inNumber); 253 } 254 255 //-------------------------------------------------------------------------- 256 public void nbsp(int inNumber) 257 { 258 HTMLUtil.nbsp(this, inNumber); 259 } 260 261 //-------------------------------------------------------------------------- 262 public void hr() 263 { 264 HTMLUtil.hr(this); 265 } 266 267 //-------------------------------------------------------------------------- 268 public void hr(String inWidth) 269 { 270 HTMLUtil.hr(this, inWidth); 271 } 272 273 // Overrides for HTMLTagWithCoreEvents setters to allow method chaining. 274 275 //-------------------------------------------------------------------------- 276 @Override 277 public Center setOnClick(String inValue) 278 { 279 return (Center) super.setOnClick(inValue); 280 } 281 282 //-------------------------------------------------------------------------- 283 @Override 284 public Center setOnDblClick(String inValue) 285 { 286 return (Center) super.setOnDblClick(inValue); 287 } 288 289 //-------------------------------------------------------------------------- 290 @Override 291 public Center setOnMouseDown(String inValue) 292 { 293 return (Center) super.setOnMouseDown(inValue); 294 } 295 296 //-------------------------------------------------------------------------- 297 @Override 298 public Center setOnMouseMove(String inValue) 299 { 300 return (Center) super.setOnMouseMove(inValue); 301 } 302 303 //-------------------------------------------------------------------------- 304 @Override 305 public Center setOnMouseOut(String inValue) 306 { 307 return (Center) super.setOnMouseOut(inValue); 308 } 309 310 //-------------------------------------------------------------------------- 311 @Override 312 public Center setOnMouseOver(String inValue) 313 { 314 return (Center) super.setOnMouseOver(inValue); 315 } 316 317 //-------------------------------------------------------------------------- 318 @Override 319 public Center setOnMouseUp(String inValue) 320 { 321 return (Center) super.setOnMouseUp(inValue); 322 } 323 324 //-------------------------------------------------------------------------- 325 @Override 326 public Center setOnKeyDown(String inValue) 327 { 328 return (Center) super.setOnKeyDown(inValue); 329 } 330 331 //-------------------------------------------------------------------------- 332 @Override 333 public Center setOnKeyPress(String inValue) 334 { 335 return (Center) super.setOnKeyPress(inValue); 336 } 337 338 //-------------------------------------------------------------------------- 339 @Override 340 public Center setOnKeyUp(String inValue) 341 { 342 return (Center) super.setOnKeyUp(inValue); 343 } 344}