source: osm/applications/editors/josm/plugins/seachart/src/symbols/Areas.java@ 33949

Last change on this file since 33949 was 32907, checked in by donvip, 8 years ago

checkstyle

File size: 15.3 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package symbols;
3
4import java.awt.BasicStroke;
5import java.awt.Color;
6import java.awt.Graphics2D;
7import java.awt.geom.AffineTransform;
8import java.awt.geom.Ellipse2D;
9import java.awt.geom.Line2D;
10import java.awt.geom.Path2D;
11import java.awt.geom.Rectangle2D;
12import java.awt.image.BufferedImage;
13
14import symbols.Symbols.Delta;
15import symbols.Symbols.Form;
16import symbols.Symbols.Handle;
17import symbols.Symbols.Instr;
18import symbols.Symbols.Symbol;
19
20/**
21 * @author Malcolm Herring
22 */
23public final class Areas {
24 private Areas() {
25 // Hide default constructor for utilities classes
26 }
27
28 // CHECKSTYLE.OFF: LineLength
29 public static final Symbol Plane = new Symbol();
30 static {
31 Plane.add(new Instr(Form.BBOX, new Rectangle2D.Double(-60, -60, 120, 120)));
32 Path2D.Double p = new Path2D.Double(); p.moveTo(40, 20); p.lineTo(50, 10); p.lineTo(27.0, 13.3); p.lineTo(23.7, 6.8); p.lineTo(40.0, 5.0); p.curveTo(55, 4, 55, -9, 40, -10);
33 p.quadTo(31, -11, 30, -15); p.lineTo(-30, 2); p.quadTo(-35, -12, -45, -15); p.quadTo(-56, -3, -50, 15); p.lineTo(18.4, 7.3); p.lineTo(21.7, 14); p.lineTo(-20, 20); p.closePath();
34 Plane.add(new Instr(Form.PGON, p));
35 }
36
37 public static final Symbol Cable = new Symbol();
38 static {
39 Cable.add(new Instr(Form.BBOX, new Rectangle2D.Double(-30, -60, 60, 60)));
40 Cable.add(new Instr(Form.STRK, new BasicStroke(8, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)));
41 Cable.add(new Instr(Form.FILL, new Color(0xc480ff)));
42 Path2D.Double p = new Path2D.Double(); p.moveTo(0, 0); p.curveTo(-13, -13, -13, -17, 0, -30); p.curveTo(13, -43, 13, -47, 0, -60);
43 Cable.add(new Instr(Form.PLIN, p));
44 }
45
46 public static final Symbol CableDot = new Symbol();
47 static {
48 CableDot.add(new Instr(Form.BBOX, new Rectangle2D.Double(-30, -60, 60, 60)));
49 CableDot.add(new Instr(Form.RSHP, new Ellipse2D.Double(-10, -40, 20, 20)));
50 }
51
52 public static final Symbol CableDash = new Symbol();
53 static {
54 CableDash.add(new Instr(Form.BBOX, new Rectangle2D.Double(-30, -60, 60, 60)));
55 CableDash.add(new Instr(Form.STRK, new BasicStroke(8, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)));
56 CableDash.add(new Instr(Form.LINE, new Line2D.Double(0, -15, 0, -45)));
57 }
58
59 public static final Symbol CableFlash = new Symbol();
60 static {
61 CableFlash.add(new Instr(Form.BBOX, new Rectangle2D.Double(-30, -60, 60, 60)));
62 Path2D.Double p = new Path2D.Double(); p.moveTo(-30, -25); p.lineTo(-10, -40); p.lineTo(10, -26); p.lineTo(30, -35); p.lineTo(10, -20); p.lineTo(-10, -34); p.closePath();
63 CableFlash.add(new Instr(Form.PGON, p));
64 }
65
66 public static final Symbol LaneArrow = new Symbol();
67 static {
68 LaneArrow.add(new Instr(Form.BBOX, new Rectangle2D.Double(-20, -240, 40, 240)));
69 LaneArrow.add(new Instr(Form.STRK, new BasicStroke(10, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER)));
70 LaneArrow.add(new Instr(Form.FILL, Symbols.Mtss));
71 Path2D.Double p = new Path2D.Double(); p.moveTo(15, 0); p.lineTo(15, -195); p.lineTo(40, -195);
72 p.lineTo(0, -240); p.lineTo(-40, -195); p.lineTo(-15, -195); p.lineTo(-15, 0); p.closePath();
73 LaneArrow.add(new Instr(Form.PLIN, p));
74 }
75
76 public static final Symbol LineAnchor = new Symbol();
77 static {
78 LineAnchor.add(new Instr(Form.BBOX, new Rectangle2D.Double(-30, -60, 60, 90)));
79 LineAnchor.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Harbours.Anchor, 0.5, 0, 0, null, new Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(-90.0))))));
80 }
81
82 public static final Symbol LinePlane = new Symbol();
83 static {
84 LinePlane.add(new Instr(Form.BBOX, new Rectangle2D.Double(-30, -60, 60, 90)));
85 LinePlane.add(new Instr(Form.FILL, new Color(0xc480ff)));
86 LinePlane.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Areas.Plane, 0.5, 0, 0, null, new Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(-90.0))))));
87 }
88
89 public static final Symbol MarineFarm = new Symbol();
90 static {
91 MarineFarm.add(new Instr(Form.STRK, new BasicStroke(3, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)));
92 Path2D.Double p = new Path2D.Double(); p.moveTo(-23, 12); p.lineTo(-23, 23); p.lineTo(23, 23); p.lineTo(23, 12); p.moveTo(-8, 15); p.lineTo(-8, 23); p.moveTo(8, 15); p.lineTo(8, 23);
93 p.moveTo(-23, -12); p.lineTo(-23, -23); p.lineTo(23, -23); p.lineTo(23, -12); p.moveTo(-8, -15); p.lineTo(-8, -23); p.moveTo(8, -15); p.lineTo(8, -23);
94 p.moveTo(-21, 8); p.quadTo(-1, -14, 21, 0); p.quadTo(-1, 14, -21, -8); p.moveTo(7, 6); p.quadTo(2, 0, 7, -6);
95 MarineFarm.add(new Instr(Form.PLIN, p));
96 MarineFarm.add(new Instr(Form.RSHP, new Ellipse2D.Double(9, -2, 4, 4)));
97 }
98
99 public static final Symbol NoWake = new Symbol();
100 static {
101 NoWake.add(new Instr(Form.STRK, new BasicStroke(12, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
102 NoWake.add(new Instr(Form.FILL, new Color(0xa30075)));
103 Path2D.Double p = new Path2D.Double(); p.moveTo(-60, 20); p.curveTo(-28, 20, -32, 0, 0, 0); p.curveTo(32, 0, 28, 20, 60, 20); p.moveTo(-60, 0); p.curveTo(-28, 0, -32, -20, 0, -20); p.curveTo(32, -20, 28, 0, 60, 0);
104 NoWake.add(new Instr(Form.PLIN, p));
105 NoWake.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
106 NoWake.add(new Instr(Form.LINE, new Line2D.Double(-60, 60, 60, -60)));
107 NoWake.add(new Instr(Form.LINE, new Line2D.Double(-60, -60, 60, 60)));
108 }
109
110 public static final Symbol Pipeline = new Symbol();
111 static {
112 Pipeline.add(new Instr(Form.BBOX, new Rectangle2D.Double(-15, -60, 30, 60)));
113 Pipeline.add(new Instr(Form.STRK, new BasicStroke(8, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)));
114 Pipeline.add(new Instr(Form.FILL, new Color(0xc480ff)));
115 Pipeline.add(new Instr(Form.LINE, new Line2D.Double(0, 0, 0, -50)));
116 Pipeline.add(new Instr(Form.RSHP, new Ellipse2D.Double(-10, -60, 20, 20)));
117 }
118
119 public static final Symbol Restricted = new Symbol();
120 static {
121 Restricted.add(new Instr(Form.BBOX, new Rectangle2D.Double(-15, -30, 30, 30)));
122 Restricted.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)));
123 Restricted.add(new Instr(Form.LINE, new Line2D.Double(0, 0, 0, -30)));
124 Restricted.add(new Instr(Form.LINE, new Line2D.Double(0, -15, 17, -15)));
125 }
126
127 public static final Symbol Rock = new Symbol();
128 static {
129 Rock.add(new Instr(Form.FILL, new Color(0x80c0ff)));
130 Rock.add(new Instr(Form.RSHP, new Ellipse2D.Double(-30, -30, 60, 60)));
131 Rock.add(new Instr(Form.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1, new float[]{5, 5}, 0)));
132 Rock.add(new Instr(Form.FILL, Color.black));
133 Rock.add(new Instr(Form.ELPS, new Ellipse2D.Double(-30, -30, 60, 60)));
134 Rock.add(new Instr(Form.STRK, new BasicStroke(5, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
135 Rock.add(new Instr(Form.LINE, new Line2D.Double(-20, 0, 20, 0)));
136 Rock.add(new Instr(Form.LINE, new Line2D.Double(0, -20, 0, 20)));
137 }
138
139 public static final Symbol RockA = new Symbol();
140 static {
141 RockA.add(new Instr(Form.FILL, new Color(0x80c0ff)));
142 RockA.add(new Instr(Form.RSHP, new Ellipse2D.Double(-30, -30, 60, 60)));
143 RockA.add(new Instr(Form.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1, new float[]{5, 5}, 0)));
144 RockA.add(new Instr(Form.FILL, Color.black));
145 RockA.add(new Instr(Form.ELPS, new Ellipse2D.Double(-30, -30, 60, 60)));
146 RockA.add(new Instr(Form.STRK, new BasicStroke(5, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
147 RockA.add(new Instr(Form.LINE, new Line2D.Double(-20, 0, 20, 0)));
148 RockA.add(new Instr(Form.LINE, new Line2D.Double(0, -20, 0, 20)));
149 RockA.add(new Instr(Form.RSHP, new Ellipse2D.Double(-17, -17, 8, 8)));
150 RockA.add(new Instr(Form.RSHP, new Ellipse2D.Double(-17, 9, 8, 8)));
151 RockA.add(new Instr(Form.RSHP, new Ellipse2D.Double(9, -17, 8, 8)));
152 RockA.add(new Instr(Form.RSHP, new Ellipse2D.Double(9, 9, 8, 8)));
153 }
154
155 public static final Symbol RockC = new Symbol();
156 static {
157 RockC.add(new Instr(Form.FILL, new Color(0x80c0ff)));
158 RockC.add(new Instr(Form.RSHP, new Ellipse2D.Double(-30, -30, 60, 60)));
159 RockC.add(new Instr(Form.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1, new float[]{5, 5}, 0)));
160 RockC.add(new Instr(Form.FILL, Color.black));
161 RockC.add(new Instr(Form.ELPS, new Ellipse2D.Double(-30, -30, 60, 60)));
162 RockC.add(new Instr(Form.STRK, new BasicStroke(5, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
163 RockC.add(new Instr(Form.LINE, new Line2D.Double(-20, 0, 20, 0)));
164 RockC.add(new Instr(Form.LINE, new Line2D.Double(-10, 17.3, 10, -17.3)));
165 RockC.add(new Instr(Form.LINE, new Line2D.Double(10, 17.3, -10, -17.3)));
166 }
167
168 public static final Symbol Seaplane = new Symbol();
169 static {
170 Seaplane.add(new Instr(Form.BBOX, new Rectangle2D.Double(-60, -60, 120, 120)));
171 Seaplane.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
172 Seaplane.add(new Instr(Form.ELPS, new Ellipse2D.Double(-58, -58, 116, 116)));
173 Seaplane.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Areas.Plane, 1.0, 0, 0, null, null)));
174 }
175
176 public static final Symbol WindFarm = new Symbol();
177 static {
178 WindFarm.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
179 WindFarm.add(new Instr(Form.ELPS, new Ellipse2D.Double(-100, -100, 200, 200)));
180 WindFarm.add(new Instr(Form.LINE, new Line2D.Double(-35, 50, 35, 50)));
181 WindFarm.add(new Instr(Form.LINE, new Line2D.Double(0, 50, 0, -27.5)));
182 WindFarm.add(new Instr(Form.LINE, new Line2D.Double(0, -27.5, 30, -27.5)));
183 WindFarm.add(new Instr(Form.LINE, new Line2D.Double(0, -27.5, -13.8, -3.8)));
184 WindFarm.add(new Instr(Form.LINE, new Line2D.Double(0, -27.5, -13.8, -53.6)));
185 }
186
187 public static final Symbol WreckD = new Symbol();
188 static {
189 WreckD.add(new Instr(Form.FILL, new Color(0x80c0ff)));
190 WreckD.add(new Instr(Form.RSHP, new Ellipse2D.Double(-50, -40, 100, 80)));
191 WreckD.add(new Instr(Form.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1, new float[]{5, 5}, 0)));
192 WreckD.add(new Instr(Form.FILL, Color.black));
193 WreckD.add(new Instr(Form.ELPS, new Ellipse2D.Double(-50, -40, 100, 80)));
194 WreckD.add(new Instr(Form.STRK, new BasicStroke(5, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
195 WreckD.add(new Instr(Form.LINE, new Line2D.Double(-40, 0, 40, 0)));
196 WreckD.add(new Instr(Form.LINE, new Line2D.Double(0, -30, 0, 30)));
197 WreckD.add(new Instr(Form.LINE, new Line2D.Double(-20, -15, -20, 15)));
198 WreckD.add(new Instr(Form.LINE, new Line2D.Double(20, -15, 20, 15)));
199 }
200
201 public static final Symbol WreckND = new Symbol();
202 static {
203 WreckND.add(new Instr(Form.STRK, new BasicStroke(5, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
204 WreckND.add(new Instr(Form.LINE, new Line2D.Double(-40, 0, 40, 0)));
205 WreckND.add(new Instr(Form.LINE, new Line2D.Double(0, -30, 0, 30)));
206 WreckND.add(new Instr(Form.LINE, new Line2D.Double(-20, -15, -20, 15)));
207 WreckND.add(new Instr(Form.LINE, new Line2D.Double(20, -15, 20, 15)));
208 }
209
210 public static final Symbol WreckS = new Symbol();
211 static {
212 WreckS.add(new Instr(Form.STRK, new BasicStroke(3, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
213 WreckS.add(new Instr(Form.ELPS, new Ellipse2D.Double(-6, -6, 12, 12)));
214 WreckS.add(new Instr(Form.LINE, new Line2D.Double(-40, 0, -6, 0)));
215 WreckS.add(new Instr(Form.LINE, new Line2D.Double(40, 0, 6, 0)));
216 Path2D.Double p = new Path2D.Double(); p.moveTo(-30, 0); p.lineTo(-40, -25); p.lineTo(-0.3, -12.6); p.lineTo(13.7, -37.7); p.lineTo(16.3, -36.3);
217 p.lineTo(2.7, -11.6); p.lineTo(37.5, 0); p.lineTo(6, 0); p.curveTo(5.6, -8, -5.6, -8, -6, 0); p.closePath();
218 WreckS.add(new Instr(Form.PGON, p));
219 }
220
221 public static final BufferedImage Sandwaves = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
222 static {
223 Graphics2D g2 = Sandwaves.createGraphics();
224 g2.setStroke(new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
225 g2.setBackground(new Color(0, true));
226 g2.clearRect(0, 0, 100, 100);
227 g2.setPaint(new Color(0xffd400));
228 Path2D.Double p = new Path2D.Double(); p.moveTo(0.0, 34.5); p.lineTo(03.3, 30.8); p.lineTo(09.9, 19.3); p.lineTo(13.2, 16.0); p.lineTo(16.5, 16.1); p.lineTo(18.2, 19.5);
229 p.lineTo(19.9, 25.0); p.lineTo(21.6, 30.3); p.lineTo(23.3, 33.4); p.lineTo(25.0, 33.3); p.lineTo(28.3, 30.1); p.lineTo(31.6, 25.0); p.lineTo(34.9, 20.1); p.lineTo(38.2, 17.2);
230 p.lineTo(41.5, 17.3); p.lineTo(43.2, 20.3); p.lineTo(44.9, 25); p.lineTo(46.6, 29.6); p.lineTo(48.3, 32.2); p.lineTo(50.0, 32.1);
231 p.moveTo(50.0, 84.5); p.lineTo(53.3, 80.8); p.lineTo(56.6, 75.0); p.lineTo(59.9, 69.3); p.lineTo(63.2, 66.0); p.lineTo(66.5, 66.1); p.lineTo(68.2, 69.5); p.lineTo(69.9, 75.0);
232 p.lineTo(71.6, 80.3); p.lineTo(73.3, 83.4); p.lineTo(75.0, 83.3); p.lineTo(78.3, 80.1); p.lineTo(81.6, 75.0); p.lineTo(84.9, 70.1); p.lineTo(88.2, 67.2); p.lineTo(91.5, 67.3);
233 p.lineTo(93.2, 70.3); p.lineTo(94.9, 75.0); p.lineTo(96.6, 79.6); p.lineTo(98.3, 82.2); p.lineTo(100.0, 82.1);
234 g2.draw(p);
235 }
236
237 public static final Symbol KelpS = new Symbol();
238 static {
239 KelpS.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER)));
240 Path2D.Double p = new Path2D.Double(); p.moveTo(-60, 0); p.curveTo(-20, -20, -24, 40, 24, 20); p.moveTo(-60, 0); p.quadTo(-48, 20, -32, 12);
241 p.moveTo(-36, -4); p.quadTo(-24, -24, -4, -16); p.quadTo(8, -32, 20, -24); p.moveTo(-4, -16); p.quadTo(8, 0, 20, -8);
242 p.moveTo(-8, 20); p.quadTo(12, 0, 36, 8); p.quadTo(48, 24, 60, 16); p.moveTo(36, 8); p.quadTo(48, -8, 60, 0);
243 KelpS.add(new Instr(Form.PLIN, p));
244 }
245
246 public static final BufferedImage KelpA = new BufferedImage(240, 240, BufferedImage.TYPE_INT_ARGB);
247 static {
248 Graphics2D g2 = KelpA.createGraphics();
249 g2.setStroke(new BasicStroke(8, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
250 g2.setBackground(new Color(0, true));
251 g2.clearRect(0, 0, 240, 240);
252 g2.setPaint(Color.black);
253 Path2D.Double p = new Path2D.Double();
254 p.moveTo(0, 60); p.curveTo(40, 40, 44, 100, 84, 80); p.moveTo(0, 60); p.quadTo(12, 80, 28, 72); p.moveTo(24, 56); p.quadTo(36, 36, 56, 44); p.quadTo(68, 28, 80, 36);
255 p.moveTo(56, 44); p.quadTo(68, 60, 80, 52); p.moveTo(52, 76); p.quadTo(72, 60, 96, 68); p.quadTo(108, 84, 120, 76); p.moveTo(96, 68); p.quadTo(108, 52, 120, 60);
256 p.moveTo(120, 180); p.curveTo(160, 160, 164, 220, 204, 200); p.moveTo(120, 180); p.quadTo(132, 200, 148, 192); p.moveTo(144, 176); p.quadTo(156, 156, 176, 164); p.quadTo(188, 148, 200, 156);
257 p.moveTo(176, 164); p.quadTo(188, 180, 200, 172); p.moveTo(172, 196); p.quadTo(192, 180, 216, 188); p.quadTo(228, 204, 240, 196); p.moveTo(216, 188); p.quadTo(228, 172, 240, 180);
258 g2.draw(p);
259 }
260}
Note: See TracBrowser for help on using the repository browser.