source: osm/applications/editors/josm/plugins/smed2/src/symbols/Facilities.java@ 30157

Last change on this file since 30157 was 30157, checked in by malcolmh, 11 years ago

save

File size: 13.4 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.geom.*;
15import java.util.EnumMap;
16
17import s57.S57val.*;
18import symbols.Symbols.*;
19
20public class Facilities {
21 private static final Symbol Facility = new Symbol();
22 static {
23 Facility.add(new Instr(Prim.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
24 Facility.add(new Instr(Prim.FILL, new Color(0x80ffffff, true)));
25 RoundRectangle2D.Double s = new RoundRectangle2D.Double(-29,-29,58,58,15,15);
26 Facility.add(new Instr(Prim.RSHP, s));
27 Facility.add(new Instr(Prim.FILL, new Color(0xa30075)));
28 Facility.add(new Instr(Prim.RRCT, s));
29 }
30 public static final Symbol Boatlift = new Symbol();//was Crane
31 static {
32 Boatlift.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-30,60,60)));
33 Boatlift.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Facilities.Facility, 1.0, 0, 0, null, null)));
34 Boatlift.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)));
35 Boatlift.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-3.7,-19.7,12,12)));
36 Boatlift.add(new Instr(Prim.LINE, new Line2D.Double(2.3,-7.7,2.3,-2.0)));
37 Boatlift.add(new Instr(Prim.EARC, new Arc2D.Double(-10.0,-1.5,20,20,75.0,-260.0,Arc2D.OPEN)));
38 }
39 public static final Symbol Boatyard = new Symbol();
40 static {
41 Boatyard.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-30,60,60)));
42 Boatyard.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Facilities.Facility, 1.0, 0, 0, null, null)));
43 Boatyard.add(new Instr(Prim.STRK, new BasicStroke(8, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER)));
44 Boatyard.add(new Instr(Prim.LINE, new Line2D.Double(19,19,-8,-8)));
45 Path2D.Double p = new Path2D.Double(); p.moveTo(-11.3,-11.3); p.lineTo(-10.5,-17.5); p.lineTo(-14.8,-21.9); p.lineTo(-11.3,-25.4); p.lineTo(-7.4,-21.5);
46 p.curveTo(1.0,-11.5,-11.5,1.0,-21.5,-7.4); p.lineTo(-25.4,-11.3); p.lineTo(-21.9,-14.8); p.lineTo(-17.5,-10.5); p.closePath();
47 Boatyard.add(new Instr(Prim.PGON, p));
48 }
49 public static final Symbol Chandler = new Symbol();
50 static {
51 Chandler.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-30,60,60)));
52 Chandler.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Facilities.Facility, 1.0, 0, 0, null, null)));
53 Chandler.add(new Instr(Prim.STRK, new BasicStroke(5, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)));
54 Chandler.add(new Instr(Prim.ELPS, new Ellipse2D.Double(14,7,10,10)));
55 Chandler.add(new Instr(Prim.LINE, new Line2D.Double(-23.0,12.0,14.0,12.0)));
56 Chandler.add(new Instr(Prim.LINE, new Line2D.Double(8.0,21.0,8.0,-8.6)));
57 Chandler.add(new Instr(Prim.LINE, new Line2D.Double(-16.0,21.0,-16.0,-8.6)));
58 Chandler.add(new Instr(Prim.EARC, new Arc2D.Double(-16.0,-20.5,24,24,0.0,180.0,Arc2D.OPEN)));
59 }
60 public static final Symbol Fuel = new Symbol();
61 static {
62 Fuel.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-30,60,60)));
63 Fuel.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Facilities.Facility, 1.0, 0, 0, null, null)));
64 Fuel.add(new Instr(Prim.STRK, new BasicStroke(2.5f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)));
65 Fuel.add(new Instr(Prim.FILL, new Color(0xa30075)));
66 Path2D.Double p = new Path2D.Double(); p.setWindingRule(GeneralPath.WIND_EVEN_ODD);
67 p.moveTo(-15.6,22.1); p.lineTo(-15.6,-19.4); p.quadTo(-15.5,-22.7,-12.2,-22.8); p.lineTo(0.2,-22.8); p.quadTo(3.3,-22.7,3.4,-19.4); p.lineTo(3.4,22.1); p.closePath();
68 p.moveTo(-12.8,-19.0); p.quadTo(-12.7,-19.9,-11.8,-20.0); p.lineTo(-0.4,-20.0); p.quadTo(0.5,-19.9,0.6,-19.0); p.lineTo(0.6,-9.4);
69 p.quadTo(0.5,-8.5,-0.4,-8.4); p.lineTo(-11.8,-8.4); p.quadTo(-12.7,-8.3,-12.8,-9.4); p.closePath();
70 Fuel.add(new Instr(Prim.PGON, p));
71 p = new Path2D.Double(); p.moveTo(3.0,-3.0); p.lineTo(7.0,-3.0); p.quadTo(9.4,-2.8,9.6,-0.4); p.lineTo(9.6,18.0); p.curveTo(10.1,23.2,18.4,21.5,17.4,17.2);
72 p.lineTo(14.9,3.5); p.lineTo(15.1,-10.3); p.quadTo(14.9,-11.9,13.9,-13.1); p.lineTo(7.4,-19.6); p.moveTo(15.1,-7.4); p.lineTo(12.6,-7.4); p.quadTo(11.1,-7.4,11.1,-8.9); p.lineTo(11.1,-16.0);
73 Fuel.add(new Instr(Prim.PLIN, p));
74 }
75 public static final Symbol Laundrette = new Symbol();
76 static {
77 Laundrette.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-30,60,60)));
78 Laundrette.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Facilities.Facility, 1.0, 0, 0, null, null)));
79 Laundrette.add(new Instr(Prim.STRK, new BasicStroke(1.5f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)));
80 Laundrette.add(new Instr(Prim.FILL, new Color(0xa30075)));
81 Laundrette.add(new Instr(Prim.RECT, new Rectangle2D.Double(-15,-15,30,30)));
82 Laundrette.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-10,-10,20,20)));
83 Path2D.Double p = new Path2D.Double(); p.moveTo(-15,-15); p.lineTo(-15,-20); p.lineTo(15,-20); p.lineTo(15,-15);
84 p.moveTo(-10,15); p.lineTo(-10,20); p.lineTo(10,20); p.lineTo(10,15);
85 Laundrette.add(new Instr(Prim.PLIN, p));
86 }
87 public static final Symbol PumpOut = new Symbol();
88 static {
89 PumpOut.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-30,60,60)));
90 PumpOut.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Facilities.Facility, 1.0, 0, 0, null, null)));
91 PumpOut.add(new Instr(Prim.STRK, new BasicStroke(2.5f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER)));
92 PumpOut.add(new Instr(Prim.FILL, new Color(0xa30075)));
93 Path2D.Double p = new Path2D.Double(); p.moveTo(3.9,-3.7); p.lineTo(-7.4,-3.7); p.lineTo(-12.0,2.0); p.lineTo(-22.7,2.0);
94 p.lineTo(-11.8,14.9); p.lineTo(15.1,14.9); p.lineTo(21.9,10.2); p.lineTo(21.9,3.1); p.lineTo(13.5,3.1);
95 PumpOut.add(new Instr(Prim.PLIN, p));
96 PumpOut.add(new Instr(Prim.STRK, new BasicStroke(3.5f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)));
97 p = new Path2D.Double(); p.moveTo(-2.5,3.0); p.lineTo(-2.5,-13.8); p.lineTo(6.9,-13.8); p.lineTo(6.9,-6.7); p.lineTo(14.5,-6.7);
98 PumpOut.add(new Instr(Prim.PLIN, p));
99 p = new Path2D.Double(); p.moveTo(9.7,2.3); p.lineTo(9.7,10.3); p.lineTo(-4.1,10.3); p.lineTo(-4.1,2.3); p.closePath();
100 PumpOut.add(new Instr(Prim.PGON, p));
101 p = new Path2D.Double(); p.moveTo(14.1,-10.6); p.lineTo(23.1,-6.7); p.lineTo(14.1,-2.8); p.closePath();
102 PumpOut.add(new Instr(Prim.PGON, p));
103 }
104 public static final Symbol SailingClub = new Symbol();
105 static {
106 SailingClub.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-30,60,60)));
107 SailingClub.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Facilities.Facility, 1.0, 0, 0, null, null)));
108 SailingClub.add(new Instr(Prim.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)));
109 SailingClub.add(new Instr(Prim.FILL, new Color(0xa30075)));
110 SailingClub.add(new Instr(Prim.LINE, new Line2D.Double(-5,20,-5,-20)));
111 Path2D.Double p = new Path2D.Double(); p.moveTo(-5,0); p.lineTo(20,-10); p.lineTo(-5,-20); p.closePath();
112 SailingClub.add(new Instr(Prim.PGON, p));
113 }
114 public static final Symbol Shower = new Symbol();
115 static {
116 Shower.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-30,60,60)));
117 Shower.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Facilities.Facility, 1.0, 0, 0, null, null)));
118 Shower.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)));
119 Shower.add(new Instr(Prim.FILL, new Color(0xa30075)));
120 Shower.add(new Instr(Prim.LINE, new Line2D.Double(-4.8,-24.5,6.2,-13.5)));
121 Shower.add(new Instr(Prim.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)));
122 Shower.add(new Instr(Prim.LINE, new Line2D.Double(-18.1,-17.9,-6.1,-21.3)));
123 Shower.add(new Instr(Prim.LINE, new Line2D.Double(-13.9,-10.2,-3.9,-17.7)));
124 Shower.add(new Instr(Prim.LINE, new Line2D.Double(-7.8,-4.4,-0.5,-14.3)));
125 Shower.add(new Instr(Prim.LINE, new Line2D.Double(-0.2,-0.2,3.1,-12.1)));
126 Path2D.Double p = new Path2D.Double(); p.moveTo(11.1,24.6); p.lineTo(11.1,-16.0); p.curveTo(11.1,-22.7,3.4,-23.6,0.8,-19.3);
127 Shower.add(new Instr(Prim.PLIN, p));
128 }
129 public static final Symbol Slipway = new Symbol();
130 static {
131 Slipway.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-30,60,60)));
132 Slipway.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Facilities.Facility, 1.0, 0, 0, null, null)));
133 Slipway.add(new Instr(Prim.STRK, new BasicStroke(3, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)));
134 Slipway.add(new Instr(Prim.FILL, new Color(0xa30075)));
135 Path2D.Double p = new Path2D.Double(); p.moveTo(-24.8,0.1); p.lineTo(-24.8,18.0); p.curveTo(-21.2,18.0,-22.2,16.7,-18.6,16.7); p.curveTo(-15.0,16.7,-16.0,18.0,-12.4,18.0);
136 p.curveTo(-8.8,18.0,-9.8,16.7,-6.2,16.7); p.curveTo(-2.6,16.7,-3.6,18.0,0.0,18.0); p.curveTo(3.6,18.0,2.6,16.7,6.2,16.7); p.curveTo(9.8,16.7,8.8,18.0,12.4,18.0);
137 p.curveTo(16.0,18.0,15.0,16.7,18.6,16.7); p.curveTo(22.2,16.7,21.2,18.0,24.8,18.0); p.lineTo(24.8,13.6); p.closePath();
138 Slipway.add(new Instr(Prim.PGON, p));
139 Slipway.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-1.65,-1.9,8,8)));
140 Slipway.add(new Instr(Prim.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)));
141 Slipway.add(new Instr(Prim.LINE, new Line2D.Double(-24.5,-8.3,-3.1,-2.4)));
142 Slipway.add(new Instr(Prim.LINE, new Line2D.Double(9.3,1.1,22.2,4.6)));
143 p = new Path2D.Double(); p.moveTo(22.9,0.6); p.lineTo(25.0,-7.4); p.lineTo(-5.1,-15.8); p.lineTo(0.3,-19.6); p.lineTo(-1.6,-20.1); p.lineTo(-7.2,-16.2);
144 p.lineTo(-17.1,-18.9); p.quadTo(-16.8,-11.4,-7.7,-7.7); p.closePath();
145 Slipway.add(new Instr(Prim.PGON, p));
146 }
147 public static final Symbol Toilet = new Symbol();
148 static {
149 Toilet.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-30,60,60)));
150 Toilet.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Facilities.Facility, 1.0, 0, 0, null, null)));
151 Toilet.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)));
152 Toilet.add(new Instr(Prim.FILL, new Color(0xa30075)));
153 Toilet.add(new Instr(Prim.LINE, new Line2D.Double(0,20,0,-20)));
154 Toilet.add(new Instr(Prim.RSHP, new Ellipse2D.Double(-18.5,-22.5,7.4,7.4)));
155 Toilet.add(new Instr(Prim.RSHP, new Ellipse2D.Double(11,-22.5,7.4,7.4)));
156 Path2D.Double p = new Path2D.Double(); p.moveTo(-9.8,-12.2); p.lineTo(-4.8,2.7); p.lineTo(-7.3,3.9); p.lineTo(-10.6,-7.0); p.lineTo(-11.7,-6.4); p.lineTo(-7.6,9.0);
157 p.lineTo(-11.3,9.0); p.lineTo(-11.6,22.1); p.lineTo(-13.9,22.1); p.lineTo(-14.2,9.0); p.lineTo(-15.8,9.0); p.lineTo(-16.2,22.1); p.lineTo(-18.4,22.1);
158 p.lineTo(-18.8,9.0); p.lineTo(-22.3,9.0); p.lineTo(-18.2,-6.4); p.lineTo(-19.1,-7.0); p.lineTo(-22.9,3.9); p.lineTo(-25.1,2.7); p.lineTo(-19.9,-12.2); p.closePath();
159 Toilet.add(new Instr(Prim.PGON, p));
160 p = new Path2D.Double(); p.moveTo(19.2,-12.2); p.lineTo(22.3,-10.1); p.lineTo(22.3,4.4); p.lineTo(20.2,4.4); p.lineTo(20.2,-7.3); p.lineTo(18.3,-7.3); p.lineTo(18.3,22.1);
161 p.lineTo(15.8,22.1); p.lineTo(15.8,4.6); p.lineTo(13.8,4.6); p.lineTo(13.4,22.1); p.lineTo(11.0,22.1); p.lineTo(11.0,-7.3); p.lineTo(9.5,-7.3); p.lineTo(9.5,4.4); p.lineTo(6.8,4.4);
162 p.lineTo(6.8,-10.1); p.lineTo(9.4,-12.2); p.closePath();
163 Toilet.add(new Instr(Prim.PGON, p));
164 }
165 public static final Symbol VisitorBerth = new Symbol();
166 static {
167 VisitorBerth.add(new Instr(Prim.BBOX, new Rectangle2D.Double(-30,-30,60,60)));
168 VisitorBerth.add(new Instr(Prim.FILL, new Color(0xa30075)));
169 VisitorBerth.add(new Instr(Prim.RSHP, new Ellipse2D.Double(-25,-25,50,50)));
170 VisitorBerth.add(new Instr(Prim.FILL, Color.white));
171 Path2D.Double p = new Path2D.Double(); p.moveTo(7.9,-13.6); p.lineTo(14.0,-13.6); p.lineTo(3.4,13.6); p.lineTo(-3.4,13.6);
172 p.lineTo(-14.0,-13.6); p.lineTo(-7.9,-13.6); p.lineTo(0.0,8.7); p.closePath();
173 VisitorBerth.add(new Instr(Prim.PGON, p));
174 }
175 public static final Symbol VisitorMooring = new Symbol();
176 static {
177 VisitorMooring.add(new Instr(Prim.FILL, new Color(0xa30075)));
178 Path2D.Double p = new Path2D.Double(); p.moveTo(-25.0,0); p.curveTo(-32.0,-21.0,-14.0,-45.5,12.7,-37.9); p.curveTo(27.5,-33.8,37.8,-15.5,32.0,0.0);
179 p.lineTo(8.0,0.0); p.curveTo(8.0,-11.0,-8.0,-11.0,-8.0,0.0); p.closePath();
180 VisitorMooring.add(new Instr(Prim.PGON, p));
181 VisitorMooring.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)));
182 VisitorMooring.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-10,-10,20,20)));
183 VisitorMooring.add(new Instr(Prim.LINE, new Line2D.Double(-33,0,-10,0)));
184 VisitorMooring.add(new Instr(Prim.LINE, new Line2D.Double(10,0,40,0)));
185 VisitorMooring.add(new Instr(Prim.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)));
186 VisitorMooring.add(new Instr(Prim.ELPS, new Ellipse2D.Double(6.5,-49.5,12,12)));
187 VisitorMooring.add(new Instr(Prim.FILL, Color.white));
188 p = new Path2D.Double(); p.moveTo(8.3,-32.8); p.lineTo(12.5,-32.8); p.lineTo(5.4,-12.9); p.lineTo(1.0,-12.9); p.lineTo(-6.1,-32.8);
189 p.lineTo(-1.9,-32.8); p.lineTo(3.2,-18.1); p.closePath();
190 VisitorMooring.add(new Instr(Prim.PGON, p));
191 }
192
193 public static final EnumMap<CatSCF, Symbol> Cats = new EnumMap<CatSCF, Symbol>(CatSCF.class);
194 static {
195 Cats.put(CatSCF.SCF_BHST, Boatlift); Cats.put(CatSCF.SCF_BTYD, Boatyard); Cats.put(CatSCF.SCF_CHDR, Chandler); Cats.put(CatSCF.SCF_FUEL, Fuel); Cats.put(CatSCF.SCF_LAUN, Laundrette);
196 Cats.put(CatSCF.SCF_PMPO, PumpOut); Cats.put(CatSCF.SCF_CLUB, SailingClub); Cats.put(CatSCF.SCF_SHWR, Shower); Cats.put(CatSCF.SCF_SLPW, Slipway); Cats.put(CatSCF.SCF_WC, Toilet);
197 Cats.put(CatSCF.SCF_VBTH, VisitorBerth); Cats.put(CatSCF.SCF_VMOR, VisitorMooring);
198 }
199}
Note: See TracBrowser for help on using the repository browser.