com.hfg.svg.SvgForeignObject Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com_hfg Show documentation
Show all versions of com_hfg Show documentation
com.hfg xml, html, svg, and bioinformatics utility library
package com.hfg.svg;
import com.hfg.util.StringUtil;
import com.hfg.xml.XMLTag;
//------------------------------------------------------------------------------
/**
* Object representation of an SVG (Scalable Vector Graphics) 'foreignObject' 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 SvgForeignObject extends AbstractSvgNode implements SvgNode
{
//**************************************************************************
// CONSTRUCTORS
//**************************************************************************
//---------------------------------------------------------------------------
public SvgForeignObject()
{
super(SVG.foreignObject);
}
//---------------------------------------------------------------------------
public SvgForeignObject(XMLTag inXMLTag)
{
this();
initFromXMLTag(inXMLTag);
}
//**************************************************************************
// PUBLIC METHODS
//**************************************************************************
//---------------------------------------------------------------------------
@Override
public SvgForeignObject setClass(String inValue)
{
return (SvgForeignObject) super.setClass(inValue);
}
//---------------------------------------------------------------------------
public SvgForeignObject setRequiredExtensions(String inValue)
{
setAttribute(SvgAttr.requiredExtensions, inValue);
return this;
}
//---------------------------------------------------------------------------
public SvgForeignObject setX(int inValue)
{
setAttribute(SvgAttr.x, inValue);
return this;
}
//---------------------------------------------------------------------------
public Integer getX()
{
String xAttr = getAttributeValue(SvgAttr.x);
return (StringUtil.isSet(xAttr) ? (int) Float.parseFloat(xAttr) : null);
}
//---------------------------------------------------------------------------
public SvgForeignObject setY(int inValue)
{
setAttribute(SvgAttr.y, inValue);
return this;
}
//---------------------------------------------------------------------------
public Integer getY()
{
String yAttr = getAttributeValue(SvgAttr.y);
return (StringUtil.isSet(yAttr) ? (int) Float.parseFloat(yAttr) : null);
}
//---------------------------------------------------------------------------
public SvgForeignObject setWidth(int inValue)
{
setAttribute(SvgAttr.width, inValue);
return this;
}
//---------------------------------------------------------------------------
public int getWidth()
{
return (int) Float.parseFloat(getAttributeValue(SvgAttr.width));
}
//---------------------------------------------------------------------------
public SvgForeignObject setHeight(int inValue)
{
setAttribute(SvgAttr.width, inValue);
return this;
}
//---------------------------------------------------------------------------
public int getHeight()
{
return (int) Float.parseFloat(getAttributeValue(SvgAttr.height));
}
}