Changeset 30020 in osm for applications
- Timestamp:
- 2013-10-12T12:50:40+02:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/smed2/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/seamap/Renderer.java
r29992 r30020 13 13 import java.awt.font.*; 14 14 import java.awt.geom.*; 15 import java.awt.image.*; 15 16 import java.util.*; 16 17 … … 270 271 } 271 272 } 273 274 public static void fillPattern(Feature feature, BufferedImage image) { 275 Path2D.Double p = new Path2D.Double(); 276 p.setWindingRule(GeneralPath.WIND_EVEN_ODD); 277 Point2D point; 278 switch (feature.flag) { 279 case POINT: 280 point = helper.getPoint(feature.centre); 281 g2.drawImage(image, new AffineTransformOp(AffineTransform.getScaleInstance(sScale, sScale), AffineTransformOp.TYPE_NEAREST_NEIGHBOR), 282 (int)(point.getX() - (50 * sScale)), (int)(point.getY() - (50 * sScale))); 283 break; 284 case AREA: 285 for (Bound bound : map.areas.get(feature.refs)) { 286 BoundIterator bit = map.new BoundIterator(bound); 287 point = helper.getPoint(bit.next()); 288 p.moveTo(point.getX(), point.getY()); 289 while (bit.hasNext()) { 290 point = helper.getPoint(bit.next()); 291 p.lineTo(point.getX(), point.getY()); 292 } 293 } 294 g2.setPaint(new TexturePaint(image, new Rectangle(0, 0, 1 + (int)(100 * sScale), 1 + (int)(100 * sScale)))); 295 g2.fill(p); 296 break; 297 } 298 } 272 299 273 300 public static void labelText(Feature feature, String str, Font font, Color colour, Delta delta) { -
applications/editors/josm/plugins/smed2/src/seamap/Rules.java
r29992 r30020 105 105 AttItem name = feature.atts.get(Att.OBJNAM); 106 106 switch (feature.type) { 107 case SPLARE: 108 if (zoom >= 12) { 109 Renderer.symbol(feature, Areas.Plane, Obj.SPLARE, null, null); 110 Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, 10); 111 } 112 if ((zoom >= 15) && (name != null)) 113 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90))); 114 break; 115 case MARCUL: 116 if (zoom >= 14) 117 Renderer.symbol(feature, Areas.MarineFarm, Obj.MARCUL, null, null); 118 if (zoom >= 16) 119 Renderer.lineVector(feature, new LineStyle( Color.black, 4, new float[] { 10, 10 }, null)); 107 case DRGARE: 108 if (zoom < 16) 109 Renderer.lineVector(feature, new LineStyle(Color.black, 8, new float[] { 25, 25 }, new Color(0x40ffffff, true))); 110 else 111 Renderer.lineVector(feature, new LineStyle(Color.black, 8, new float[] { 25, 25 }, null)); 112 if ((zoom >= 12) && (name != null)) 113 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.PLAIN, 100), Color.black, null); 120 114 break; 121 115 case FAIRWY: … … 130 124 } 131 125 break; 132 case DRGARE: 133 if (zoom < 16) 134 Renderer.lineVector(feature, new LineStyle(Color.black, 8, new float[] { 25, 25 }, new Color(0x40ffffff, true))); 135 else 136 Renderer.lineVector(feature, new LineStyle(Color.black, 8, new float[] { 25, 25 }, null)); 137 if ((zoom >= 12) && (name != null)) 138 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.PLAIN, 100), Color.black, null); 139 break; 140 case RESARE: 141 if (zoom >= 12) { 142 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, 0); 143 // if ((CatREA)Renderer.getAttVal(feature, feature.type, 0, Att.CATREA) == CatREA.REA_NWAK) 144 // Renderer.symbol(feature, Areas.NoWake, Obj.RESARE, null); 145 } 126 case MARCUL: 127 if (zoom >= 14) 128 Renderer.symbol(feature, Areas.MarineFarm, Obj.MARCUL, null, null); 129 if (zoom >= 16) 130 Renderer.lineVector(feature, new LineStyle( Color.black, 4, new float[] { 10, 10 }, null)); 146 131 break; 147 132 case OSPARE: … … 153 138 } 154 139 break; 140 case RESARE: 141 if (zoom >= 12) { 142 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, 0); 143 // if ((CatREA)Renderer.getAttVal(feature, feature.type, 0, Att.CATREA) == CatREA.REA_NWAK) 144 // Renderer.symbol(feature, Areas.NoWake, Obj.RESARE, null); 145 } 146 break; 155 147 case SEAARE: 156 148 switch ((CatSEA) Renderer.getAttVal(feature, feature.type, 0, Att.CATSEA)) { … … 166 158 } 167 159 break; 168 case SNDWAV:169 // if (zoom>=12)) area("fill:url(#sandwaves)");170 break;171 }172 160 /* 173 161 if (is_type("sea_area")) { … … 205 193 } 206 194 */ 207 } 195 case SNDWAV: 196 if (zoom >= 12) Renderer.fillPattern(feature, Areas.Sandwaves); 197 break; 198 case SPLARE: 199 if (zoom >= 12) { 200 Renderer.symbol(feature, Areas.Plane, Obj.SPLARE, null, null); 201 Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, 10); 202 } 203 if ((zoom >= 15) && (name != null)) 204 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90))); 205 break; 206 } 207 } 208 208 209 private static void beacons(Feature feature) { 209 210 BcnSHP shape = (BcnSHP) Renderer.getAttVal(feature, feature.type, 0, Att.BCNSHP); -
applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java
r30013 r30020 182 182 if (nextFeature.compareTo(feature) != 0) { 183 183 feature = nextFeature; 184 panelMain.parseMark(map.index.get(feature.getUniqueId()));185 showFrame.setVisible(true);186 showFrame.showFeature(feature, map);184 // panelMain.parseMark(map.index.get(feature.getUniqueId())); 185 // showFrame.setVisible(true); 186 // showFrame.showFeature(feature, map); 187 187 } 188 188 } else { -
applications/editors/josm/plugins/smed2/src/symbols/Areas.java
r29206 r30020 10 10 package symbols; 11 11 12 import java.awt.BasicStroke; 13 import java.awt.Color; 14 import java.awt.Rectangle; 12 import java.awt.*; 15 13 import java.awt.geom.*; 14 import java.awt.image.*; 16 15 17 16 import symbols.Symbols.*; … … 127 126 RockC.add(new Instr(Prim.LINE, new Line2D.Double(10,17.3,-10,-17.3))); 128 127 } 129 public static final Symbol Sandwaves = new Symbol();130 128 public static final Symbol Seaplane = new Symbol(); 131 129 static { … … 179 177 WreckS.add(new Instr(Prim.PGON, p)); 180 178 } 179 public static final BufferedImage Sandwaves = new BufferedImage(100, 100, BufferedImage.TYPE_INT_ARGB); 180 static { 181 Graphics2D g2 = Sandwaves.createGraphics(); 182 g2.setStroke(new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)); 183 g2.setBackground(new Color(0, true)); 184 g2.clearRect(0, 0, 100, 100); 185 g2.setPaint(new Color(0xffd400)); 186 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); 187 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); 188 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); 189 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); 190 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); 191 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); 192 g2.draw(p); 193 } 181 194 }
Note:
See TracChangeset
for help on using the changeset viewer.