create changelog entry
[debian/openrocket] / android-libraries / achartengine / src / org / achartengine / renderer / SimpleSeriesRenderer.java
1 /**\r
2  * Copyright (C) 2009 - 2012 SC 4ViewSoft SRL\r
3  *  \r
4  * Licensed under the Apache License, Version 2.0 (the "License");\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *  \r
8  *      http://www.apache.org/licenses/LICENSE-2.0\r
9  *  \r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an "AS IS" BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  */\r
16 package org.achartengine.renderer;\r
17 \r
18 import java.io.Serializable;\r
19 \r
20 import android.graphics.Color;\r
21 import android.graphics.Paint.Align;\r
22 \r
23 /**\r
24  * A simple series renderer.\r
25  */\r
26 public class SimpleSeriesRenderer implements Serializable {\r
27   /** The series color. */\r
28   private int mColor = Color.BLUE;\r
29   /** If the values should be displayed above the chart points. */\r
30   private boolean mDisplayChartValues;\r
31   /** The chart values text size. */\r
32   private float mChartValuesTextSize = 10;\r
33   /** The chart values text alignment. */\r
34   private Align mChartValuesTextAlign = Align.CENTER;\r
35   /** The chart values spacing from the data point. */\r
36   private float mChartValuesSpacing = 5f;\r
37   /** The stroke style. */\r
38   private BasicStroke mStroke;\r
39   /** If gradient is enabled. */\r
40   private boolean mGradientEnabled = false;\r
41   /** The gradient start value. */\r
42   private double mGradientStartValue;\r
43   /** The gradient start color. */\r
44   private int mGradientStartColor;\r
45   /** The gradient stop value. */\r
46   private double mGradientStopValue;\r
47   /** The gradient stop color. */\r
48   private int mGradientStopColor;\r
49 \r
50   /**\r
51    * Returns the series color.\r
52    * \r
53    * @return the series color\r
54    */\r
55   public int getColor() {\r
56     return mColor;\r
57   }\r
58 \r
59   /**\r
60    * Sets the series color.\r
61    * \r
62    * @param color the series color\r
63    */\r
64   public void setColor(int color) {\r
65     mColor = color;\r
66   }\r
67 \r
68   /**\r
69    * Returns if the chart point values should be displayed as text.\r
70    * \r
71    * @return if the chart point values should be displayed as text\r
72    */\r
73   public boolean isDisplayChartValues() {\r
74     return mDisplayChartValues;\r
75   }\r
76 \r
77   /**\r
78    * Sets if the chart point values should be displayed as text.\r
79    * \r
80    * @param display if the chart point values should be displayed as text\r
81    */\r
82   public void setDisplayChartValues(boolean display) {\r
83     mDisplayChartValues = display;\r
84   }\r
85 \r
86   /**\r
87    * Returns the chart values text size.\r
88    * \r
89    * @return the chart values text size\r
90    */\r
91   public float getChartValuesTextSize() {\r
92     return mChartValuesTextSize;\r
93   }\r
94 \r
95   /**\r
96    * Sets the chart values text size.\r
97    * \r
98    * @param textSize the chart values text size\r
99    */\r
100   public void setChartValuesTextSize(float textSize) {\r
101     mChartValuesTextSize = textSize;\r
102   }\r
103 \r
104   /**\r
105    * Returns the chart values text align.\r
106    * \r
107    * @return the chart values text align\r
108    */\r
109   public Align getChartValuesTextAlign() {\r
110     return mChartValuesTextAlign;\r
111   }\r
112 \r
113   /**\r
114    * Sets the chart values text align.\r
115    * \r
116    * @param align the chart values text align\r
117    */\r
118   public void setChartValuesTextAlign(Align align) {\r
119     mChartValuesTextAlign = align;\r
120   }\r
121 \r
122   /**\r
123    * Returns the chart values spacing from the data point.\r
124    * \r
125    * @return the chart values spacing\r
126    */\r
127   public float getChartValuesSpacing() {\r
128     return mChartValuesSpacing;\r
129   }\r
130 \r
131   /**\r
132    * Sets the chart values spacing from the data point.\r
133    * \r
134    * @param spacing the chart values spacing (in pixels) from the chart data\r
135    *          point\r
136    */\r
137   public void setChartValuesSpacing(float spacing) {\r
138     mChartValuesSpacing = spacing;\r
139   }\r
140 \r
141   /**\r
142    * Returns the stroke style.\r
143    * \r
144    * @return the stroke style\r
145    */\r
146   public BasicStroke getStroke() {\r
147     return mStroke;\r
148   }\r
149 \r
150   /**\r
151    * Sets the stroke style.\r
152    * \r
153    * @param stroke the stroke style\r
154    */\r
155   public void setStroke(BasicStroke stroke) {\r
156     mStroke = stroke;\r
157   }\r
158 \r
159   /**\r
160    * Returns the gradient is enabled value.\r
161    * \r
162    * @return the gradient enabled\r
163    */\r
164   public boolean isGradientEnabled() {\r
165     return mGradientEnabled;\r
166   }\r
167 \r
168   /**\r
169    * Sets the gradient enabled value.\r
170    * \r
171    * @param enabled the gradient enabled\r
172    */\r
173   public void setGradientEnabled(boolean enabled) {\r
174     mGradientEnabled = enabled;\r
175   }\r
176 \r
177   /**\r
178    * Returns the gradient start value.\r
179    * \r
180    * @return the gradient start value\r
181    */\r
182   public double getGradientStartValue() {\r
183     return mGradientStartValue;\r
184   }\r
185 \r
186   /**\r
187    * Returns the gradient start color.\r
188    * \r
189    * @return the gradient start color\r
190    */\r
191   public int getGradientStartColor() {\r
192     return mGradientStartColor;\r
193   }\r
194 \r
195   /**\r
196    * Sets the gradient start value and color.\r
197    * \r
198    * @param start the gradient start value\r
199    * @param color the gradient start color\r
200    */\r
201   public void setGradientStart(double start, int color) {\r
202     mGradientStartValue = start;\r
203     mGradientStartColor = color;\r
204   }\r
205 \r
206   /**\r
207    * Returns the gradient stop value.\r
208    * \r
209    * @return the gradient stop value\r
210    */\r
211   public double getGradientStopValue() {\r
212     return mGradientStopValue;\r
213   }\r
214 \r
215   /**\r
216    * Returns the gradient stop color.\r
217    * \r
218    * @return the gradient stop color\r
219    */\r
220   public int getGradientStopColor() {\r
221     return mGradientStopColor;\r
222   }\r
223 \r
224   /**\r
225    * Sets the gradient stop value and color.\r
226    * \r
227    * @param start the gradient stop value\r
228    * @param color the gradient stop color\r
229    */\r
230   public void setGradientStop(double start, int color) {\r
231     mGradientStopValue = start;\r
232     mGradientStopColor = color;\r
233   }\r
234 \r
235 }\r