01: /* ================================================================
02: * Cewolf : Chart enabling Web Objects Framework
03: * ================================================================
04: *
05: * Project Info: http://cewolf.sourceforge.net
06: * Project Lead: Guido Laures (guido@laures.de);
07: *
08: * (C) Copyright 2002, by Guido Laures
09: *
10: * This library is free software; you can redistribute it and/or modify it under the terms
11: * of the GNU Lesser General Public License as published by the Free Software Foundation;
12: * either version 2.1 of
13: * the License, or (at your option) any later version.
14: *
15: * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
16: * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17: * See the GNU Lesser General Public License for more details.
18: *
19: * You should have received a copy of the GNU Lesser General Public License along with this
20: * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
21: * Boston, MA 02111-1307, USA.
22: */
23:
24: package de.laures.cewolf.taglib.tags;
25:
26: import javax.servlet.jsp.JspException;
27:
28: /**
29: * Tag <texture> which defines a texture paint.
30: * @author Guido Laures
31: */
32: public class TextureTag extends CewolfBodyTag {
33:
34: private String image;
35: private int width;
36: private int height;
37:
38: public int doEndTag() throws JspException {
39: String realFileName = pageContext.getServletContext()
40: .getRealPath(image);
41: ((Painted) getParent()).setPaint(new SerializableTexturePaint(
42: realFileName, width, height));
43: return doAfterEndTag(EVAL_PAGE);
44: }
45:
46: protected void reset() {
47: }
48:
49: public void setImage(String s) {
50: this .image = s;
51: }
52:
53: public void setWidth(int width) {
54: this .width = width;
55: }
56:
57: public void setHeight(int height) {
58: this.height = height;
59: }
60: }
|