source: osm/applications/editors/josm/plugins/smed2/src/symbols/Topmarks.java@ 29198

Last change on this file since 29198 was 29198, checked in by malcolmh, 12 years ago

save

File size: 15.1 KB
Line 
1/* Copyright 2012 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.BasicStroke;
13import java.awt.Color;
14import java.awt.Rectangle;
15import java.awt.geom.AffineTransform;
16import java.awt.geom.Ellipse2D;
17import java.awt.geom.Line2D;
18import java.awt.geom.Path2D;
19import java.util.EnumMap;
20
21import s57.S57val.*;
22import symbols.Symbols.*;
23
24public class Topmarks {
25
26 public static final Symbol TopBoard = new Symbol();
27 static {
28 TopBoard.add(new Instr(Prim.BBOX, new Rectangle(-20,-80,40,80)));
29 Symbol colours = new Symbol();
30 Path2D.Double p = new Path2D.Double(); p.moveTo(-19.0,-2.0); p.lineTo(-19.0,-39.0); p.lineTo(19.0,-39.0); p.lineTo(19.0,-2.0); p.closePath();
31 colours.add(new Instr(Prim.P1, p));
32 TopBoard.add(new Instr(Prim.COLR, colours));
33 TopBoard.add(new Instr(Prim.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
34 TopBoard.add(new Instr(Prim.FILL, Color.black));
35 p = new Path2D.Double(); p.moveTo(-19.0,-2.0); p.lineTo(-19.0,-39.0); p.lineTo(19.0,-39.0); p.lineTo(19.0,-2.0); p.closePath();
36 TopBoard.add(new Instr(Prim.PLIN, p));
37 }
38 public static final Symbol TopCan = new Symbol();
39 static {
40 TopCan.add(new Instr(Prim.BBOX, new Rectangle(-20,-80,40,80)));
41 Symbol colours = new Symbol();
42 Path2D.Double p = new Path2D.Double(); p.moveTo(-12.0,-15.0); p.lineTo(-12.0,-48.0); p.lineTo(12.0,-48.0); p.lineTo(12.0,-15.0); p.closePath();
43 colours.add(new Instr(Prim.P1, p));
44 TopCan.add(new Instr(Prim.COLR, colours));
45 TopCan.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
46 TopCan.add(new Instr(Prim.FILL, Color.black));
47 TopCan.add(new Instr(Prim.LINE, new Line2D.Double(0,0,0,-15)));
48 p = new Path2D.Double(); p.moveTo(-12.0,-15.0); p.lineTo(-12.0,-48.0); p.lineTo(12.0,-48.0); p.lineTo(12.0,-15.0); p.closePath();
49 TopCan.add(new Instr(Prim.PLIN, p));
50 }
51 public static final Symbol TopCone = new Symbol();
52 static {
53 TopCone.add(new Instr(Prim.BBOX, new Rectangle(-20,-80,40,80)));
54 Symbol colours = new Symbol();
55 Path2D.Double p = new Path2D.Double(); p.moveTo(-15.0,-15.0); p.lineTo(0.0,-45.0); p.lineTo(15.0,-15.0); p.closePath();
56 colours.add(new Instr(Prim.P1, p));
57 TopCone.add(new Instr(Prim.COLR, colours));
58 TopCone.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
59 TopCone.add(new Instr(Prim.FILL, Color.black));
60 TopCone.add(new Instr(Prim.LINE, new Line2D.Double(0,0,0,-15)));
61 p = new Path2D.Double(); p.moveTo(-15.0,-15.0); p.lineTo(0.0,-45.0); p.lineTo(15.0,-15.0); p.closePath();
62 TopCone.add(new Instr(Prim.PLIN, p));
63 }
64 public static final Symbol TopCross = new Symbol();
65 static {
66 TopCross.add(new Instr(Prim.BBOX, new Rectangle(-30,-80,60,80)));
67 Symbol colours = new Symbol();
68 Path2D.Double p = new Path2D.Double(); p.moveTo(-5.0,-15.0); p.lineTo(-5.0,-32.5); p.lineTo(-22.5,-32.5); p.lineTo(-22.5,-42.5); p.lineTo(-5.0,-42.5);
69 p.lineTo(-5.0,-60.0); p.lineTo(5.0,-60.0); p.lineTo(5.0,-42.5); p.lineTo(22.5,-42.5); p.lineTo(22.5,-32.5); p.lineTo(5.0,-32.5); p.lineTo(5.0,-15.0); p.closePath();
70 colours.add(new Instr(Prim.P1, p));
71 TopCross.add(new Instr(Prim.COLR, colours));
72 TopCross.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
73 TopCross.add(new Instr(Prim.FILL, Color.black));
74 TopCross.add(new Instr(Prim.LINE, new Line2D.Double(0,0,0,-15)));
75 TopCross.add(new Instr(Prim.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
76 p = new Path2D.Double(); p.moveTo(-5.0,-15.0); p.lineTo(-5.0,-32.5); p.lineTo(-22.5,-32.5); p.lineTo(-22.5,-42.5); p.lineTo(-5.0,-42.5); p.lineTo(-5.0,-60.0);
77 p.lineTo(5.0,-60.0); p.lineTo(5.0,-42.5); p.lineTo(22.5,-42.5); p.lineTo(22.5,-32.5); p.lineTo(5.0,-32.5); p.lineTo(5.0,-15.0); p.closePath();
78 TopCross.add(new Instr(Prim.PLIN, p));
79 }
80 public static final Symbol TopEast = new Symbol();
81 static {
82 TopEast.add(new Instr(Prim.BBOX, new Rectangle(-30,-80,60,80)));
83 Symbol colours = new Symbol();
84 Path2D.Double p = new Path2D.Double(); p.moveTo(0.0,-80.0); p.lineTo(-15.0,-47.0); p.lineTo(15.0,-47.0); p.closePath();
85 colours.add(new Instr(Prim.P1, p));
86 p = new Path2D.Double(); p.moveTo(0.0,-10.0); p.lineTo(-15.0,-43.0); p.lineTo(15.0,-43.0); p.closePath();
87 colours.add(new Instr(Prim.P2, p));
88 TopEast.add(new Instr(Prim.COLR, colours));
89 TopEast.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
90 TopEast.add(new Instr(Prim.FILL, Color.black));
91 TopEast.add(new Instr(Prim.LINE, new Line2D.Double(0,0,0,-10)));
92 TopEast.add(new Instr(Prim.LINE, new Line2D.Double(0,-43,0,-47)));
93 TopEast.add(new Instr(Prim.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
94 p = new Path2D.Double(); p.moveTo(0.0,-10.0); p.lineTo(-15.0,-43.0); p.lineTo(15.0,-43.0); p.closePath();
95 p.moveTo(0.0,-80.0); p.lineTo(-15.0,-47.0); p.lineTo(15.0,-47.0); p.closePath();
96 TopEast.add(new Instr(Prim.PLIN, p));
97 }
98 public static final Symbol TopIsol = new Symbol();
99 static {
100 TopIsol.add(new Instr(Prim.BBOX, new Rectangle(-30,-80,60,80)));
101 Symbol colours = new Symbol();
102 Path2D.Double p = new Path2D.Double(); p.moveTo(-13.0,-55.0); p.curveTo(-13.0, -72.3, 13.0, -72.3, 13.0,-55.0); p.curveTo(13.0, -37.7, -13.0, -37.7, -13.0,-55.0); p.closePath();
103 colours.add(new Instr(Prim.P1, p));
104 p = new Path2D.Double(); p.moveTo(-13.0,-28.0); p.curveTo(-13.0, -45.3, 13.0, -45.3, 13.0,-28.0); p.curveTo(13.0, -10.7, -13.0, -10.7, -13.0,-28.0); p.closePath();
105 colours.add(new Instr(Prim.P2, p));
106 TopIsol.add(new Instr(Prim.COLR, colours));
107 TopIsol.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
108 TopIsol.add(new Instr(Prim.FILL, Color.black));
109 TopIsol.add(new Instr(Prim.LINE, new Line2D.Double(0,0,0,-15)));
110 TopIsol.add(new Instr(Prim.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
111 TopIsol.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-13,-41,26,26)));
112 TopIsol.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-13,-68,26,26)));
113 }
114 public static final Symbol TopMooring = new Symbol();
115 static {
116 TopMooring.add(new Instr(Prim.BBOX, new Rectangle(-30,-80,60,80)));
117 TopMooring.add(new Instr(Prim.STRK, new BasicStroke(3, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
118 TopMooring.add(new Instr(Prim.FILL, Color.black));
119 TopMooring.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-1.5,-6,3,3)));
120 TopMooring.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-8.5,-25,17,17)));
121 }
122 public static final Symbol TopNorth = new Symbol();
123 static {
124 TopNorth.add(new Instr(Prim.BBOX, new Rectangle(-30,-80,60,80)));
125 Symbol colours = new Symbol();
126 Path2D.Double p = new Path2D.Double(); p.moveTo(0.0,-78.0); p.lineTo(-15.0,-45.0); p.lineTo(15.0,-45.0); p.closePath();
127 colours.add(new Instr(Prim.P1, p));
128 p = new Path2D.Double(); p.moveTo(-15.0,-10.0); p.lineTo(0.0,-43.0); p.lineTo(15.0,-10.0); p.closePath();
129 colours.add(new Instr(Prim.P2, p));
130 TopNorth.add(new Instr(Prim.COLR, colours));
131 TopNorth.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
132 TopNorth.add(new Instr(Prim.FILL, Color.black));
133 TopNorth.add(new Instr(Prim.LINE, new Line2D.Double(0,0,0,-10)));
134 TopNorth.add(new Instr(Prim.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
135 p = new Path2D.Double(); p.moveTo(-15.0,-10.0); p.lineTo(0.0,-43.0); p.lineTo(15.0,-10.0); p.closePath();
136 p.moveTo(0.0,-78.0); p.lineTo(-15.0,-45.0); p.lineTo(15.0,-45.0); p.closePath();
137 TopNorth.add(new Instr(Prim.PLIN, p));
138 }
139 public static final Symbol TopSouth = new Symbol();
140 static {
141 TopSouth.add(new Instr(Prim.BBOX, new Rectangle(-30,-80,60,80)));
142 Symbol colours = new Symbol();
143 Path2D.Double p = new Path2D.Double(); p.moveTo(-15.0,-78.0); p.lineTo(0.0,-45.0); p.lineTo(15.0,-78.0); p.closePath();
144 colours.add(new Instr(Prim.P1, p));
145 p = new Path2D.Double(); p.moveTo(0.0,-10.0); p.lineTo(-15.0,-43.0); p.lineTo(15.0,-43.0); p.closePath();
146 colours.add(new Instr(Prim.P2, p));
147 TopSouth.add(new Instr(Prim.COLR, colours));
148 TopSouth.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
149 TopSouth.add(new Instr(Prim.FILL, Color.black));
150 TopSouth.add(new Instr(Prim.LINE, new Line2D.Double(0,0,0,-10)));
151 TopSouth.add(new Instr(Prim.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
152 p = new Path2D.Double(); p.moveTo(0.0,-10.0); p.lineTo(-15.0,-43.0); p.lineTo(15.0,-43.0); p.closePath();
153 p.moveTo(-15.0,-78.0); p.lineTo(0.0,-45.0); p.lineTo(15.0,-78.0); p.closePath();
154 TopSouth.add(new Instr(Prim.PLIN, p));
155 }
156 public static final Symbol TopSphere = new Symbol();
157 static {
158 TopSphere.add(new Instr(Prim.BBOX, new Rectangle(-30,-80,60,80)));
159 Symbol colours = new Symbol();
160 Path2D.Double p = new Path2D.Double(); p.moveTo(-14.0,-28.0); p.curveTo(-14.0,-46.7,14.0,-46.7,14.0,-28.0); p.curveTo(14.0,-9.3,-14.0,-9.3,-14.0,-28.0); p.closePath();
161 colours.add(new Instr(Prim.P1, p));
162 TopSphere.add(new Instr(Prim.COLR, colours));
163 TopSphere.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
164 TopSphere.add(new Instr(Prim.FILL, Color.black));
165 TopSphere.add(new Instr(Prim.LINE, new Line2D.Double(0,0,0,-15)));
166 TopSphere.add(new Instr(Prim.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
167 TopSphere.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-14,-42,28,28)));
168 }
169 public static final Symbol TopSquare = new Symbol();
170 static {
171 TopSquare.add(new Instr(Prim.BBOX, new Rectangle(-20,-80,40,80)));
172 Symbol colours = new Symbol();
173 Path2D.Double p = new Path2D.Double(); p.moveTo(-13.0,-1.0); p.lineTo(-13.0,-27.0); p.lineTo(13.0,-27.0); p.lineTo(13.0,-1.0); p.closePath();
174 colours.add(new Instr(Prim.P1, p));
175 TopSquare.add(new Instr(Prim.COLR, colours));
176 TopSquare.add(new Instr(Prim.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
177 TopSquare.add(new Instr(Prim.FILL, Color.black));
178 p = new Path2D.Double(); p.moveTo(-13.0,-1.0); p.lineTo(-13.0,-27.0); p.lineTo(13.0,-27.0); p.lineTo(13.0,-1.0); p.closePath();
179 TopSquare.add(new Instr(Prim.PLIN, p));
180 }
181 public static final Symbol TopTriangle = new Symbol();
182 static {
183 TopTriangle.add(new Instr(Prim.BBOX, new Rectangle(-20,-80,40,80)));
184 Symbol colours = new Symbol();
185 Path2D.Double p = new Path2D.Double(); p.moveTo(-15.0,-1.0); p.lineTo(0.0,-29.0); p.lineTo(15.0,-1.0); p.closePath();
186 colours.add(new Instr(Prim.P1, p));
187 TopTriangle.add(new Instr(Prim.COLR, colours));
188 TopTriangle.add(new Instr(Prim.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
189 TopTriangle.add(new Instr(Prim.FILL, Color.black));
190 p = new Path2D.Double(); p.moveTo(-15.0,-1.0); p.lineTo(0.0,-29.0); p.lineTo(15.0,-1.0); p.closePath();
191 TopTriangle.add(new Instr(Prim.PLIN, p));
192 }
193 public static final Symbol TopWest = new Symbol();
194 static {
195 TopWest.add(new Instr(Prim.BBOX, new Rectangle(-30,-80,60,80)));
196 Symbol colours = new Symbol();
197 Path2D.Double p = new Path2D.Double(); p.moveTo(-15.0,-78.0); p.lineTo(0.0,-45.0); p.lineTo(15.0,-78.0); p.closePath();
198 colours.add(new Instr(Prim.P1, p));
199 p = new Path2D.Double(); p.moveTo(-15.0,-10.0); p.lineTo(0.0,-43.0); p.lineTo(15.0,-10.0); p.closePath();
200 colours.add(new Instr(Prim.P2, p));
201 TopWest.add(new Instr(Prim.COLR, colours));
202 TopWest.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
203 TopWest.add(new Instr(Prim.FILL, Color.black));
204 TopWest.add(new Instr(Prim.LINE, new Line2D.Double(0,0,0,-10)));
205 TopWest.add(new Instr(Prim.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
206 p = new Path2D.Double(); p.moveTo(-15.0,-10.0); p.lineTo(0.0,-43.0); p.lineTo(15.0,-10.0); p.closePath();
207 p.moveTo(-15.0,-78.0); p.lineTo(0.0,-45.0); p.lineTo(15.0,-78.0); p.closePath();
208 TopWest.add(new Instr(Prim.PLIN, p));
209 }
210 public static final Symbol TopX = new Symbol();
211 static {
212 TopX.add(new Instr(Prim.BBOX, new Rectangle(-30,-80,60,80)));
213 Symbol colours = new Symbol();
214 Path2D.Double p = new Path2D.Double(); p.moveTo(0.0,-27.7); p.lineTo(-12.4,-15.7); p.lineTo(-19.3,-22.6); p.lineTo(-7.3,-35.0); p.lineTo(-19.3,-47.3);
215 p.lineTo(-12.4,-54.2); p.lineTo(0.0,-42.4); p.lineTo(12.4,-54.2); p.lineTo(19.3,-47.3); p.lineTo(7.3,-35.0); p.lineTo(19.3,-22.6); p.lineTo(12.4,-15.7); p.closePath();
216 colours.add(new Instr(Prim.P1, p));
217 TopX.add(new Instr(Prim.COLR, colours));
218 TopX.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
219 TopX.add(new Instr(Prim.FILL, Color.black));
220 TopX.add(new Instr(Prim.LINE, new Line2D.Double(0,0,0,-27)));
221 TopX.add(new Instr(Prim.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
222 p = new Path2D.Double(); p.moveTo(0.0,-27.7); p.lineTo(-12.4,-15.7); p.lineTo(-19.3,-22.6); p.lineTo(-7.3,-35.0); p.lineTo(-19.3,-47.3); p.lineTo(-12.4,-54.2); p.lineTo(0.0,-42.4);
223 p.lineTo(12.4,-54.2); p.lineTo(19.3,-47.3); p.lineTo(7.3,-35.0); p.lineTo(19.3,-22.6); p.lineTo(12.4,-15.7); p.closePath();
224 TopX.add(new Instr(Prim.PLIN, p));
225 }
226
227 public static final EnumMap<TopSHP, Symbol> Shapes = new EnumMap<TopSHP, Symbol>(TopSHP.class);
228 static {
229 Shapes.put(TopSHP.TOP_BORD, TopBoard); Shapes.put(TopSHP.TOP_CAN, TopCan); Shapes.put(TopSHP.TOP_CONE, TopCone); Shapes.put(TopSHP.TOP_CROS, TopCross);
230 Shapes.put(TopSHP.TOP_EAST, TopEast); Shapes.put(TopSHP.TOP_ISD, TopIsol); Shapes.put(TopSHP.TOP_NORTH, TopNorth); Shapes.put(TopSHP.TOP_SOUTH, TopSouth);
231 Shapes.put(TopSHP.TOP_SPHR, TopSphere); Shapes.put(TopSHP.TOP_SQUR, TopSquare); Shapes.put(TopSHP.TOP_TRI, TopTriangle); Shapes.put(TopSHP.TOP_WEST, TopWest);
232 Shapes.put(TopSHP.TOP_SALT, TopX);
233 }
234 public static final EnumMap<BoySHP, Delta> Buoys = new EnumMap<BoySHP, Delta>(BoySHP.class);
235 static {
236 Buoys.put(BoySHP.BOY_PILR, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 31.5, -95.0)));
237 Buoys.put(BoySHP.BOY_SPAR, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 31.5, -95.0)));
238 Buoys.put(BoySHP.BOY_CAN, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 12.7, -37.9)));
239 Buoys.put(BoySHP.BOY_CONE, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 12.7, -37.9)));
240 Buoys.put(BoySHP.BOY_SPHR, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 12.7, -37.9)));
241 Buoys.put(BoySHP.BOY_BARL, new Delta(Handle.BC, new AffineTransform(0.948324, 0.317305, -0.3173047, 0.948324, 12.7, -37.9)));
242 Buoys.put(BoySHP.BOY_SUPR, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0.0, -42.0)));
243 Buoys.put(BoySHP.BOY_ICE, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0.0, -25.0)));
244 }
245 public static final Delta Floats = new Delta(Handle.BC, AffineTransform.getTranslateInstance(0.0, -42.0));
246 public static final Delta Beacons = new Delta(Handle.BC, AffineTransform.getTranslateInstance(0.0, -70.0));
247
248}
Note: See TracBrowser for help on using the repository browser.