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) 'feSpotLight' filter effect tag. 012 013 @author J. Alex Taylor, hairyfatguy.com 014 */ 015//------------------------------------------------------------------------------ 016// com.hfg XML/HTML Coding Library 017// 018// This library is free software; you can redistribute it and/or 019// modify it under the terms of the GNU Lesser General Public 020// License as published by the Free Software Foundation; either 021// version 2.1 of the License, or (at your option) any later version. 022// 023// This library is distributed in the hope that it will be useful, 024// but WITHOUT ANY WARRANTY; without even the implied warranty of 025// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 026// Lesser General Public License for more details. 027// 028// You should have received a copy of the GNU Lesser General Public 029// License along with this library; if not, write to the Free Software 030// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 031// 032// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com 033// jataylor@hairyfatguy.com 034//------------------------------------------------------------------------------ 035 036public class SvgFeSpotLight extends SvgLightSource implements SvgNode 037{ 038 //########################################################################### 039 // CONSTRUCTORS 040 //########################################################################### 041 042 //--------------------------------------------------------------------------- 043 public SvgFeSpotLight() 044 { 045 super(SVG.feSpotLight); 046 } 047 048 //--------------------------------------------------------------------------- 049 public SvgFeSpotLight(XMLTag inXMLTag) 050 { 051 this(); 052 initFromXMLTag(inXMLTag); 053 } 054 055 //########################################################################### 056 // PUBLIC METHODS 057 //########################################################################### 058 059 //--------------------------------------------------------------------------- 060 /** 061 X location for the light source in the coordinate system established by attribute 062 primitiveUnits on the 'filter' element. 063 If the attribute is not specified, then the effect is as if a value of 0 were specified. 064 */ 065 public SvgFeSpotLight setX(int inValue) 066 { 067 setAttribute(SvgAttr.x, inValue); 068 return this; 069 } 070 071 //--------------------------------------------------------------------------- 072 /** 073 Y location for the light source in the coordinate system established by attribute 074 primitiveUnits on the 'filter' element. 075 If the attribute is not specified, then the effect is as if a value of 0 were specified. 076 */ 077 public SvgFeSpotLight setY(int inValue) 078 { 079 setAttribute(SvgAttr.y, inValue); 080 return this; 081 } 082 083 //--------------------------------------------------------------------------- 084 /** 085 Z location for the light source in the coordinate system established by attribute 086 primitiveUnits on the 'filter' element. 087 If the attribute is not specified, then the effect is as if a value of 0 were specified. 088 */ 089 public SvgFeSpotLight setZ(int inValue) 090 { 091 setAttribute(SvgAttr.z, inValue); 092 return this; 093 } 094 095 //--------------------------------------------------------------------------- 096 /** 097 X location in the coordinate system established by attribute primitiveUnits 098 on the 'filter' element of the point at which the light source is pointing. 099 If the attribute is not specified, then the effect is as if a value of 0 were specified. 100 */ 101 public SvgFeSpotLight setPointsAtX(int inValue) 102 { 103 setAttribute(SvgAttr.pointsAtX, inValue); 104 return this; 105 } 106 107 //--------------------------------------------------------------------------- 108 /** 109 Y location in the coordinate system established by attribute primitiveUnits 110 on the 'filter' element of the point at which the light source is pointing. 111 If the attribute is not specified, then the effect is as if a value of 0 were specified. 112 */ 113 public SvgFeSpotLight setPointsAtY(int inValue) 114 { 115 setAttribute(SvgAttr.pointsAtY, inValue); 116 return this; 117 } 118 119 //--------------------------------------------------------------------------- 120 /** 121 Z location of the point at which the light source is pointing, assuming that, 122 in the initial coordinate system, the positive Z-axis comes out towards the 123 person viewing the content and assuming that one unit along the Z-axis equals 124 one unit in X or Y. 125 If the attribute is not specified, then the effect is as if a value of 0 were specified. 126 */ 127 public SvgFeSpotLight setPointsAtZ(int inValue) 128 { 129 setAttribute(SvgAttr.pointsAtZ, inValue); 130 return this; 131 } 132 133 //--------------------------------------------------------------------------- 134 /** 135 Exponent value controlling the focus for the light source. 136 If the attribute is not specified, then the effect is as if a value of 1 were specified. 137 */ 138 public SvgFeSpotLight setSpecularExponent(int inValue) 139 { 140 setAttribute(SvgAttr.specularExponent, inValue); 141 return this; 142 } 143 144 //--------------------------------------------------------------------------- 145 /** 146 A limiting cone which restricts the region where the light is projected. 147 No light is projected outside the cone. limitingConeAngle represents the 148 angle between the spot light axis (i.e. the axis between the light source 149 and the point to which it is pointing at) and the spot light cone. User 150 agents should apply a smoothing technique such as anti-aliasing at the 151 boundary of the cone. 152 If no value is specified, then no limiting cone will be applied. 153 */ 154 public SvgFeSpotLight setLimitingConeAngle(int inValue) 155 { 156 setAttribute(SvgAttr.limitingConeAngle, inValue); 157 return this; 158 } 159}