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 |
|
---|
10 | package symbols;
|
---|
11 |
|
---|
12 | import java.awt.BasicStroke;
|
---|
13 | import java.awt.geom.*;
|
---|
14 | import java.util.EnumMap;
|
---|
15 |
|
---|
16 | import s57.S57val.*;
|
---|
17 | import symbols.Symbols.*;
|
---|
18 |
|
---|
19 |
|
---|
20 | public class Landmarks {
|
---|
21 | private static final Symbol Base = new Symbol();
|
---|
22 | static {
|
---|
23 | Base.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
24 | Base.add(new Instr(Form.ELPS, new Ellipse2D.Double(-10,-10,20,20)));
|
---|
25 | Base.add(new Instr(Form.LINE, new Line2D.Double(-35,0,-10,0)));
|
---|
26 | Base.add(new Instr(Form.LINE, new Line2D.Double(10,0,35,0)));
|
---|
27 | }
|
---|
28 |
|
---|
29 | public static final Symbol Chimney = new Symbol();
|
---|
30 | static {
|
---|
31 | Chimney.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Landmarks.Base, 1.0, 0, 0, null, null)));
|
---|
32 | Chimney.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
33 | Path2D.Double p = new Path2D.Double(); p.moveTo(-25.0,0.0); p.lineTo(-10.0,-120.0); p.lineTo(10.0,-120.0); p.lineTo(25.0,0.0);
|
---|
34 | p.moveTo(-10.0,-128.0); p.curveTo(-13.0,-147.0,15.0,-159.0,20.0,-148.0);
|
---|
35 | p.moveTo(16.0,-152.3); p.curveTo(58.0,-194.0,98.0,-87.0,16.0,-132.0);
|
---|
36 | p.moveTo(11.0,-128.0); p.curveTo(13.4,-132.0,20.0,-132.0,20.0,-136.0);
|
---|
37 | Chimney.add(new Instr(Form.PLIN, p));
|
---|
38 | }
|
---|
39 | public static final Symbol Church = new Symbol();
|
---|
40 | static {
|
---|
41 | Path2D.Double p = new Path2D.Double(); p.moveTo(10.0,-10.0); p.lineTo(37.0,-10.0); p.quadTo(48.0,-10.0,48.0,-21.0); p.lineTo(50.0,-21.0); p.lineTo(50.0,21.0);
|
---|
42 | p.lineTo(48.0,21.0); p.quadTo(48.0,10.0,37.0,10.0); p.lineTo(10.0,10.0); p.lineTo(10.0,37.0); p.quadTo(10.0,48.0,21.0,48.0); p.lineTo(21.0,50.0);
|
---|
43 | p.lineTo(-21.0,50.0); p.lineTo(-21.0,48.0); p.quadTo(-10.0,48.0,-10.0,37.0); p.lineTo(-10.0,10.0); p.lineTo(-37.0,10.0); p.quadTo(-48.0,10.0,-48.0,21.0);
|
---|
44 | p.lineTo(-50.0,21.0); p.lineTo(-50.0,-21.0); p.lineTo(-48.0,-21.0); p.quadTo(-48.0,-10.0,-37.0,-10.0); p.lineTo(-10.0,-10.0); p.lineTo(-10.0,-37.0);
|
---|
45 | p.quadTo(-10.0,-48.0,-21.0,-48.0); p.lineTo(-21.0,-50.0); p.lineTo(21.0,-50.0); p.lineTo(21.0,-48.0); p.quadTo(10.0,-48.0,10.0,-37.0); p.closePath();
|
---|
46 | Church.add(new Instr(Form.PGON, p));
|
---|
47 | }
|
---|
48 | public static final Symbol ChurchTower = new Symbol();
|
---|
49 | static {
|
---|
50 | ChurchTower.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
51 | ChurchTower.add(new Instr(Form.RECT, new Rectangle2D.Double(-36,-36,72,72)));
|
---|
52 | ChurchTower.add(new Instr(Form.ELPS, new Ellipse2D.Double(-2,-2,4,4)));
|
---|
53 | }
|
---|
54 | public static final Symbol Cross = new Symbol();
|
---|
55 | static {
|
---|
56 | Cross.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Landmarks.Base, 1.0, 0, 0, null, null)));
|
---|
57 | Cross.add(new Instr(Form.STRK, new BasicStroke(6, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
58 | Cross.add(new Instr(Form.LINE, new Line2D.Double(0,-10,0,-150)));
|
---|
59 | Cross.add(new Instr(Form.LINE, new Line2D.Double(-30,-115,30,-115)));
|
---|
60 | }
|
---|
61 | public static final Symbol DishAerial = new Symbol();
|
---|
62 | static {
|
---|
63 | DishAerial.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Landmarks.Base, 1.0, 0, 0, null, null)));
|
---|
64 | DishAerial.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL)));
|
---|
65 | Path2D.Double p = new Path2D.Double(); p.moveTo(-7.8,-6.0); p.lineTo(0.0,-62.0); p.lineTo(7.8,-6.0); p.moveTo(18.0,-109.0); p.lineTo(25.0,-113.0);
|
---|
66 | p.moveTo(-9.5,-157.0); p.curveTo(-60.7,-125.5,-16.5,-33.9,44.9,-61.7); p.closePath();
|
---|
67 | DishAerial.add(new Instr(Form.PLIN, p));
|
---|
68 | }
|
---|
69 | public static final Symbol Dome = new Symbol();
|
---|
70 | static {
|
---|
71 | Dome.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
72 | Dome.add(new Instr(Form.ELPS, new Ellipse2D.Double(-36,-36,72,72)));
|
---|
73 | Dome.add(new Instr(Form.RSHP, new Ellipse2D.Double(-4,-4,8,8)));
|
---|
74 | }
|
---|
75 | public static final Symbol Flagstaff = new Symbol();
|
---|
76 | static {
|
---|
77 | Flagstaff.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Landmarks.Base, 1.0, 0, 0, null, null)));
|
---|
78 | Flagstaff.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
79 | Path2D.Double p = new Path2D.Double(); p.moveTo(0.0,-10.0); p.lineTo(0.0,-150.0); p.moveTo(0.0,-140.0); p.lineTo(40.0,-140.0); p.lineTo(40.0,-100.0); p.lineTo(0.0,-100.0);
|
---|
80 | Flagstaff.add(new Instr(Form.PLIN, p));
|
---|
81 | }
|
---|
82 | public static final Symbol FlareStack = new Symbol();
|
---|
83 | static {
|
---|
84 | FlareStack.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Landmarks.Base, 1.0, 0, 0, null, null)));
|
---|
85 | FlareStack.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
86 | Path2D.Double p = new Path2D.Double(); p.moveTo(-7.8,-6.0); p.lineTo(-7.8,-100.0); p.lineTo(7.8,-100.0); p.lineTo(7.8,-6.0);
|
---|
87 | FlareStack.add(new Instr(Form.PLIN, p));
|
---|
88 | FlareStack.add(new Instr(Form.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)));
|
---|
89 | p = new Path2D.Double(); p.moveTo(21.6,-169.6); p.curveTo(-22.0,-132.4,-27.4,-103.5,3.0,-100.0); p.curveTo(39.0,-118.0,-4.0,-141.0,21.6,-169.6);
|
---|
90 | FlareStack.add(new Instr(Form.PLIN, p));
|
---|
91 | }
|
---|
92 | public static final Symbol LandTower = new Symbol();
|
---|
93 | static {
|
---|
94 | LandTower.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Landmarks.Base, 1.0, 0, 0, null, null)));
|
---|
95 | LandTower.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
96 | LandTower.add(new Instr(Form.LINE, new Line2D.Double(-25,0,-15,-120)));
|
---|
97 | LandTower.add(new Instr(Form.LINE, new Line2D.Double(25,0,15,-120)));
|
---|
98 | LandTower.add(new Instr(Form.RECT, new Rectangle2D.Double(-15,-150,30,30)));
|
---|
99 | }
|
---|
100 | public static final Symbol Mast = new Symbol();
|
---|
101 | static {
|
---|
102 | Mast.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Landmarks.Base, 1.0, 0, 0, null, null)));
|
---|
103 | Mast.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL)));
|
---|
104 | Path2D.Double p = new Path2D.Double(); p.moveTo(-25.0,0.0); p.lineTo(0.0,-150.0); p.lineTo(25.0,0.0);
|
---|
105 | Mast.add(new Instr(Form.PLIN, p));
|
---|
106 | }
|
---|
107 | public static final Symbol Monument = new Symbol();
|
---|
108 | static {
|
---|
109 | Monument.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Landmarks.Base, 1.0, 0, 0, null, null)));
|
---|
110 | Monument.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER)));
|
---|
111 | Monument.add(new Instr(Form.LINE, new Line2D.Double(-25,0,-15,-105)));
|
---|
112 | Monument.add(new Instr(Form.LINE, new Line2D.Double(25,0,15,-105)));
|
---|
113 | Monument.add(new Instr(Form.EARC, new Arc2D.Double(-25.0,-150.0,50.0,50.0,233.0,-285.0,Arc2D.OPEN)));
|
---|
114 | }
|
---|
115 | public static final Symbol Platform = new Symbol();
|
---|
116 | static {
|
---|
117 | Platform.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
118 | Platform.add(new Instr(Form.RECT, new Rectangle2D.Double(-48,-48,96,96)));
|
---|
119 | Platform.add(new Instr(Form.RSHP, new Ellipse2D.Double(-4,-4,8,8)));
|
---|
120 | }
|
---|
121 | public static final Symbol RadioTV = new Symbol();
|
---|
122 | static {
|
---|
123 | RadioTV.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL)));
|
---|
124 | RadioTV.add(new Instr(Form.EARC, new Arc2D.Double(-30.0,-180.0,60.0,60.0,45.0,-90.0,Arc2D.OPEN)));
|
---|
125 | RadioTV.add(new Instr(Form.EARC, new Arc2D.Double(-45.0,-195.0,90.0,90.0,45.0,-90.0,Arc2D.OPEN)));
|
---|
126 | RadioTV.add(new Instr(Form.EARC, new Arc2D.Double(-30.0,-180.0,60.0,60.0,225.0,-90.0,Arc2D.OPEN)));
|
---|
127 | RadioTV.add(new Instr(Form.EARC, new Arc2D.Double(-45.0,-195.0,90.0,90.0,225.0,-90.0,Arc2D.OPEN)));
|
---|
128 | }
|
---|
129 | public static final Symbol Spire = new Symbol();
|
---|
130 | static {
|
---|
131 | Spire.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
132 | Spire.add(new Instr(Form.ELPS, new Ellipse2D.Double(-25,-25,50,50)));
|
---|
133 | Spire.add(new Instr(Form.RSHP, new Ellipse2D.Double(-4,-4,8,8)));
|
---|
134 | }
|
---|
135 | public static final Symbol Minaret = new Symbol();
|
---|
136 | static {
|
---|
137 | Minaret.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Landmarks.Spire, 1.0, 0, 0, null, null)));
|
---|
138 | Minaret.add(new Instr(Form.STRK, new BasicStroke(6, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
139 | Minaret.add(new Instr(Form.LINE, new Line2D.Double(0,-25,0,-50)));
|
---|
140 | Minaret.add(new Instr(Form.STRK, new BasicStroke(6, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER)));
|
---|
141 | Minaret.add(new Instr(Form.EARC, new Arc2D.Double(-40.0,-110.0,80.0,60.0,180.0,180.0,Arc2D.OPEN)));
|
---|
142 | }
|
---|
143 | public static final Symbol Temple = new Symbol();
|
---|
144 | static {
|
---|
145 | Temple.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
146 | Temple.add(new Instr(Form.RECT, new Rectangle2D.Double(-25,-15,50,30)));
|
---|
147 | Temple.add(new Instr(Form.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
148 | Temple.add(new Instr(Form.LINE, new Line2D.Double(-35,-21,35,21)));
|
---|
149 | Temple.add(new Instr(Form.LINE, new Line2D.Double(-35,21,35,-21)));
|
---|
150 | }
|
---|
151 | public static final Symbol WaterTower = new Symbol();
|
---|
152 | static {
|
---|
153 | WaterTower.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Landmarks.Base, 1.0, 0, 0, null, null)));
|
---|
154 | WaterTower.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
155 | WaterTower.add(new Instr(Form.LINE, new Line2D.Double(-25,0,-15,-120)));
|
---|
156 | WaterTower.add(new Instr(Form.LINE, new Line2D.Double(25,0,15,-120)));
|
---|
157 | WaterTower.add(new Instr(Form.RECT, new Rectangle2D.Double(-25,-150,50,30)));
|
---|
158 | }
|
---|
159 | public static final Symbol WindMotor = new Symbol();
|
---|
160 | static {
|
---|
161 | WindMotor.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Landmarks.Base, 1.0, 0, 0, null, null)));
|
---|
162 | WindMotor.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER)));
|
---|
163 | WindMotor.add(new Instr(Form.LINE, new Line2D.Double(0,-10,0,-90)));
|
---|
164 | WindMotor.add(new Instr(Form.LINE, new Line2D.Double(0,-90,30,-90)));
|
---|
165 | WindMotor.add(new Instr(Form.LINE, new Line2D.Double(0,-90,-14,-116.6)));
|
---|
166 | WindMotor.add(new Instr(Form.LINE, new Line2D.Double(0,-90,-14.3,-66.7)));
|
---|
167 | }
|
---|
168 | public static final Symbol Windmill = new Symbol();
|
---|
169 | static {
|
---|
170 | Windmill.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
|
---|
171 | Windmill.add(new Instr(Form.ELPS, new Ellipse2D.Double(-12,-12,24,24)));
|
---|
172 | Windmill.add(new Instr(Form.LINE, new Line2D.Double(-30,-42,30,10)));
|
---|
173 | Windmill.add(new Instr(Form.LINE, new Line2D.Double(-30,10,30,-42)));
|
---|
174 | }
|
---|
175 | public static final Symbol Windsock = new Symbol();
|
---|
176 | static {
|
---|
177 | Windsock.add(new Instr(Form.SYMB, new Symbols.SubSymbol(Landmarks.Base, 1.0, 0, 0, null, null)));
|
---|
178 | Windsock.add(new Instr(Form.STRK, new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER)));
|
---|
179 | Windsock.add(new Instr(Form.LINE, new Line2D.Double(0,-10,0,-100)));
|
---|
180 | Windsock.add(new Instr(Form.STRK, new BasicStroke(8, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER)));
|
---|
181 | Windsock.add(new Instr(Form.LINE, new Line2D.Double(0,-100,0,-150)));
|
---|
182 | Windsock.add(new Instr(Form.STRK, new BasicStroke(2, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)));
|
---|
183 | Path2D.Double p = new Path2D.Double(); p.moveTo(0.0,-100.0); p.lineTo(10.0,-100.0); p.lineTo(10.0,-150.0); p.lineTo(0.0,-150.0);
|
---|
184 | p.moveTo(10.0,-150.0); p.lineTo(50.0,-145.0); p.lineTo(120.0,-70.0); p.quadTo(120.0,-55.0,105.0,-55.0);
|
---|
185 | p.lineTo(55,-95); p.lineTo(40,-102); p.lineTo(10,-100); p.moveTo(40,-102); p.lineTo(50,-120); p.moveTo(55,-95); p.lineTo(75,-97);
|
---|
186 | Windsock.add(new Instr(Form.PLIN, p));
|
---|
187 | }
|
---|
188 |
|
---|
189 | public static final EnumMap<CatLMK, Symbol> Shapes = new EnumMap<CatLMK, Symbol>(CatLMK.class);
|
---|
190 | static {
|
---|
191 | Shapes.put(CatLMK.LMK_CARN, Beacons.Cairn); Shapes.put(CatLMK.LMK_CHMY, Landmarks.Chimney);
|
---|
192 | Shapes.put(CatLMK.LMK_DISH, Landmarks.DishAerial); Shapes.put(CatLMK.LMK_FLAG, Landmarks.Flagstaff); Shapes.put(CatLMK.LMK_FLAR, Landmarks.FlareStack);
|
---|
193 | Shapes.put(CatLMK.LMK_MAST, Landmarks.Mast); Shapes.put(CatLMK.LMK_WNDS, Landmarks.Windsock); Shapes.put(CatLMK.LMK_MNMT, Landmarks.Monument);
|
---|
194 | Shapes.put(CatLMK.LMK_CLMN, Landmarks.Monument); Shapes.put(CatLMK.LMK_MEML, Landmarks.Monument); Shapes.put(CatLMK.LMK_OBLK, Landmarks.Monument);
|
---|
195 | Shapes.put(CatLMK.LMK_STAT, Landmarks.Monument); Shapes.put(CatLMK.LMK_CROS, Landmarks.Cross); Shapes.put(CatLMK.LMK_DOME, Landmarks.Dome);
|
---|
196 | Shapes.put(CatLMK.LMK_RADR, Landmarks.Mast); Shapes.put(CatLMK.LMK_TOWR, Landmarks.LandTower); Shapes.put(CatLMK.LMK_WNDM, Landmarks.Windmill);
|
---|
197 | Shapes.put(CatLMK.LMK_WNDG, Landmarks.WindMotor); Shapes.put(CatLMK.LMK_SPIR, Landmarks.Spire); Shapes.put(CatLMK.LMK_BLDR, Beacons.Cairn);
|
---|
198 | Shapes.put(CatLMK.LMK_MNRT, Landmarks.Minaret); Shapes.put(CatLMK.LMK_WTRT, Landmarks.WaterTower);
|
---|
199 | }
|
---|
200 |
|
---|
201 | public static final EnumMap<FncFNC, Symbol> Funcs = new EnumMap<FncFNC, Symbol>(FncFNC.class);
|
---|
202 | static {
|
---|
203 | Funcs.put(FncFNC.FNC_CHCH, Landmarks.Church); Funcs.put(FncFNC.FNC_CHPL, Landmarks.Church); Funcs.put(FncFNC.FNC_TMPL, Landmarks.Temple);
|
---|
204 | Funcs.put(FncFNC.FNC_PGDA, Landmarks.Temple); Funcs.put(FncFNC.FNC_SHSH, Landmarks.Temple); Funcs.put(FncFNC.FNC_BTMP, Landmarks.Temple);
|
---|
205 | Funcs.put(FncFNC.FNC_MOSQ, Landmarks.Minaret); Funcs.put(FncFNC.FNC_MRBT, Landmarks.Spire); Funcs.put(FncFNC.FNC_COMM, Landmarks.RadioTV);
|
---|
206 | Funcs.put(FncFNC.FNC_TV, Landmarks.RadioTV); Funcs.put(FncFNC.FNC_RADO, Landmarks.RadioTV); Funcs.put(FncFNC.FNC_RADR, Landmarks.RadioTV);
|
---|
207 | Funcs.put(FncFNC.FNC_LGHT, Beacons.LightMajor); Funcs.put(FncFNC.FNC_MCWV, Landmarks.RadioTV); Funcs.put(FncFNC.FNC_HBRM, Harbours.HarbourMaster);
|
---|
208 | Funcs.put(FncFNC.FNC_CSTM, Harbours.Customs); Funcs.put(FncFNC.FNC_HLTH, Harbours.Hospital); Funcs.put(FncFNC.FNC_HOSP, Harbours.Hospital);
|
---|
209 | }
|
---|
210 | }
|
---|