create changelog entry
[debian/openrocket] / android-libraries / achartengine / src / org / achartengine / renderer / BasicStroke.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.Paint.Cap;\r
21 import android.graphics.Paint.Join;\r
22 \r
23 /**\r
24  * A descriptor for the stroke style.\r
25  */\r
26 public class BasicStroke implements Serializable {\r
27   /** The solid line style. */\r
28   public static final BasicStroke SOLID = new BasicStroke(Cap.BUTT, Join.MITER, 4, null, 0);\r
29   /** The dashed line style. */\r
30   public static final BasicStroke DASHED = new BasicStroke(Cap.ROUND, Join.BEVEL, 10, new float[] {\r
31       10, 10 }, 1);\r
32   /** The dot line style. */\r
33   public static final BasicStroke DOTTED = new BasicStroke(Cap.ROUND, Join.BEVEL, 5, new float[] {\r
34       2, 10 }, 1);\r
35   /** The stroke cap. */\r
36   private Cap mCap;\r
37   /** The stroke join. */\r
38   private Join mJoin;\r
39   /** The stroke miter. */\r
40   private float mMiter;\r
41   /** The path effect intervals. */\r
42   private float[] mIntervals;\r
43   /** The path effect phase. */\r
44   private float mPhase;\r
45 \r
46   /**\r
47    * Build a new basic stroke style.\r
48    * \r
49    * @param cap the stroke cap\r
50    * @param join the stroke join\r
51    * @param miter the stroke miter\r
52    * @param intervals the path effect intervals\r
53    * @param phase the path effect phase\r
54    */\r
55   public BasicStroke(Cap cap, Join join, float miter, float[] intervals, float phase) {\r
56     mCap = cap;\r
57     mJoin = join;\r
58     mMiter = miter;\r
59     mIntervals = intervals;\r
60   }\r
61 \r
62   /**\r
63    * Returns the stroke cap.\r
64    * \r
65    * @return the stroke cap\r
66    */\r
67   public Cap getCap() {\r
68     return mCap;\r
69   }\r
70 \r
71   /**\r
72    * Returns the stroke join.\r
73    * \r
74    * @return the stroke join\r
75    */\r
76   public Join getJoin() {\r
77     return mJoin;\r
78   }\r
79 \r
80   /**\r
81    * Returns the stroke miter.\r
82    * \r
83    * @return the stroke miter\r
84    */\r
85   public float getMiter() {\r
86     return mMiter;\r
87   }\r
88 \r
89   /**\r
90    * Returns the path effect intervals.\r
91    * \r
92    * @return the path effect intervals\r
93    */\r
94   public float[] getIntervals() {\r
95     return mIntervals;\r
96   }\r
97 \r
98   /**\r
99    * Returns the path effect phase.\r
100    * \r
101    * @return the path effect phase\r
102    */\r
103   public float getPhase() {\r
104     return mPhase;\r
105   }\r
106 \r
107 }\r