1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package symbols;
|
---|
3 |
|
---|
4 | import java.awt.BasicStroke;
|
---|
5 | import java.awt.Color;
|
---|
6 | import java.awt.geom.Arc2D;
|
---|
7 | import java.awt.geom.Ellipse2D;
|
---|
8 | import java.awt.geom.GeneralPath;
|
---|
9 | import java.awt.geom.Line2D;
|
---|
10 | import java.awt.geom.Path2D;
|
---|
11 | import java.awt.geom.Rectangle2D;
|
---|
12 |
|
---|
13 | import symbols.Symbols.Form;
|
---|
14 | import symbols.Symbols.Instr;
|
---|
15 | import symbols.Symbols.Scheme;
|
---|
16 | import symbols.Symbols.Symbol;
|
---|
17 |
|
---|
18 | /**
|
---|
19 | * @author Malcolm Herring
|
---|
20 | */
|
---|
21 | public final class Harbours {
|
---|
22 | private Harbours() {
|
---|
23 | // Hide default constructor for utilities classes
|
---|
24 | }
|
---|
25 |
|
---|
26 | // CHECKSTYLE.OFF: LineLength
|
---|
27 | public static final Symbol Anchor = new Symbol();
|
---|
28 | static {
|
---|
29 | Anchor.add(new Instr(Form.BBOX, new Rectangle2D.Double(-60, -60, 120, 120)));
|
---|
30 | Anchor.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
31 | Anchor.add(new Instr(Form.ELPS, new Ellipse2D.Double(-10, -59, 20, 20)));
|
---|
32 | Path2D.Double p = new Path2D.Double(); p.moveTo(23.0, -40.0); p.lineTo(23.0, -30.0); p.lineTo(6.0, -30.0); p.lineTo(7.0, 31.0); p.quadTo(21.0, 29.0, 31.0, 22.0);
|
---|
33 | p.lineTo(27.0, 18.0); p.lineTo(52.0, 0.0); p.lineTo(45.0, 35.0); p.lineTo(37.0, 28.0); p.quadTo(25.0, 39.0, 7.0, 43.0); p.lineTo(6.0, 51.0);
|
---|
34 | p.lineTo(-6.0, 51.0); p.lineTo(-7.0, 43.0); p.quadTo(-25.0, 39.0, -37.0, 28.0); p.lineTo(-45.0, 35.0); p.lineTo(-52.0, 0.0); p.lineTo(-27.0, 18.0);
|
---|
35 | p.lineTo(-31.0, 22.0); p.quadTo(-21.0, 29.0, -7.0, 31.0); p.lineTo(-6.0, -30.0); p.lineTo(-23.0, -30.0); p.lineTo(-23.0, -40.0); p.closePath();
|
---|
36 | Anchor.add(new Instr(Form.PGON, p));
|
---|
37 | }
|
---|
38 |
|
---|
39 | public static final Symbol Yacht = new Symbol();
|
---|
40 | static {
|
---|
41 | Yacht.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
42 | Path2D.Double p = new Path2D.Double(); p.moveTo(-65.0, 50.0); p.curveTo(-36.0, 97.0, 36.0, 97.0, 65.0, 50.0); p.lineTo(3.0, 50.0); p.lineTo(3.0, 40.0); p.lineTo(55.0, 30.0);
|
---|
43 | p.curveTo(32.0, 4.0, 25.0, -15.0, 26.0, -52.0); p.lineTo(1.5, -40.0); p.lineTo(1.0, -64.0); p.lineTo(-2.0, -64.0); p.lineTo(-4.0, 50.0); p.closePath();
|
---|
44 | p.moveTo(-50.0, 45.0); p.curveTo(-55.0, 3.0, -37.0, -28.5, -7.0, -46.0); p.curveTo(-28.0, -15.0, -26.0, 11.0, -20.5, 30.0); p.closePath();
|
---|
45 | Yacht.add(new Instr(Form.PGON, p));
|
---|
46 | }
|
---|
47 |
|
---|
48 | public static final Symbol Anchorage = new Symbol();
|
---|
49 | static {
|
---|
50 | Anchorage.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Harbours.Anchor, 0.67, 0, 0, new Scheme(Symbols.Msymb), null)));
|
---|
51 | }
|
---|
52 |
|
---|
53 | public static final Symbol Bollard = new Symbol();
|
---|
54 | static {
|
---|
55 | Bollard.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
56 | Bollard.add(new Instr(Form.FILL, Color.white));
|
---|
57 | Ellipse2D.Double s = new Ellipse2D.Double(-10, -10, 20, 20);
|
---|
58 | Bollard.add(new Instr(Form.RSHP, s));
|
---|
59 | Bollard.add(new Instr(Form.FILL, Color.black));
|
---|
60 | Bollard.add(new Instr(Form.ELPS, s));
|
---|
61 | }
|
---|
62 |
|
---|
63 | public static final Symbol CallPoint1 = new Symbol();
|
---|
64 | static {
|
---|
65 | CallPoint1.add(new Instr(Form.BBOX, new Rectangle2D.Double(-50, -50, 100, 100)));
|
---|
66 | CallPoint1.add(new Instr(Form.STRK, new BasicStroke(5, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER)));
|
---|
67 | CallPoint1.add(new Instr(Form.FILL, Symbols.Msymb));
|
---|
68 | CallPoint1.add(new Instr(Form.ELPS, new Ellipse2D.Double(-25, -25, 50, 50)));
|
---|
69 | Path2D.Double p = new Path2D.Double(); p.moveTo(-16.0, -20.0); p.lineTo(0.0, -50.0); p.lineTo(16.0, -20.0);
|
---|
70 | CallPoint1.add(new Instr(Form.PLIN, p));
|
---|
71 | }
|
---|
72 |
|
---|
73 | public static final Symbol CallPoint2 = new Symbol();
|
---|
74 | static {
|
---|
75 | CallPoint2.add(new Instr(Form.BBOX, new Rectangle2D.Double(-50, -50, 100, 100)));
|
---|
76 | CallPoint2.add(new Instr(Form.SYMB, new Symbols.SubSymbol(CallPoint1, 1.0, 0, 0, null, null)));
|
---|
77 | Path2D.Double p = new Path2D.Double(); p.moveTo(-16.0, 20.0); p.lineTo(0.0, 50.0); p.lineTo(16.0, 20.0);
|
---|
78 | CallPoint2.add(new Instr(Form.PLIN, p));
|
---|
79 | }
|
---|
80 |
|
---|
81 | public static final Symbol ContainerCrane = new Symbol();
|
---|
82 | static {
|
---|
83 | ContainerCrane.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
84 | ContainerCrane.add(new Instr(Form.RSHP, new Rectangle2D.Double(-15, -65, 30, 100)));
|
---|
85 | ContainerCrane.add(new Instr(Form.RECT, new Rectangle2D.Double(-40, -12.5, 80, 25)));
|
---|
86 | }
|
---|
87 |
|
---|
88 | public static final Symbol Customs = new Symbol();
|
---|
89 | static {
|
---|
90 | Customs.add(new Instr(Form.BBOX, new Rectangle2D.Double(-30, -30, 60, 60)));
|
---|
91 | Customs.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER)));
|
---|
92 | Customs.add(new Instr(Form.ELPS, new Ellipse2D.Double(-28, -28, 56, 56)));
|
---|
93 | Customs.add(new Instr(Form.LINE, new Line2D.Double(-25, 5, 25, 5)));
|
---|
94 | Customs.add(new Instr(Form.LINE, new Line2D.Double(-25, -5, 25, -5)));
|
---|
95 | }
|
---|
96 |
|
---|
97 | public static final Symbol DeviationDolphin = new Symbol();
|
---|
98 | static {
|
---|
99 | DeviationDolphin.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
100 | Path2D.Double p = new Path2D.Double(); p.moveTo(-30.0, 0.0); p.lineTo(30.0, 0.0); p.moveTo(0.0, 0.0); p.lineTo(0.0, -40.0);
|
---|
101 | p.moveTo(-20.0, 0.0); p.lineTo(-15.0, -32.0); p.lineTo(15.0, -32.0); p.lineTo(20.0, 0.0);
|
---|
102 | DeviationDolphin.add(new Instr(Form.PLIN, p));
|
---|
103 | }
|
---|
104 |
|
---|
105 | public static final Symbol DistanceI = new Symbol();
|
---|
106 | static {
|
---|
107 | DistanceI.add(new Instr(Form.STRK, new BasicStroke(3, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
108 | DistanceI.add(new Instr(Form.ELPS, new Ellipse2D.Double(-11, -11, 22, 22)));
|
---|
109 | }
|
---|
110 |
|
---|
111 | public static final Symbol DistanceU = new Symbol();
|
---|
112 | static {
|
---|
113 | DistanceU.add(new Instr(Form.STRK, new BasicStroke(3, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
114 | DistanceU.add(new Instr(Form.FILL, Symbols.Msymb));
|
---|
115 | DistanceU.add(new Instr(Form.ELPS, new Ellipse2D.Double(-11, -11, 22, 22)));
|
---|
116 | }
|
---|
117 |
|
---|
118 | public static final Symbol Dolphin = new Symbol();
|
---|
119 | static {
|
---|
120 | Dolphin.add(new Instr(Form.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
121 | Dolphin.add(new Instr(Form.FILL, new Color(0xffd400)));
|
---|
122 | Path2D.Double p = new Path2D.Double(); p.moveTo(3.8, -9.2); p.lineTo(9.2, -3.8); p.lineTo(9.2, 3.8); p.lineTo(3.8, 9.2);
|
---|
123 | p.lineTo(-3.8, 9.2); p.lineTo(-9.2, 3.8); p.lineTo(-9.2, -3.8); p.lineTo(-3.8, -9.2); p.closePath();
|
---|
124 | Dolphin.add(new Instr(Form.PGON, p));
|
---|
125 | Dolphin.add(new Instr(Form.FILL, Color.black));
|
---|
126 | Dolphin.add(new Instr(Form.PLIN, p));
|
---|
127 | }
|
---|
128 |
|
---|
129 | public static final Symbol Explosives = new Symbol();
|
---|
130 | static {
|
---|
131 | Explosives.add(new Instr(Form.BBOX, new Rectangle2D.Double(-30, -30, 60, 60)));
|
---|
132 | Explosives.add(new Instr(Form.RSHP, new Ellipse2D.Double(-5, 25, 10, 10)));
|
---|
133 | Explosives.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)));
|
---|
134 | Path2D.Double p = new Path2D.Double(); p.moveTo(-10, 20); p.lineTo(-13, 17); p.lineTo(-13, 8);
|
---|
135 | p.moveTo(0, 10); p.lineTo(0, 0); p.lineTo(-8, -10);
|
---|
136 | p.moveTo(10, 17); p.lineTo(18, -10); p.lineTo(10, -20);
|
---|
137 | Explosives.add(new Instr(Form.PLIN, p));
|
---|
138 | }
|
---|
139 |
|
---|
140 | public static final Symbol Fishing = new Symbol();
|
---|
141 | static {
|
---|
142 | Fishing.add(new Instr(Form.STRK, new BasicStroke(10, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
143 | Fishing.add(new Instr(Form.FILL, Symbols.Msymb));
|
---|
144 | Fishing.add(new Instr(Form.EARC, new Arc2D.Double(-50, -50, 100, 100, 15, 140, Arc2D.OPEN)));
|
---|
145 | Fishing.add(new Instr(Form.EARC, new Arc2D.Double(-50, -50, 100, 100, -15, -140, Arc2D.OPEN)));
|
---|
146 | Path2D.Double p = new Path2D.Double(); p.setWindingRule(GeneralPath.WIND_EVEN_ODD);
|
---|
147 | p.moveTo(-24, 3); p.curveTo(12, 24, 30, 15, 48, 0); p.curveTo(30, -15, 12, -24, -24, -3);
|
---|
148 | p.lineTo(-45, -15); p.quadTo(-48, 0, -45, 15); p.closePath();
|
---|
149 | p.moveTo(25, 0); p.curveTo(25, 6, 34, 6, 34, 0); p.curveTo(34, -6, 25, -6, 25, 0); p.closePath();
|
---|
150 | Fishing.add(new Instr(Form.PGON, p));
|
---|
151 | }
|
---|
152 |
|
---|
153 | public static final Symbol Harbour = new Symbol();
|
---|
154 | static {
|
---|
155 | Harbour.add(new Instr(Form.STRK, new BasicStroke(10, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
156 | Harbour.add(new Instr(Form.FILL, Symbols.Msymb));
|
---|
157 | Harbour.add(new Instr(Form.ELPS, new Ellipse2D.Double(-50, -50, 100, 100)));
|
---|
158 | Harbour.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Harbours.Anchor, 0.6, 0, 0, new Scheme(Symbols.Msymb), null)));
|
---|
159 | }
|
---|
160 |
|
---|
161 | public static final Symbol HarbourMaster = new Symbol();
|
---|
162 | static {
|
---|
163 | HarbourMaster.add(new Instr(Form.BBOX, new Rectangle2D.Double(-30, -30, 60, 60)));
|
---|
164 | HarbourMaster.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
165 | HarbourMaster.add(new Instr(Form.ELPS, new Ellipse2D.Double(-24, -28, 48, 56)));
|
---|
166 | HarbourMaster.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Harbours.Anchor, 0.4, 0, 0, null, null)));
|
---|
167 | }
|
---|
168 |
|
---|
169 | public static final Symbol Hospital = new Symbol();
|
---|
170 | static {
|
---|
171 | Hospital.add(new Instr(Form.BBOX, new Rectangle2D.Double(-30, -30, 60, 60)));
|
---|
172 | Hospital.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER)));
|
---|
173 | Hospital.add(new Instr(Form.ELPS, new Ellipse2D.Double(-28, -28, 56, 56)));
|
---|
174 | Path2D.Double p = new Path2D.Double(); p.moveTo(-26, -5); p.lineTo(-5, -5); p.lineTo(-5, -25); p.moveTo(5, -25); p.lineTo(5, -5); p.lineTo(25, -5);
|
---|
175 | p.moveTo(-25, 5); p.lineTo(-5, 5); p.lineTo(-5, 25); p.moveTo(5, 25); p.lineTo(5, 5); p.lineTo(25, 5);
|
---|
176 | Hospital.add(new Instr(Form.PLIN, p));
|
---|
177 | }
|
---|
178 |
|
---|
179 | public static final Symbol LandingSteps = new Symbol();
|
---|
180 | static {
|
---|
181 | LandingSteps.add(new Instr(Form.FILL, Symbols.Msymb));
|
---|
182 | Path2D.Double p = new Path2D.Double(); p.moveTo(-20, -10); p.lineTo(10, 20); p.lineTo(20, 20); p.lineTo(20, 10);
|
---|
183 | p.lineTo(10, 10); p.lineTo(10, 0); p.lineTo(0, 0); p.lineTo(0, -10); p.lineTo(-10, -10); p.lineTo(-10, -20); p.lineTo(-20, -20); p.closePath();
|
---|
184 | LandingSteps.add(new Instr(Form.PGON, p));
|
---|
185 | }
|
---|
186 |
|
---|
187 | public static final Symbol Marina = new Symbol();
|
---|
188 | static {
|
---|
189 | Marina.add(new Instr(Form.STRK, new BasicStroke(10, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
190 | Marina.add(new Instr(Form.FILL, Symbols.Msymb));
|
---|
191 | Marina.add(new Instr(Form.EARC, new Arc2D.Double(-50.0, -50.0, 100.0, 100.0, 215.0, -250.0, Arc2D.OPEN)));
|
---|
192 | Marina.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Harbours.Yacht, 0.6, 0, 0, new Scheme(Symbols.Msymb), null)));
|
---|
193 | }
|
---|
194 |
|
---|
195 | public static final Symbol MarinaNF = new Symbol();
|
---|
196 | static {
|
---|
197 | MarinaNF.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Harbours.Yacht, 0.6, 0, 0, new Scheme(Symbols.Msymb), null)));
|
---|
198 | }
|
---|
199 |
|
---|
200 | public static final Symbol Pilot = new Symbol();
|
---|
201 | static {
|
---|
202 | Pilot.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
203 | Pilot.add(new Instr(Form.FILL, new Color(0xd400d4)));
|
---|
204 | Path2D.Double p = new Path2D.Double(); p.moveTo(-15, 0); p.lineTo(0, -56); p.lineTo(15, 0); p.lineTo(0, 56); p.closePath();
|
---|
205 | Pilot.add(new Instr(Form.PGON, p));
|
---|
206 | Pilot.add(new Instr(Form.ELPS, new Ellipse2D.Double(-58, -58, 116, 116)));
|
---|
207 | }
|
---|
208 |
|
---|
209 | public static final Symbol PortCrane = new Symbol();
|
---|
210 | static {
|
---|
211 | PortCrane.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
212 | PortCrane.add(new Instr(Form.EARC, new Arc2D.Double(-36.0, -36.0, 72.0, 72.0, 70.0, -320.0, Arc2D.OPEN)));
|
---|
213 | PortCrane.add(new Instr(Form.LINE, new Line2D.Double(0, 0, 0, -60)));
|
---|
214 | }
|
---|
215 |
|
---|
216 | public static final Symbol Post = new Symbol();
|
---|
217 | static {
|
---|
218 | Post.add(new Instr(Form.RSHP, new Ellipse2D.Double(-10, -10, 20, 20)));
|
---|
219 | }
|
---|
220 |
|
---|
221 | public static final Symbol Rescue = new Symbol();
|
---|
222 | static {
|
---|
223 | Rescue.add(new Instr(Form.BBOX, new Rectangle2D.Double(-20, -50, 40, 100)));
|
---|
224 | Rescue.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
225 | Path2D.Double p = new Path2D.Double(); p.moveTo(-11, 0); p.lineTo(0, -43); p.lineTo(11, 0); p.lineTo(0, 43); p.closePath();
|
---|
226 | Rescue.add(new Instr(Form.PGON, p));
|
---|
227 | Rescue.add(new Instr(Form.LINE, new Line2D.Double(-15, 0, 15, 0)));
|
---|
228 | }
|
---|
229 |
|
---|
230 | public static final Symbol SignalStation = new Symbol();
|
---|
231 | static {
|
---|
232 | SignalStation.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
233 | SignalStation.add(new Instr(Form.ELPS, new Ellipse2D.Double(-20, -20, 40, 40)));
|
---|
234 | SignalStation.add(new Instr(Form.RSHP, new Ellipse2D.Double(-4, -4, 8, 8)));
|
---|
235 | }
|
---|
236 |
|
---|
237 | public static final Symbol TideGauge = new Symbol();
|
---|
238 | static {
|
---|
239 | TideGauge.add(new Instr(Form.STRK, new BasicStroke(3, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
240 | TideGauge.add(new Instr(Form.ELPS, new Ellipse2D.Double(-10, -10, 20, 20)));
|
---|
241 | TideGauge.add(new Instr(Form.LINE, new Line2D.Double(-10, 0, -30, 0)));
|
---|
242 | TideGauge.add(new Instr(Form.LINE, new Line2D.Double(10, 0, 30, 0)));
|
---|
243 | TideGauge.add(new Instr(Form.LINE, new Line2D.Double(0, -10, 0, -80)));
|
---|
244 | TideGauge.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
245 | TideGauge.add(new Instr(Form.LINE, new Line2D.Double(-15, -25, 15, -25)));
|
---|
246 | TideGauge.add(new Instr(Form.LINE, new Line2D.Double(-25, -45, 25, -45)));
|
---|
247 | TideGauge.add(new Instr(Form.LINE, new Line2D.Double(-15, -65, 15, -65)));
|
---|
248 | }
|
---|
249 | }
|
---|