All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hfg.html.Center Maven / Gradle / Ivy

There is a newer version: 20240423
Show newest version
package com.hfg.html;


import com.hfg.xml.XMLNode;

//------------------------------------------------------------------------------
/**
 * Represents a center (<center>) tag.
 *
 * @author J. Alex Taylor, hairyfatguy.com
 */
//------------------------------------------------------------------------------
// com.hfg XML/HTML Coding Library
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//
// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com
// [email protected]
//------------------------------------------------------------------------------

public class Center extends HTMLTagWithCoreEvents
{

   //##########################################################################
   // CONSTRUCTORS
   //##########################################################################

   //--------------------------------------------------------------------------
   public Center()
   {
      super(HTML.CENTER);
   }

   //--------------------------------------------------------------------------
   public Center(String inContent)
   {
      this();
      addContent(inContent);
   }

   //--------------------------------------------------------------------------
   public Center(HTMLTag inContent)
   {
      this();
      addSubtag(inContent);
   }

   //--------------------------------------------------------------------------
   public Center(XMLNode inXMLNode)
   {
      this();
      initFromXMLNode(inXMLNode);
   }

   //##########################################################################
   // PUBLIC METHODS
   //##########################################################################

   //---------------------------------------------------------------------------
   public Div addDiv()
   {
      Div div = new Div();
      addSubtag(div);

      return div;
   }

   //--------------------------------------------------------------------------
   public Form addForm()
   {
      Form form = new Form();
      addSubtag(form);

      return form;
   }

   //--------------------------------------------------------------------------
   public Form addForm(String inFormName)
   {
      Form form = new Form(inFormName);
      addSubtag(form);

      return form;
   }


   //--------------------------------------------------------------------------
   public Img addImage(String inSrc)
   {
      Img image = new Img(inSrc);
      addSubtag(image);

      return image;
   }

   //--------------------------------------------------------------------------
   public Link addLink()
   {
      Link link = new Link();
      addSubtag(link);

      return link;
   }

   //--------------------------------------------------------------------------
   public Link addLink(CharSequence inURL)
   {
      Link link = new Link(inURL);
      addSubtag(link);

      return link;
   }

   //--------------------------------------------------------------------------
   public Link addLink(CharSequence inURL, String inContent)
   {
      Link link = new Link(inURL, inContent);
      addSubtag(link);

      return link;
   }

   //--------------------------------------------------------------------------
   public Nobr addNobr()
   {
      Nobr nobr = new Nobr();
      addSubtag(nobr);

      return nobr;
   }

   //--------------------------------------------------------------------------
   public Nobr addNobr(String inContent)
   {
      Nobr nobr = new Nobr(inContent);
      addSubtag(nobr);

      return nobr;
   }

   //--------------------------------------------------------------------------
   public Nobr addNobr(HTMLTag inContent)
   {
      Nobr nobr = new Nobr(inContent);
      addSubtag(nobr);

      return nobr;
   }

   //--------------------------------------------------------------------------
   public Pre addPre()
   {
      Pre pre = new Pre();
      addSubtag(pre);

      return pre;
   }

   //--------------------------------------------------------------------------
   public Pre addPre(String inContent)
   {
      Pre pre = new Pre(inContent);
      addSubtag(pre);

      return pre;
   }

   //--------------------------------------------------------------------------
   public Pre addPre(HTMLTag inContent)
   {
      Pre pre = new Pre(inContent);
      addSubtag(pre);

      return pre;
   }

   //--------------------------------------------------------------------------
   public Span addSpan()
   {
      Span span = new Span();
      addSubtag(span);

      return span;
   }

   //--------------------------------------------------------------------------
   public Span addSpan(String inContent)
   {
      Span span = new Span(inContent);
      addSubtag(span);

      return span;
   }

   //--------------------------------------------------------------------------
   public Span addSpan(HTMLTag inContent)
   {
      Span span = new Span(inContent);
      addSubtag(span);

      return span;
   }

   //--------------------------------------------------------------------------
   public Table addTable()
   {
      Table table = new Table();
      addSubtag(table);

      return table;
   }

   //--------------------------------------------------------------------------
   public Ul addUnorderedList()
   {
      Ul ul = new Ul();
      addSubtag(ul);

      return ul;
   }


   //--------------------------------------------------------------------------
   public Center setStyle(String inValue)
   {
      setAttribute(HTML.STYLE, inValue);

      return this;
   }

   //--------------------------------------------------------------------------
   public void br()
   {
      HTMLUtil.br(this);
   }

   //--------------------------------------------------------------------------
   public void br(int inNumber)
   {
      HTMLUtil.br(this, inNumber);
   }

   //--------------------------------------------------------------------------
   public void nbsp(int inNumber)
   {
      HTMLUtil.nbsp(this, inNumber);
   }

   //--------------------------------------------------------------------------
   public void hr()
   {
      HTMLUtil.hr(this);
   }

   //--------------------------------------------------------------------------
   public void hr(String inWidth)
   {
      HTMLUtil.hr(this, inWidth);
   }

   // Overrides for HTMLTagWithCoreEvents setters to allow method chaining.

   //--------------------------------------------------------------------------
   @Override
   public Center setOnClick(String inValue)
   {
      return (Center) super.setOnClick(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Center setOnDblClick(String inValue)
   {
      return (Center) super.setOnDblClick(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Center setOnMouseDown(String inValue)
   {
      return (Center) super.setOnMouseDown(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Center setOnMouseMove(String inValue)
   {
      return (Center) super.setOnMouseMove(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Center setOnMouseOut(String inValue)
   {
      return (Center) super.setOnMouseOut(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Center setOnMouseOver(String inValue)
   {
      return (Center) super.setOnMouseOver(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Center setOnMouseUp(String inValue)
   {
      return (Center) super.setOnMouseUp(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Center setOnKeyDown(String inValue)
   {
      return (Center) super.setOnKeyDown(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Center setOnKeyPress(String inValue)
   {
      return (Center) super.setOnKeyPress(inValue);
   }

   //--------------------------------------------------------------------------
   @Override
   public Center setOnKeyUp(String inValue)
   {
      return (Center) super.setOnKeyUp(inValue);
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy