001package com.hfg.svg.filtereffect;
002
003import com.hfg.svg.AbstractSvgNode;
004import com.hfg.svg.SVG;
005import com.hfg.svg.SvgAttr;
006import com.hfg.svg.SvgNode;
007import com.hfg.xml.XMLTag;
008
009//------------------------------------------------------------------------------
010/**
011 Object representation of an SVG (Scalable Vector Graphics) 'feOffset' filter effect tag.
012 <div>
013 From <a href='http://www.w3.org/TR/2003/REC-SVG11-20030114/filters.html#feOffset'>
014 http://www.w3.org/TR/2003/REC-SVG11-20030114/filters.html#feOffset</a>:
015 </div>
016 <div style='font-style:italic'>
017 <p>
018 "This filter primitive offsets the input image relative to its current position in the
019 image space by the specified vector.
020 </p>
021 <p>
022 This is important for effects like drop shadows.
023 </p>
024 <p>
025 When applying this filter, the destination location may be offset by a fraction of a
026 pixel in device space. In this case a high quality viewer should make use of appropriate
027 interpolation techniques, for example bilinear or bicubic. This is especially recommended
028 for dynamic viewers where this interpolation provides visually smoother movement of images.
029 For static viewers this is less of a concern. Close attention should be made to the
030 'image-rendering' property setting to determine the authors intent."
031 </p>
032 </div>
033 @author J. Alex Taylor, hairyfatguy.com
034 */
035//------------------------------------------------------------------------------
036// com.hfg XML/HTML Coding Library
037//
038// This library is free software; you can redistribute it and/or
039// modify it under the terms of the GNU Lesser General Public
040// License as published by the Free Software Foundation; either
041// version 2.1 of the License, or (at your option) any later version.
042//
043// This library is distributed in the hope that it will be useful,
044// but WITHOUT ANY WARRANTY; without even the implied warranty of
045// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
046// Lesser General Public License for more details.
047//
048// You should have received a copy of the GNU Lesser General Public
049// License along with this library; if not, write to the Free Software
050// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
051//
052// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com
053// jataylor@hairyfatguy.com
054//------------------------------------------------------------------------------
055
056public class SvgFeOffset extends AbstractSvgNode implements SvgNode
057{
058   //###########################################################################
059   // CONSTRUCTORS
060   //###########################################################################
061
062   //---------------------------------------------------------------------------
063   public SvgFeOffset()
064   {
065      super(SVG.feOffset);
066   }
067
068   //---------------------------------------------------------------------------
069   public SvgFeOffset(XMLTag inXMLTag)
070   {
071      this();
072      initFromXMLTag(inXMLTag);
073   }
074
075   //###########################################################################
076   // PUBLIC METHODS
077   //###########################################################################
078
079   //---------------------------------------------------------------------------
080   public SvgFeOffset setColorInterpolationFilters(ColorInterpolationFilters inValue)
081   {
082      setAttribute(SvgAttr.colorInterpolationFilters, inValue);
083      return this;
084   }
085
086   //---------------------------------------------------------------------------
087   /**
088    The amount (delta) to offset the input graphic along the x-axis. The offset amount is
089    expressed in the coordinate system established by attribute primitiveUnits on
090    the 'filter' element.
091    If the attribute is not specified, then the effect is as if a value of 0 were specified.
092    */
093   public SvgFeOffset setDx(int inValue)
094   {
095      setAttribute(SvgAttr.dx, inValue);
096      return this;
097   }
098
099
100   //---------------------------------------------------------------------------
101   /**
102    The amount (delta) to offset the input graphic along the y-axis. The offset amount is 
103    expressed in the coordinate system established by attribute primitiveUnits on
104    the 'filter' element.
105    If the attribute is not specified, then the effect is as if a value of 0 were specified.
106    */
107   public SvgFeOffset setDy(int inValue)
108   {
109      setAttribute(SvgAttr.dy, inValue);
110      return this;
111   }
112
113   //---------------------------------------------------------------------------
114   public SvgFeOffset setIn(FeInput inValue)
115   {
116      setAttribute(SvgAttr.in, inValue);
117      return this;
118   }
119
120   //---------------------------------------------------------------------------
121   public SvgFeOffset setHeight(int inValue)
122   {
123      setAttribute(SvgAttr.height, inValue);
124      return this;
125   }
126
127   //---------------------------------------------------------------------------
128   public SvgFeOffset setHeight(String inValue)
129   {
130      setAttribute(SvgAttr.height, inValue);
131      return this;
132   }
133
134
135   //---------------------------------------------------------------------------
136   public SvgFeOffset setWidth(int inValue)
137   {
138      setAttribute(SvgAttr.width, inValue);
139      return this;
140   }
141
142   //---------------------------------------------------------------------------
143   public SvgFeOffset setWidth(String inValue)
144   {
145      setAttribute(SvgAttr.width, inValue);
146      return this;
147   }
148
149   //---------------------------------------------------------------------------
150   public SvgFeOffset setX(int inValue)
151   {
152      setAttribute(SvgAttr.x, inValue);
153      return this;
154   }
155
156   //---------------------------------------------------------------------------
157   public SvgFeOffset setX(String inValue)
158   {
159      setAttribute(SvgAttr.x, inValue);
160      return this;
161   }
162
163
164   //---------------------------------------------------------------------------
165   public SvgFeOffset setY(int inValue)
166   {
167      setAttribute(SvgAttr.y, inValue);
168      return this;
169   }
170
171   //---------------------------------------------------------------------------
172   public SvgFeOffset setY(String inValue)
173   {
174      setAttribute(SvgAttr.y, inValue);
175      return this;
176   }
177
178   //---------------------------------------------------------------------------
179   public SvgFeOffset setResult(String inValue)
180   {
181      setAttribute(SvgAttr.result, inValue);
182      return this;
183   }
184
185}