1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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 }