1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 package net.sourceforge.jdatebutton.javafx;
24
25 import java.awt.Point;
26
27 import javafx.scene.paint.Color;
28 import javafx.scene.shape.Polygon;
29
30
31
32
33 public enum ArrowIcon {
34
35
36
37 UP(new Point(1, 9), new Point(5, 1), new Point(9, 9)),
38
39
40
41
42 DOWN(new Point(1, 1), new Point(5, 9), new Point(9, 1)),
43
44
45
46
47 LEFT(new Point(1, 5), new Point(9, 1), new Point(9, 9)),
48
49
50
51
52 RIGHT(new Point(1, 1), new Point(1, 9), new Point(9, 5)),
53
54
55
56
57 DOUBLEUP(new Point(1, 5), new Point(5, 1), new Point(9, 5), new Point(5, 5), new Point(9, 9), new Point(1, 9), new Point(5, 5)),
58
59
60
61
62 DOUBLEDOWN(new Point(1, 1), new Point(1, 9), new Point(5, 5), new Point(9, 5), new Point(5, 9), new Point(1, 5), new Point(5, 5)),
63
64
65
66
67 DOUBLELEFT(new Point(1, 5), new Point(5, 1), new Point(5, 5), new Point(9, 1), new Point(9, 9), new Point(5, 5), new Point(5, 9)),
68
69
70
71
72 DOUBLERIGHT(new Point(1, 1), new Point(1, 9), new Point(5, 5), new Point(5, 9), new Point(9, 5), new Point(5, 1), new Point(5, 5));
73
74
75
76
77 private final Double[] thePoints;
78
79
80
81
82
83 ArrowIcon(final Point... pPoints) {
84
85 int myNumPoints = pPoints.length;
86 thePoints = new Double[myNumPoints << 1];
87
88
89 for (int i = 0, j = 0; i < myNumPoints; i++, j += 2) {
90
91 thePoints[j] = Double.valueOf(pPoints[i].x);
92 thePoints[j + 1] = Double.valueOf(pPoints[i].y);
93 }
94 }
95
96
97
98
99
100 public Polygon getArrow() {
101
102 Polygon myArrow = new Polygon();
103
104
105 myArrow.setStroke(Color.GRAY);
106 myArrow.setFill(Color.BLACK);
107
108
109 myArrow.getPoints().addAll(thePoints);
110
111
112 return myArrow;
113 }
114 }