1 | public final class PieLabelLinkStyle implements Serializable {↵ | | 1 | public final class AreaRendererEndType implements Serializable {↵
|
2 | ↵ | | |
|
3 | /** STANDARD. */↵ | | 2 | /** For serialization. */↵
|
4 | public static final PieLabelLinkStyle STANDARD↵ | | 3 | private static final ↵
|
5 | = new PieLabelLinkStyle("PieLabelLinkStyl↵ | | 4 | long serialVersionUID = -1774146392916359839L;↵
|
| | | 5 | ↵
|
| | | 6 | /** ↵
|
| | | 7 | * The area tapers from the first or last value down to zero. ↵
|
| | | 8 | */↵
|
| | | 9 | public static final AreaRendererEndType TAPER = new AreaRendererEndType(↵
|
6 | e.STANDARD"↵ | | 10 | "AreaRendererEndType.TAPER"↵
|
7 | );↵ | | 11 | );↵
|
|
8 | /** QUAD_CURVE. */↵ | | 12 | /** ↵
|
9 | public static final PieLabelLinkStyle QUAD_CURVE↵ | | |
|
10 | = new PieLabelLinkStyle("PieLabelLinkStyle.QUAD_CURVE");↵ | | |
|
|
11 | /** CUBIC_CURVE. */↵ | | |
|
12 | public static final PieLabelLinkStyle CUBIC_CURVE↵ | | |
|
13 | = new PieLabelLinkStyle("PieLabelLinkStyle.CUBIC_CURVE"↵ | | |
|
| | | 13 | * The area is truncated at the first or last value. ↵
|
| | | 14 | */↵
|
| | | 15 | public static final AreaRendererEndType TRUNCATE = new AreaRendererEndType(↵
|
| | | 16 | "AreaRendererEndType.TRUNCATE"↵
|
| | | 17 | );↵
|
| | | 18 | ↵
|
| | | 19 | /** ↵
|
| | | 20 | * The area is levelled at the first or last value. ↵
|
| | | 21 | */↵
|
| | | 22 | public static final AreaRendererEndType LEVEL = new AreaRendererEndType(↵
|
| | | 23 | "AreaRendererEndType.LEVEL"↵
|
14 | );↵ | | 24 | );↵
|
|
15 | /** The name. */↵ | | 25 | /** The name. */↵
|
16 | private String name;↵ | | 26 | private String name;↵
|
|
17 | /**↵ | | 27 | /**↵
|
18 | * Private constructor.↵ | | 28 | * Private constructor.↵
|
19 | *↵ | | 29 | *↵
|
20 | * @param name the name.↵ | | 30 | * @param name the name.↵
|
21 | */↵ | | 31 | */↵
|
22 | private PieLabelLinkStyle(String name) {↵ | | 32 | private AreaRendererEndType(String name) {↵
|
23 | this.name = name;↵ | | 33 | this.name = name;↵
|
24 | }↵ | | 34 | }↵
|
|
25 | /**↵ | | 35 | /**↵
|
26 | * Returns a string representing the object.↵ | | 36 | * Returns a string representing the object.↵
|
27 | *↵ | | 37 | *↵
|
28 | * @return The string.↵ | | 38 | * @return The string.↵
|
29 | */↵ | | 39 | */↵
|
30 | public String toString() {↵ | | 40 | public String toString() {↵
|
31 | return this.name;↵ | | 41 | return this.name;↵
|
32 | }↵ | | 42 | }↵
|
|
33 | /**↵ | | 43 | /**↵
|
34 | * Returns true if this object is equal to the specified ↵ | | 44 | * Returns true if this object is equal to the specified ↵
|
35 | * object, and false otherwise.↵ | | 45 | * object, and false otherwise.↵
|
36 | *↵ | | 46 | *↵
|
37 | * @param obj the object (null permitted).↵ | | 47 | * @param o the other object.↵
|
38 | *↵ | | 48 | *↵
|
39 | * @return A boolean.↵ | | 49 | * @return A boolean.↵
|
40 | */↵ | | 50 | */↵
|
41 | public boolean equals(Object obj) {↵ | | 51 | public boolean equals(Object o) {↵
|
|
42 | if (this == obj) {↵ | | 52 | if (this == o) {↵
|
43 | return true;↵ | | 53 | return true;↵
|
44 | }↵ | | 54 | }↵
|
45 | if (!(obj instanceof PieLabelLinkStyle)) {↵ | | 55 | if (!(o instanceof AreaRendererEndType)) {↵
|
46 | return false;↵ | | 56 | return false;↵
|
47 | }↵ | | 57 | }↵
|
|
48 | PieLabelLinkStyle style = (PieLabelLinkStyle) obj;↵ | | 58 | AreaRendererEndType t = (AreaRendererEndType) o;↵
|
49 | if (!this.name.equals(style.toString())) {↵ | | 59 | if (!this.name.equals(t.toString())) {↵
|
50 | return false;↵ | | 60 | return false;↵
|
51 | }↵ | | 61 | }↵
|
|
52 | return true;↵ | | 62 | return true;↵
|
53 | }↵ | | |
|
54 | ↵ | | |
|
55 | /**↵ | | |
|
56 | * Returns a hash code for this instance.↵ | | |
|
57 | * ↵ | | |
|
58 | * @return A hash code.↵ | | |
|
59 | */↵ | | |
|
60 | public int hashCode() {↵ | | |
|
61 | return this.name.hashCode();↵ | | |
|
62 | }↵ | | 63 | }↵
|
63 | ↵ | | 64 | ↵
|
64 | /**↵ | | 65 | /**↵
|
65 | * Ensures that serialization returns the unique instances.↵ | | 66 | * Ensures that serialization returns the unique instances.↵
|
66 | * ↵ | | 67 | * ↵
|
67 | * @return The object.↵ | | 68 | * @return The object.↵
|
68 | * ↵ | | 69 | * ↵
|
69 | * @throws ObjectStreamException if there is a problem.↵ | | 70 | * @throws ObjectStreamException if there is a problem.↵
|
70 | */↵ | | 71 | */↵
|
71 | private Object readResolve() throws ObjectStreamException {↵ | | 72 | private Object readResolve() throws ObjectStreamException {↵
|
72 | Object result = null;↵ | | 73 | Object result = null;↵
|
73 | if (this.equals(PieLabelLinkStyle.STANDARD)) {↵ | | 74 | if (this.equals(AreaRendererEndType.LEVEL)) {↵
|
74 | result = PieLabelLinkStyle.STANDARD;↵ | | 75 | result = AreaRendererEndType.LEVEL;↵
|
75 | }↵ | | 76 | }↵
|
76 | else if (this.equals(PieLabelLinkStyle.QUAD_CURVE)) {↵ | | 77 | else if (this.equals(↵
|
77 | result = PieLabelLinkStyle.QUAD_CURVE↵ | | 78 | AreaRendererEndType.TAPER)) {↵
|
78 | ;↵ | | 79 | result = AreaRendererEndType.TAPER;↵
|
79 | }↵ | | 80 | }↵
|
80 | else if (this.equals(PieLabelLinkStyle.CUBIC_CURVE)) {↵ | | 81 | else if (this.equals(↵
|
81 | result = PieLabelLinkStyle.CUBIC_CURV↵ | | 82 | AreaRendererEndType.TRUNCATE)) {↵
|
82 | E;↵ | | 83 | result = AreaRendererEndType.TRUNCATE;↵
|
83 | }↵ | | 84 | }↵
|
84 | return result;↵ | | 85 | return result;↵
|
85 | | | 86 |
|