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

Last change on this file since 30899 was 30894, checked in by malcolmh, 10 years ago

Add SeaChart plugin

File size: 12.1 KB
Line 
1/* Copyright 2014 Malcolm Herring
2 *
3 * This is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, version 3 of the License.
6 *
7 * For a copy of the GNU General Public License, see <http://www.gnu.org/licenses/>.
8 */
9
10package symbols;
11
12import java.awt.*;
13import java.awt.geom.*;
14import java.awt.image.*;
15
16import symbols.Symbols.*;
17
18public class Areas {
19 public static final Symbol Plane = new Symbol();
20 static {
21 Plane.add(new Instr(Form.BBOX, new Rectangle2D.Double(-60,-60,120,120)));
22 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);
23 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();
24 Plane.add(new Instr(Form.PGON, p));
25 }
26 public static final Symbol Cable = new Symbol();
27 static {
28 Cable.add(new Instr(Form.BBOX, new Rectangle2D.Double(-30,-60,60,60)));
29 Cable.add(new Instr(Form.STRK, new BasicStroke(8, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)));
30 Cable.add(new Instr(Form.FILL, new Color(0xc480ff)));
31 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);
32 Cable.add(new Instr(Form.PLIN, p));
33 }
34 public static final Symbol CableDot = new Symbol();
35 static {
36 CableDot.add(new Instr(Form.BBOX, new Rectangle2D.Double(-30,-60,60,60)));
37 CableDot.add(new Instr(Form.RSHP, new Ellipse2D.Double(-10,-40,20,20)));
38 }
39 public static final Symbol CableDash = new Symbol();
40 static {
41 CableDash.add(new Instr(Form.BBOX, new Rectangle2D.Double(-30,-60,60,60)));
42 CableDash.add(new Instr(Form.STRK, new BasicStroke(8, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)));
43 CableDash.add(new Instr(Form.LINE, new Line2D.Double(0,-15,0,-45)));
44 }
45 public static final Symbol CableFlash = new Symbol();
46 static {
47 CableFlash.add(new Instr(Form.BBOX, new Rectangle2D.Double(-30,-60,60,60)));
48 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();
49 CableFlash.add(new Instr(Form.PGON, p));
50 }
51 public static final Symbol LaneArrow = new Symbol();
52 static {
53 LaneArrow.add(new Instr(Form.BBOX, new Rectangle2D.Double(-20,-240,40,240)));
54 LaneArrow.add(new Instr(Form.STRK, new BasicStroke(10, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER)));
55 LaneArrow.add(new Instr(Form.FILL, new Color(0x80c480ff, true)));
56 Path2D.Double p = new Path2D.Double(); p.moveTo(15,0); p.lineTo(15,-195); p.lineTo(40,-195);
57 p.lineTo(0,-240); p.lineTo(-40,-195); p.lineTo(-15,-195); p.lineTo(-15,0); p.closePath();
58 LaneArrow.add(new Instr(Form.PLIN, p));
59 }
60 public static final Symbol LineAnchor = new Symbol();
61 static {
62 LineAnchor.add(new Instr(Form.BBOX, new Rectangle2D.Double(-30,-60,60,90)));
63 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))))));
64 }
65 public static final Symbol LinePlane = new Symbol();
66 static {
67 LinePlane.add(new Instr(Form.BBOX, new Rectangle2D.Double(-30,-60,60,90)));
68 LinePlane.add(new Instr(Form.FILL, new Color(0xc480ff)));
69 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))))));
70 }
71 public static final Symbol MarineFarm = new Symbol();
72 static {
73 MarineFarm.add(new Instr(Form.STRK, new BasicStroke(3, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)));
74 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);
75 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);
76 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);
77 MarineFarm.add(new Instr(Form.PLIN, p));
78 MarineFarm.add(new Instr(Form.RSHP, new Ellipse2D.Double(9,-2,4,4)));
79 }
80 public static final Symbol NoWake = new Symbol();
81 static {
82 NoWake.add(new Instr(Form.STRK, new BasicStroke(12, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
83 NoWake.add(new Instr(Form.FILL, new Color(0xa30075)));
84 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);
85 NoWake.add(new Instr(Form.PLIN, p));
86 NoWake.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
87 NoWake.add(new Instr(Form.LINE, new Line2D.Double(-60,60,60,-60)));
88 NoWake.add(new Instr(Form.LINE, new Line2D.Double(-60,-60,60,60)));
89 }
90 public static final Symbol Pipeline = new Symbol();
91 static {
92 Pipeline.add(new Instr(Form.BBOX, new Rectangle2D.Double(-15,-60,30,60)));
93 Pipeline.add(new Instr(Form.STRK, new BasicStroke(8, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)));
94 Pipeline.add(new Instr(Form.FILL, new Color(0xc480ff)));
95 Pipeline.add(new Instr(Form.LINE, new Line2D.Double(0,0,0,-50)));
96 Pipeline.add(new Instr(Form.RSHP, new Ellipse2D.Double(-10,-60,20,20)));
97 }
98 public static final Symbol Restricted = new Symbol();
99 static {
100 Restricted.add(new Instr(Form.BBOX, new Rectangle2D.Double(-15,-30,30,30)));
101 Restricted.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)));
102 Restricted.add(new Instr(Form.LINE, new Line2D.Double(0,0,0,-30)));
103 Restricted.add(new Instr(Form.LINE, new Line2D.Double(0,-15,17,-15)));
104 }
105 public static final Symbol Rock = new Symbol();
106 static {
107 Rock.add(new Instr(Form.FILL, new Color(0x80c0ff)));
108 Rock.add(new Instr(Form.RSHP, new Ellipse2D.Double(-30,-30,60,60)));
109 Rock.add(new Instr(Form.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1, new float[]{5,5}, 0)));
110 Rock.add(new Instr(Form.FILL, Color.black));
111 Rock.add(new Instr(Form.ELPS, new Ellipse2D.Double(-30,-30,60,60)));
112 Rock.add(new Instr(Form.STRK, new BasicStroke(5, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
113 Rock.add(new Instr(Form.LINE, new Line2D.Double(-20,0,20,0)));
114 Rock.add(new Instr(Form.LINE, new Line2D.Double(0,-20,0,20)));
115 }
116 public static final Symbol RockA = new Symbol();
117 static {
118 RockA.add(new Instr(Form.FILL, new Color(0x80c0ff)));
119 RockA.add(new Instr(Form.RSHP, new Ellipse2D.Double(-30,-30,60,60)));
120 RockA.add(new Instr(Form.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1, new float[]{5,5}, 0)));
121 RockA.add(new Instr(Form.FILL, Color.black));
122 RockA.add(new Instr(Form.ELPS, new Ellipse2D.Double(-30,-30,60,60)));
123 RockA.add(new Instr(Form.STRK, new BasicStroke(5, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
124 RockA.add(new Instr(Form.LINE, new Line2D.Double(-20,0,20,0)));
125 RockA.add(new Instr(Form.LINE, new Line2D.Double(0,-20,0,20)));
126 RockA.add(new Instr(Form.RSHP, new Ellipse2D.Double(-17,-17,8,8)));
127 RockA.add(new Instr(Form.RSHP, new Ellipse2D.Double(-17,9,8,8)));
128 RockA.add(new Instr(Form.RSHP, new Ellipse2D.Double(9,-17,8,8)));
129 RockA.add(new Instr(Form.RSHP, new Ellipse2D.Double(9,9,8,8)));
130 }
131 public static final Symbol RockC = new Symbol();
132 static {
133 RockC.add(new Instr(Form.FILL, new Color(0x80c0ff)));
134 RockC.add(new Instr(Form.RSHP, new Ellipse2D.Double(-30,-30,60,60)));
135 RockC.add(new Instr(Form.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1, new float[]{5,5}, 0)));
136 RockC.add(new Instr(Form.FILL, Color.black));
137 RockC.add(new Instr(Form.ELPS, new Ellipse2D.Double(-30,-30,60,60)));
138 RockC.add(new Instr(Form.STRK, new BasicStroke(5, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
139 RockC.add(new Instr(Form.LINE, new Line2D.Double(-20,0,20,0)));
140 RockC.add(new Instr(Form.LINE, new Line2D.Double(-10,17.3,10,-17.3)));
141 RockC.add(new Instr(Form.LINE, new Line2D.Double(10,17.3,-10,-17.3)));
142 }
143 public static final Symbol Seaplane = new Symbol();
144 static {
145 Seaplane.add(new Instr(Form.BBOX, new Rectangle2D.Double(-60,-60,120,120)));
146 Seaplane.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
147 Seaplane.add(new Instr(Form.ELPS, new Ellipse2D.Double(-58,-58,116,116)));
148 Seaplane.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Areas.Plane, 1.0, 0, 0, null, null)));
149 }
150 public static final Symbol WindFarm = new Symbol();
151 static {
152 WindFarm.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
153 WindFarm.add(new Instr(Form.ELPS, new Ellipse2D.Double(-100,-100,200,200)));
154 WindFarm.add(new Instr(Form.LINE, new Line2D.Double(-35,50,35,50)));
155 WindFarm.add(new Instr(Form.LINE, new Line2D.Double(0,50,0,-27.5)));
156 WindFarm.add(new Instr(Form.LINE, new Line2D.Double(0,-27.5,30,-27.5)));
157 WindFarm.add(new Instr(Form.LINE, new Line2D.Double(0,-27.5,-13.8,-3.8)));
158 WindFarm.add(new Instr(Form.LINE, new Line2D.Double(0,-27.5,-13.8,-53.6)));
159 }
160 public static final Symbol WreckD = new Symbol();
161 static {
162 WreckD.add(new Instr(Form.FILL, new Color(0x80c0ff)));
163 WreckD.add(new Instr(Form.RSHP, new Ellipse2D.Double(-50,-40,100,80)));
164 WreckD.add(new Instr(Form.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1, new float[]{5,5}, 0)));
165 WreckD.add(new Instr(Form.FILL, Color.black));
166 WreckD.add(new Instr(Form.ELPS, new Ellipse2D.Double(-50,-40,100,80)));
167 WreckD.add(new Instr(Form.STRK, new BasicStroke(5, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
168 WreckD.add(new Instr(Form.LINE, new Line2D.Double(-40,0,40,0)));
169 WreckD.add(new Instr(Form.LINE, new Line2D.Double(0,-30,0,30)));
170 WreckD.add(new Instr(Form.LINE, new Line2D.Double(-20,-15,-20,15)));
171 WreckD.add(new Instr(Form.LINE, new Line2D.Double(20,-15,20,15)));
172 }
173 public static final Symbol WreckND = new Symbol();
174 static {
175 WreckND.add(new Instr(Form.STRK, new BasicStroke(5, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
176 WreckND.add(new Instr(Form.LINE, new Line2D.Double(-40,0,40,0)));
177 WreckND.add(new Instr(Form.LINE, new Line2D.Double(0,-30,0,30)));
178 WreckND.add(new Instr(Form.LINE, new Line2D.Double(-20,-15,-20,15)));
179 WreckND.add(new Instr(Form.LINE, new Line2D.Double(20,-15,20,15)));
180 }
181 public static final Symbol WreckS = new Symbol();
182 static {
183 WreckS.add(new Instr(Form.STRK, new BasicStroke(3, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
184 WreckS.add(new Instr(Form.ELPS, new Ellipse2D.Double(-6,-6,12,12)));
185 WreckS.add(new Instr(Form.LINE, new Line2D.Double(-40,0,-6,0)));
186 WreckS.add(new Instr(Form.LINE, new Line2D.Double(40,0,6,0)));
187 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);
188 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();
189 WreckS.add(new Instr(Form.PGON, p));
190 }
191 public static final BufferedImage Sandwaves = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
192 static {
193 Graphics2D g2 = Sandwaves.createGraphics();
194 g2.setStroke(new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
195 g2.setBackground(new Color(0, true));
196 g2.clearRect(0, 0, 100, 100);
197 g2.setPaint(new Color(0xffd400));
198 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);
199 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);
200 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);
201 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);
202 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);
203 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);
204 g2.draw(p);
205 }
206}
Note: See TracBrowser for help on using the repository browser.