001package com.hfg.svg.filtereffect;
002
003import com.hfg.svg.AbstractSvgNode;
004import com.hfg.svg.SVG;
005import com.hfg.svg.SvgAttr;
006import com.hfg.graphics.ColorUtil;
007import com.hfg.xml.XMLTag;
008
009import java.awt.*;
010
011//------------------------------------------------------------------------------
012/**
013 Object representation of an SVG (Scalable Vector Graphics) 'feFlood' filter effect tag.
014
015 From <a href='http://www.w3.org/TR/2003/REC-SVG11-20030114/filters.html#feFlood'>
016 http://www.w3.org/TR/2003/REC-SVG11-20030114/filters.html#feFlood</a>:
017 <p style='font-style:italic'>
018 "This filter primitive creates a rectangle filled with the color and opacity values
019 from properties 'flood-color' and 'flood-opacity'. The rectangle is as large as the
020 filter primitive subregion established by the x, y, width and height attributes on
021 the 'feFlood' element."
022 </p>
023 @author J. Alex Taylor, hairyfatguy.com
024 */
025//------------------------------------------------------------------------------
026// com.hfg XML/HTML Coding Library
027//
028// This library is free software; you can redistribute it and/or
029// modify it under the terms of the GNU Lesser General Public
030// License as published by the Free Software Foundation; either
031// version 2.1 of the License, or (at your option) any later version.
032//
033// This library is distributed in the hope that it will be useful,
034// but WITHOUT ANY WARRANTY; without even the implied warranty of
035// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
036// Lesser General Public License for more details.
037//
038// You should have received a copy of the GNU Lesser General Public
039// License along with this library; if not, write to the Free Software
040// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
041//
042// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com
043// jataylor@hairyfatguy.com
044//------------------------------------------------------------------------------
045
046
047public class SvgFeFlood extends AbstractSvgNode
048{
049   //###########################################################################
050   // CONSTRUCTORS
051   //###########################################################################
052
053   //---------------------------------------------------------------------------
054   public SvgFeFlood()
055   {
056      super(SVG.feFlood);
057   }
058
059   //---------------------------------------------------------------------------
060   public SvgFeFlood(XMLTag inXMLTag)
061   {
062      this();
063      initFromXMLTag(inXMLTag);
064   }
065
066   //###########################################################################
067   // PUBLIC METHODS
068   //###########################################################################
069
070   //---------------------------------------------------------------------------
071   public SvgFeFlood setColorInterpolationFilters(ColorInterpolationFilters inValue)
072   {
073      setAttribute(SvgAttr.colorInterpolationFilters, inValue);
074      return this;
075   }
076
077   //---------------------------------------------------------------------------
078   public SvgFeFlood setFloodColor(Color inValue)
079   {
080      setAttribute(SvgAttr.floodColor, "#" + ColorUtil.colorToHex(inValue));
081      return this;
082   }
083
084
085   //---------------------------------------------------------------------------
086   public SvgFeFlood setFloodOpacity(String inValue)
087   {
088      setAttribute(SvgAttr.floodOpacity, inValue);
089      return this;
090   }
091
092   //---------------------------------------------------------------------------
093   public SvgFeFlood setIn(FeInput inValue)
094   {
095      setAttribute(SvgAttr.in, inValue);
096      return this;
097   }
098
099   //---------------------------------------------------------------------------
100   public SvgFeFlood setHeight(int inValue)
101   {
102      setAttribute(SvgAttr.height, inValue);
103      return this;
104   }
105
106   //---------------------------------------------------------------------------
107   public SvgFeFlood setHeight(String inValue)
108   {
109      setAttribute(SvgAttr.height, inValue);
110      return this;
111   }
112
113   //---------------------------------------------------------------------------
114   public SvgFeFlood setResult(String inValue)
115   {
116      setAttribute(SvgAttr.result, inValue);
117      return this;
118   }
119
120   //---------------------------------------------------------------------------
121   public SvgFeFlood setWidth(int inValue)
122   {
123      setAttribute(SvgAttr.width, inValue);
124      return this;
125   }
126
127   //---------------------------------------------------------------------------
128   public SvgFeFlood setWidth(String inValue)
129   {
130      setAttribute(SvgAttr.width, inValue);
131      return this;
132   }
133
134   //---------------------------------------------------------------------------
135   public SvgFeFlood setX(int inValue)
136   {
137      setAttribute(SvgAttr.x, inValue);
138      return this;
139   }
140
141   //---------------------------------------------------------------------------
142   public SvgFeFlood setX(String inValue)
143   {
144      setAttribute(SvgAttr.x, inValue);
145      return this;
146   }
147
148
149   //---------------------------------------------------------------------------
150   public SvgFeFlood setY(int inValue)
151   {
152      setAttribute(SvgAttr.y, inValue);
153      return this;
154   }
155
156   //---------------------------------------------------------------------------
157   public SvgFeFlood setY(String inValue)
158   {
159      setAttribute(SvgAttr.y, inValue);
160      return this;
161   }
162
163
164}