source: osm/applications/editors/josm/plugins/smed2/src/symbols/Areas.java@ 30027

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

save

File size: 11.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.*;
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(Prim.BBOX, new Rectangle(-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(Prim.PGON, p));
25 }
26 public static final Symbol Cable = new Symbol();
27 static {
28 Cable.add(new Instr(Prim.BBOX, new Rectangle(-30,-60,60,60)));
29 Cable.add(new Instr(Prim.STRK, new BasicStroke(8, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)));
30 Cable.add(new Instr(Prim.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(Prim.PLIN, p));
33 }
34 public static final Symbol LaneArrow = new Symbol();
35 static {
36 LaneArrow.add(new Instr(Prim.BBOX, new Rectangle(-20,-240,40,240)));
37 LaneArrow.add(new Instr(Prim.STRK, new BasicStroke(10, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER)));
38 LaneArrow.add(new Instr(Prim.FILL, new Color(0x80c480ff, true)));
39 Path2D.Double p = new Path2D.Double(); p.moveTo(15,0); p.lineTo(15,-195); p.lineTo(40,-195);
40 p.lineTo(0,-240); p.lineTo(-40,-195); p.lineTo(-15,-195); p.lineTo(-15,0); p.closePath();
41 LaneArrow.add(new Instr(Prim.PLIN, p));
42 }
43 public static final Symbol LineAnchor = new Symbol();
44 static {
45 LineAnchor.add(new Instr(Prim.BBOX, new Rectangle(-30,-60,60,90)));
46 LineAnchor.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Harbours.Anchor, 0.5, 0, 0, new Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(-90.0))), null)));
47 }
48 public static final Symbol LinePlane = new Symbol();
49 static {
50 LinePlane.add(new Instr(Prim.FILL, new Color(0xc480ff)));
51 LinePlane.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Areas.Plane, 0.5, 0, 0, new Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(-90.0))), null)));
52 }
53 public static final Symbol MarineFarm = new Symbol();
54 static {
55 MarineFarm.add(new Instr(Prim.STRK, new BasicStroke(3, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)));
56 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);
57 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);
58 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);
59 MarineFarm.add(new Instr(Prim.PLIN, p));
60 MarineFarm.add(new Instr(Prim.RSHP, new Ellipse2D.Double(9,-2,4,4)));
61 }
62 public static final Symbol NoWake = new Symbol();
63 static {
64 NoWake.add(new Instr(Prim.STRK, new BasicStroke(12, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
65 NoWake.add(new Instr(Prim.FILL, new Color(0xa30075)));
66 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);
67 NoWake.add(new Instr(Prim.PLIN, p));
68 NoWake.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
69 NoWake.add(new Instr(Prim.LINE, new Line2D.Double(-60,60,60,-60)));
70 NoWake.add(new Instr(Prim.LINE, new Line2D.Double(-60,-60,60,60)));
71 }
72 public static final Symbol Pipeline = new Symbol();
73 static {
74 Pipeline.add(new Instr(Prim.BBOX, new Rectangle(-15,-60,30,60)));
75 Pipeline.add(new Instr(Prim.STRK, new BasicStroke(8, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)));
76 Pipeline.add(new Instr(Prim.FILL, new Color(0xc480ff)));
77 Pipeline.add(new Instr(Prim.LINE, new Line2D.Double(0,0,0,-50)));
78 Pipeline.add(new Instr(Prim.RSHP, new Ellipse2D.Double(-10,-60,20,20)));
79 }
80 public static final Symbol Restricted = new Symbol();
81 static {
82 Restricted.add(new Instr(Prim.BBOX, new Rectangle(-15,-30,30,30)));
83 Restricted.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND)));
84 Restricted.add(new Instr(Prim.LINE, new Line2D.Double(0,0,0,-30)));
85 Restricted.add(new Instr(Prim.LINE, new Line2D.Double(0,-15,17,-15)));
86 }
87 public static final Symbol Rock = new Symbol();
88 static {
89 Rock.add(new Instr(Prim.FILL, new Color(0x80c0ff)));
90 Rock.add(new Instr(Prim.RSHP, new Ellipse2D.Double(-30,-30,60,60)));
91 Rock.add(new Instr(Prim.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1, new float[]{5,5}, 0)));
92 Rock.add(new Instr(Prim.FILL, Color.black));
93 Rock.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-30,-30,60,60)));
94 Rock.add(new Instr(Prim.STRK, new BasicStroke(5, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
95 Rock.add(new Instr(Prim.LINE, new Line2D.Double(-20,0,20,0)));
96 Rock.add(new Instr(Prim.LINE, new Line2D.Double(0,-20,0,20)));
97 }
98 public static final Symbol RockA = new Symbol();
99 static {
100 RockA.add(new Instr(Prim.FILL, new Color(0x80c0ff)));
101 RockA.add(new Instr(Prim.RSHP, new Ellipse2D.Double(-30,-30,60,60)));
102 RockA.add(new Instr(Prim.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1, new float[]{5,5}, 0)));
103 RockA.add(new Instr(Prim.FILL, Color.black));
104 RockA.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-30,-30,60,60)));
105 RockA.add(new Instr(Prim.STRK, new BasicStroke(5, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
106 RockA.add(new Instr(Prim.LINE, new Line2D.Double(-20,0,20,0)));
107 RockA.add(new Instr(Prim.LINE, new Line2D.Double(0,-20,0,20)));
108 RockA.add(new Instr(Prim.RSHP, new Ellipse2D.Double(-17,-17,8,8)));
109 RockA.add(new Instr(Prim.RSHP, new Ellipse2D.Double(-17,9,8,8)));
110 RockA.add(new Instr(Prim.RSHP, new Ellipse2D.Double(9,-17,8,8)));
111 RockA.add(new Instr(Prim.RSHP, new Ellipse2D.Double(9,9,8,8)));
112 }
113 public static final Symbol RockC = new Symbol();
114 static {
115 RockC.add(new Instr(Prim.FILL, new Color(0x80c0ff)));
116 RockC.add(new Instr(Prim.RSHP, new Ellipse2D.Double(-30,-30,60,60)));
117 RockC.add(new Instr(Prim.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1, new float[]{5,5}, 0)));
118 RockC.add(new Instr(Prim.FILL, Color.black));
119 RockC.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-30,-30,60,60)));
120 RockC.add(new Instr(Prim.STRK, new BasicStroke(5, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
121 RockC.add(new Instr(Prim.LINE, new Line2D.Double(-20,0,20,0)));
122 RockC.add(new Instr(Prim.LINE, new Line2D.Double(-10,17.3,10,-17.3)));
123 RockC.add(new Instr(Prim.LINE, new Line2D.Double(10,17.3,-10,-17.3)));
124 }
125 public static final Symbol Seaplane = new Symbol();
126 static {
127 Seaplane.add(new Instr(Prim.BBOX, new Rectangle(-60,-60,120,120)));
128 Seaplane.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
129 Seaplane.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-58,-58,116,116)));
130 Seaplane.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Areas.Plane, 1.0, 0, 0, null, null)));
131 }
132 public static final Symbol WindFarm = new Symbol();
133 static {
134 WindFarm.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
135 WindFarm.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-100,-100,200,200)));
136 WindFarm.add(new Instr(Prim.LINE, new Line2D.Double(-35,50,35,50)));
137 WindFarm.add(new Instr(Prim.LINE, new Line2D.Double(0,50,0,-27.5)));
138 WindFarm.add(new Instr(Prim.LINE, new Line2D.Double(0,-27.5,30,-27.5)));
139 WindFarm.add(new Instr(Prim.LINE, new Line2D.Double(0,-27.5,-13.8,-3.8)));
140 WindFarm.add(new Instr(Prim.LINE, new Line2D.Double(0,-27.5,-13.8,-53.6)));
141 }
142 public static final Symbol WreckD = new Symbol();
143 static {
144 WreckD.add(new Instr(Prim.FILL, new Color(0x80c0ff)));
145 WreckD.add(new Instr(Prim.RSHP, new Ellipse2D.Double(-50,-40,100,80)));
146 WreckD.add(new Instr(Prim.STRK, new BasicStroke(2, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 1, new float[]{5,5}, 0)));
147 WreckD.add(new Instr(Prim.FILL, Color.black));
148 WreckD.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-50,-40,100,80)));
149 WreckD.add(new Instr(Prim.STRK, new BasicStroke(5, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
150 WreckD.add(new Instr(Prim.LINE, new Line2D.Double(-40,0,40,0)));
151 WreckD.add(new Instr(Prim.LINE, new Line2D.Double(0,-30,0,30)));
152 WreckD.add(new Instr(Prim.LINE, new Line2D.Double(-20,-15,-20,15)));
153 WreckD.add(new Instr(Prim.LINE, new Line2D.Double(20,-15,20,15)));
154 }
155 public static final Symbol WreckND = new Symbol();
156 static {
157 WreckND.add(new Instr(Prim.STRK, new BasicStroke(5, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
158 WreckND.add(new Instr(Prim.LINE, new Line2D.Double(-40,0,40,0)));
159 WreckND.add(new Instr(Prim.LINE, new Line2D.Double(0,-30,0,30)));
160 WreckND.add(new Instr(Prim.LINE, new Line2D.Double(-20,-15,-20,15)));
161 WreckND.add(new Instr(Prim.LINE, new Line2D.Double(20,-15,20,15)));
162 }
163 public static final Symbol WreckS = new Symbol();
164 static {
165 WreckS.add(new Instr(Prim.STRK, new BasicStroke(3, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
166 WreckS.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-6,-6,12,12)));
167 WreckS.add(new Instr(Prim.LINE, new Line2D.Double(-40,0,-6,0)));
168 WreckS.add(new Instr(Prim.LINE, new Line2D.Double(40,0,6,0)));
169 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);
170 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();
171 WreckS.add(new Instr(Prim.PGON, p));
172 }
173 public static final BufferedImage Sandwaves = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB);
174 static {
175 Graphics2D g2 = Sandwaves.createGraphics();
176 g2.setStroke(new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
177 g2.setBackground(new Color(0, true));
178 g2.clearRect(0, 0, 100, 100);
179 g2.setPaint(new Color(0xffd400));
180 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);
181 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);
182 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);
183 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);
184 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);
185 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);
186 g2.draw(p);
187 }
188}
Note: See TracBrowser for help on using the repository browser.