001package com.hfg.svg.filtereffect;
002
003import com.hfg.svg.SVG;
004import com.hfg.svg.SvgAttr;
005import com.hfg.util.collection.CollectionUtil;
006import com.hfg.xml.XMLAttribute;
007import com.hfg.xml.XMLTag;
008
009//------------------------------------------------------------------------------
010/**
011 Object representation of an SVG (Scalable Vector Graphics) 'feFuncG' filter effect tag.
012
013 From <a href='http://www.w3.org/TR/2003/REC-SVG11-20030114/filters.html#feComponentTransfer'>
014 http://www.w3.org/TR/2003/REC-SVG11-20030114/filters.html#feComponentTransfer</a>:
015 <p style='font-style:italic'>
016 "transfer function for green component of the input graphic."
017 </p>
018 @author J. Alex Taylor, hairyfatguy.com
019 */
020//------------------------------------------------------------------------------
021// com.hfg XML/HTML Coding Library
022//
023// This library is free software; you can redistribute it and/or
024// modify it under the terms of the GNU Lesser General Public
025// License as published by the Free Software Foundation; either
026// version 2.1 of the License, or (at your option) any later version.
027//
028// This library is distributed in the hope that it will be useful,
029// but WITHOUT ANY WARRANTY; without even the implied warranty of
030// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
031// Lesser General Public License for more details.
032//
033// You should have received a copy of the GNU Lesser General Public
034// License along with this library; if not, write to the Free Software
035// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
036//
037// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com
038// jataylor@hairyfatguy.com
039//------------------------------------------------------------------------------
040
041public class SvgFeFuncG extends SvgFeFunc
042{
043   //###########################################################################
044   // CONSTRUCTORS
045   //###########################################################################
046
047   //---------------------------------------------------------------------------
048   public SvgFeFuncG()
049   {
050      super(SVG.feFuncG);
051   }
052
053   //---------------------------------------------------------------------------
054   public SvgFeFuncG(XMLTag inXMLTag)
055   {
056      this();
057
058      inXMLTag.verifyTagName(getTagName());
059
060      if (CollectionUtil.hasValues(inXMLTag.getAttributes()))
061      {
062         for (XMLAttribute attr : inXMLTag.getAttributes())
063         {
064            setAttribute(attr.clone());
065         }
066      }
067
068      java.util.List<XMLTag> subtags = inXMLTag.getSubtags();
069      if (CollectionUtil.hasValues(subtags))
070      {
071         for (XMLTag subtag : subtags)
072         {
073            addSubtag(SVG.constructFromXMLTag(subtag));
074         }
075      }
076   }
077
078   //###########################################################################
079   // PUBLIC METHODS
080   //###########################################################################
081
082   //---------------------------------------------------------------------------
083   public SvgFeFuncG setType(ComponentTransferType inValue)
084   {
085      setAttribute(SvgAttr.type, inValue);
086      return this;
087   }
088
089   //---------------------------------------------------------------------------
090   public SvgFeFuncG setTableValues(String inValue)
091   {
092      setAttribute(SvgAttr.tableValues, inValue);
093      return this;
094   }
095
096   //---------------------------------------------------------------------------
097   public SvgFeFuncG setSlope(float inValue)
098   {
099      setAttribute(SvgAttr.slope, inValue);
100      return this;
101   }
102
103   //---------------------------------------------------------------------------
104   public SvgFeFuncG setIntercept(float inValue)
105   {
106      setAttribute(SvgAttr.intercept, inValue);
107      return this;
108   }
109
110   //---------------------------------------------------------------------------
111   public SvgFeFuncG setAmplitude(float inValue)
112   {
113      setAttribute(SvgAttr.amplitude, inValue);
114      return this;
115   }
116
117   //---------------------------------------------------------------------------
118   public SvgFeFuncG setExponent(int inValue)
119   {
120      setAttribute(SvgAttr.exponent, inValue);
121      return this;
122   }
123
124   //---------------------------------------------------------------------------
125   public SvgFeFuncG setOffset(float inValue)
126   {
127      setAttribute(SvgAttr.offset, inValue);
128      return this;
129   }
130}