2 * Copyright (C) 2009 - 2012 SC 4ViewSoft SRL
\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
8 * http://www.apache.org/licenses/LICENSE-2.0
\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
16 package org.achartengine.renderer;
\r
18 import java.io.Serializable;
\r
20 import android.graphics.Paint.Cap;
\r
21 import android.graphics.Paint.Join;
\r
24 * A descriptor for the stroke style.
\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
32 /** The dot line style. */
\r
33 public static final BasicStroke DOTTED = new BasicStroke(Cap.ROUND, Join.BEVEL, 5, new float[] {
\r
35 /** The stroke cap. */
\r
37 /** The stroke join. */
\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
47 * Build a new basic stroke style.
\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
55 public BasicStroke(Cap cap, Join join, float miter, float[] intervals, float phase) {
\r
59 mIntervals = intervals;
\r
63 * Returns the stroke cap.
\r
65 * @return the stroke cap
\r
67 public Cap getCap() {
\r
72 * Returns the stroke join.
\r
74 * @return the stroke join
\r
76 public Join getJoin() {
\r
81 * Returns the stroke miter.
\r
83 * @return the stroke miter
\r
85 public float getMiter() {
\r
90 * Returns the path effect intervals.
\r
92 * @return the path effect intervals
\r
94 public float[] getIntervals() {
\r
99 * Returns the path effect phase.
\r
101 * @return the path effect phase
\r
103 public float getPhase() {
\r