1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.rendering.macro.chart

File ChartMacroParameters.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

0
12
12
1
165
67
12
1
1
12
1

Classes

Class Line # Actions
ChartMacroParameters 31 12 0% 12 0
1.0100%
 

Contributing tests

This file is covered by 8 tests. .

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.rendering.macro.chart;
21   
22    import org.xwiki.properties.annotation.PropertyDescription;
23    import org.xwiki.properties.annotation.PropertyMandatory;
24   
25    /**
26    * Parameters for chart macro.
27    *
28    * @version $Id: e086c2fd9c8bbd4984ad286321d56d38df4d4628 $
29    * @since 2.0M1
30    */
 
31    public class ChartMacroParameters
32    {
33    /**
34    * @see ChartMacroParameters#getTitle()
35    */
36    private String title;
37   
38    /**
39    * @see ChartMacroParameters#getHeight()
40    */
41    private int height = 300;
42   
43    /**
44    * @see ChartMacroParameters#getWidth()
45    */
46    private int width = 400;
47   
48    /**
49    * @see ChartMacroParameters#getType()
50    */
51    private String type;
52   
53    /**
54    * @see ChartMacroParameters#getSource()
55    */
56    private String source;
57   
58    /**
59    * @see ChartMacroParameters#getParams()
60    */
61    private String params;
62   
63    /**
64    * @return The title of the chart.
65    */
 
66  39 toggle public String getTitle()
67    {
68  39 return title;
69    }
70   
71    /**
72    * @param title - refer to {@link #getTitle()}.
73    */
 
74  2 toggle @PropertyDescription("The title of the chart (appears on top of the chart image)")
75    public void setTitle(String title)
76    {
77  2 this.title = title;
78    }
79   
80    /**
81    * @return The width of the chart.
82    */
 
83  24 toggle public int getWidth()
84    {
85  24 return width;
86    }
87   
88    /**
89    * @param width - refer to {@link #getWidth()}.
90    */
 
91  3 toggle @PropertyDescription("The width of the generated chart image")
92    public void setWidth(int width)
93    {
94  3 this.width = width;
95    }
96   
97    /**
98    * @return The height of the chart.
99    */
 
100  24 toggle public int getHeight()
101    {
102  24 return height;
103    }
104   
105    /**
106    * @param height - refer to {@link #getHeight()}.
107    */
 
108  2 toggle @PropertyDescription("The height of the generated chart image")
109    public void setHeight(int height)
110    {
111  2 this.height = height;
112    }
113   
114    /**
115    * @return the type of the chart.
116    */
 
117  24 toggle public String getType()
118    {
119  24 return type;
120    }
121   
122    /**
123    * @param chartType - refer to {@link #getType()}.
124    */
 
125  15 toggle @PropertyMandatory
126    @PropertyDescription("The type of the chart (Ex. pie, line, area or bar)")
127    public void setType(String chartType)
128    {
129  15 this.type = chartType;
130    }
131   
132    /**
133    * @return a string describing the data source
134    */
 
135  24 toggle public String getSource()
136    {
137  24 return source;
138    }
139   
140    /**
141    * @param source - refer to {@link #getSource()}
142    */
 
143  9 toggle @PropertyDescription("The string describing the type of input data source (Ex. xdom or inline)")
144    public void setSource(String source)
145    {
146  9 this.source = source;
147    }
148   
149    /**
150    * @return Additional parameters for the data source.
151    */
 
152  39 toggle public String getParams()
153    {
154  39 return params;
155    }
156   
157    /**
158    * @param params Additional parameters for the data source.
159    */
 
160  12 toggle @PropertyDescription("Additional parameters for the data source")
161    public void setParams(String params)
162    {
163  12 this.params = params;
164    }
165    }