View Javadoc

1   /*
2    * $Header: /cvsroot/jdbforms/dbforms/src/org/dbforms/taglib/cewolf/CewolfTimeSeriesFieldTag.java,v 1.2 2006/03/16 14:23:02 hkollmann Exp $
3    * $Revision: 1.2 $
4    * $Date: 2006/03/16 14:23:02 $
5    *
6    * DbForms - a Rapid Application Development Framework
7    * Copyright (C) 2001 Joachim Peer <joepeer@excite.com>
8    *
9    * This library is free software; you can redistribute it and/or
10   * modify it under the terms of the GNU Lesser General Public
11   * License as published by the Free Software Foundation; either
12   * version 2.1 of the License, or (at your option) any later version.
13   *
14   * This library is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17   * Lesser General Public License for more details.
18   *
19   * You should have received a copy of the GNU Lesser General Public
20   * License along with this library; if not, write to the Free Software
21   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
22   */
23  package org.dbforms.taglib.cewolf;
24  
25  import javax.servlet.jsp.JspException;
26  
27  import org.dbforms.taglib.AbstractDbBaseHandlerTag;
28  /***
29   * 
30   * This tag is a sub tag of DbTimeChart and describes a single series for the chart.
31   * 
32   * @author Henner Kollmann
33   * 
34   */
35  public class CewolfTimeSeriesFieldTag extends AbstractDbBaseHandlerTag
36  		implements javax.servlet.jsp.tagext.TryCatchFinally {
37  
38  	private String title;
39  	private String fieldName;
40  	private String color;
41  
42  
43  	public void doFinally() {
44  		super.doFinally();
45  		title = null;
46  		fieldName = null;
47  		color = null;
48  	}
49  
50  	public int doStartTag() throws JspException {
51  		if (getParent() != null
52  				&& getParent() instanceof CewolfTimeSeriesDataTag) {
53  			CewolfTimeSeriesDataTag p = (CewolfTimeSeriesDataTag) getParent();	
54  			p.addField(this);
55  		} else {
56  			throw new JspException(
57  					"TimeSeries element must be placed inside a TimeChart element!");
58  		}
59  		return EVAL_BODY_INCLUDE;
60  	}
61  
62  	/***
63  	 * Returns the fieldName.
64  	 * 
65  	 * @return String
66  	 */
67  	public String getFieldName() {
68  		return fieldName;
69  	}
70  
71  	/***
72  	 * Returns the title.
73  	 * 
74  	 * @return String
75  	 */
76  	public String getTitle() {
77  		return title;
78  	}
79  
80  	/***
81  	 * Sets the fieldName.
82  	 * 
83  	 * @param fieldName
84  	 *            The fieldName to set
85  	 */
86  	public void setFieldName(String fieldName) {
87  		this.fieldName = fieldName;
88  	}
89  
90  	/***
91  	 * Sets the title.
92  	 * 
93  	 * @param title
94  	 *            The title to set
95  	 */
96  	public void setTitle(String title) {
97  		this.title = title;
98  	}
99  
100 	public void setColor(String color) {
101 		this.color = color;
102 	}
103 
104 	public String getColor() {
105 		return color;
106 	}
107 }