Changeset 29134 in osm for applications/editors/josm
- Timestamp:
- 2012-12-28T01:28:06+01:00 (12 years ago)
- Location:
- applications/editors/josm/plugins/smed2/src/symbols
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/symbols/Facilities.java
r29120 r29134 12 12 import java.awt.BasicStroke; 13 13 import java.awt.Color; 14 import java.awt.geom.Arc2D; 15 import java.awt.geom.Ellipse2D; 16 import java.awt.geom.GeneralPath; 17 import java.awt.geom.Line2D; 18 import java.awt.geom.Path2D; 19 import java.awt.geom.Rectangle2D; 20 import java.awt.geom.RoundRectangle2D; 14 import java.awt.geom.*; 21 15 import java.util.ArrayList; 22 16 -
applications/editors/josm/plugins/smed2/src/symbols/Notices.java
r29132 r29134 12 12 import java.awt.BasicStroke; 13 13 import java.awt.Color; 14 import java.awt.Font; 14 15 import java.awt.Rectangle; 15 16 import java.awt.geom.*; 16 17 import java.util.ArrayList; 17 18 19 import symbols.Symbols.Caption; 18 20 import symbols.Symbols.Delta; 19 21 import symbols.Symbols.Handle; … … 53 55 private static final ArrayList<Instr> Speedboat = new ArrayList<Instr>(); 54 56 private static final ArrayList<Instr> Sport = new ArrayList<Instr>(); 57 static { 58 Sport.add(new Instr(Prim.FONT, new Font("Arial", Font.BOLD, 15))); 59 Sport.add(new Instr(Prim.TEXT, new Caption("SPORT", (float)-25.0, (float)5.0))); 60 } 55 61 private static final ArrayList<Instr> Turn = new ArrayList<Instr>(); 56 62 static { … … 64 70 } 65 71 private static final ArrayList<Instr> VHF = new ArrayList<Instr>(); 72 static { 73 VHF.add(new Instr(Prim.FONT, new Font("Arial", Font.BOLD, 20))); 74 VHF.add(new Instr(Prim.TEXT, new Caption("VHF", (float)-20.0, (float)-5.0))); 75 } 66 76 private static final ArrayList<Instr> Waterbike = new ArrayList<Instr>(); 67 77 private static final ArrayList<Instr> Waterski = new ArrayList<Instr>(); … … 204 214 NoticeA10b.add(new Instr(Prim.SYMB, new Symbols.Symbol(Notices.NoticeA10a, 1.0, 0, 0, new Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(180.0))), null))); 205 215 } 206 public static final ArrayList<Instr> NoticeA11= new ArrayList<Instr>(); 207 static { 208 NoticeA11.add(new Instr(Prim.SYMB, new Symbols.Symbol(Notices.NoticeA, 1.0, 0, 0, null, null))); 209 NoticeA11.add(new Instr(Prim.SYMB, new Symbols.Symbol(Notices.Motor, 1.0, 0, 0, null, null))); 216 public static final ArrayList<Instr> NoticeA12= new ArrayList<Instr>(); 217 static { 218 NoticeA12.add(new Instr(Prim.SYMB, new Symbols.Symbol(Notices.NoticeA, 1.0, 0, 0, null, null))); 219 NoticeA12.add(new Instr(Prim.SYMB, new Symbols.Symbol(Notices.Motor, 1.0, 0, 0, null, null))); 220 } 221 public static final ArrayList<Instr> NoticeA13= new ArrayList<Instr>(); 222 static { 223 NoticeA13.add(new Instr(Prim.SYMB, new Symbols.Symbol(Notices.NoticeA, 1.0, 0, 0, null, null))); 224 NoticeA13.add(new Instr(Prim.SYMB, new Symbols.Symbol(Notices.Sport, 1.0, 0, 0, null, null))); 225 } 226 public static final ArrayList<Instr> NoticeA14= new ArrayList<Instr>(); 227 static { 228 NoticeA14.add(new Instr(Prim.SYMB, new Symbols.Symbol(Notices.NoticeA, 1.0, 0, 0, null, null))); 229 NoticeA14.add(new Instr(Prim.SYMB, new Symbols.Symbol(Notices.Waterski, 1.0, 0, 0, null, null))); 230 } 231 public static final ArrayList<Instr> NoticeA15= new ArrayList<Instr>(); 232 static { 233 NoticeA15.add(new Instr(Prim.SYMB, new Symbols.Symbol(Notices.NoticeA, 1.0, 0, 0, null, null))); 234 NoticeA15.add(new Instr(Prim.SYMB, new Symbols.Symbol(Notices.Sailboat, 1.0, 0, 0, null, null))); 235 } 236 public static final ArrayList<Instr> NoticeA16= new ArrayList<Instr>(); 237 static { 238 NoticeA16.add(new Instr(Prim.SYMB, new Symbols.Symbol(Notices.NoticeA, 1.0, 0, 0, null, null))); 239 NoticeA16.add(new Instr(Prim.SYMB, new Symbols.Symbol(Notices.Rowboat, 1.0, 0, 0, null, null))); 240 } 241 public static final ArrayList<Instr> NoticeA17= new ArrayList<Instr>(); 242 static { 243 NoticeA17.add(new Instr(Prim.SYMB, new Symbols.Symbol(Notices.NoticeA, 1.0, 0, 0, null, null))); 244 NoticeA17.add(new Instr(Prim.SYMB, new Symbols.Symbol(Notices.Sailboard, 1.0, 0, 0, null, null))); 245 } 246 public static final ArrayList<Instr> NoticeA18= new ArrayList<Instr>(); 247 static { 248 NoticeA18.add(new Instr(Prim.SYMB, new Symbols.Symbol(Notices.NoticeA, 1.0, 0, 0, null, null))); 249 NoticeA18.add(new Instr(Prim.SYMB, new Symbols.Symbol(Notices.Speedboat, 1.0, 0, 0, null, null))); 250 } 251 public static final ArrayList<Instr> NoticeA19= new ArrayList<Instr>(); 252 static { 253 NoticeA19.add(new Instr(Prim.SYMB, new Symbols.Symbol(Notices.NoticeA, 1.0, 0, 0, null, null))); 254 NoticeA19.add(new Instr(Prim.SYMB, new Symbols.Symbol(Notices.Slipway, 1.0, 0, 0, null, null))); 255 } 256 public static final ArrayList<Instr> NoticeA20= new ArrayList<Instr>(); 257 static { 258 NoticeA20.add(new Instr(Prim.SYMB, new Symbols.Symbol(Notices.NoticeA, 1.0, 0, 0, null, null))); 259 NoticeA20.add(new Instr(Prim.SYMB, new Symbols.Symbol(Notices.Waterbike, 1.0, 0, 0, null, null))); 210 260 } 211 261 public static final ArrayList<Instr> NoticeB2a = new ArrayList<Instr>(); … … 218 268 public static final ArrayList<Instr> NoticeB7 = new ArrayList<Instr>(); 219 269 public static final ArrayList<Instr> NoticeB8 = new ArrayList<Instr>(); 270 public static final ArrayList<Instr> NoticeB11a = new ArrayList<Instr>(); 271 static { 272 NoticeB11a.add(new Instr(Prim.SYMB, new Symbols.Symbol(Notices.NoticeB, 1.0, 0, 0, null, null))); 273 NoticeB11a.add(new Instr(Prim.SYMB, new Symbols.Symbol(Notices.VHF, 1.0, 0, 0, null, null))); 274 } 220 275 public static final ArrayList<Instr> NoticeC1 = new ArrayList<Instr>(); 221 276 public static final ArrayList<Instr> NoticeC2 = new ArrayList<Instr>(); -
applications/editors/josm/plugins/smed2/src/symbols/Symbols.java
r29126 r29134 12 12 import java.awt.BasicStroke; 13 13 import java.awt.Color; 14 import java.awt.Font; 14 15 import java.awt.Graphics2D; 15 16 import java.awt.Rectangle; … … 23 24 24 25 public enum Prim { 25 BBOX, STRK, COLR, FILL, LINE, RECT, RRCT, ELPS, EARC, PLIN, PGON, RSHP, SYMB, P1, P2, H2, H3, H4, H5, V2, D2, D3, D4, B2, S2, S3, S4, C2, X226 BBOX, STRK, COLR, FILL, LINE, RECT, RRCT, ELPS, EARC, PLIN, PGON, RSHP, FONT, TEXT, SYMB, P1, P2, H2, H3, H4, H5, V2, D2, D3, D4, B2, S2, S3, S4, C2, X2 26 27 } 27 28 … … 84 85 } 85 86 87 public static class Caption { 88 String str;; 89 float x; 90 float y; 91 92 public Caption(String istr, float ix, float iy) { 93 str = istr; 94 x = ix; 95 y = iy; 96 } 97 } 98 86 99 public static class Symbol { 87 100 ArrayList<Instr> instr; … … 249 262 drawSymbol(g2, s.instr, s.scale, s.x, s.y, s.delta, s.scheme); 250 263 break; 264 case FONT: 265 g2.setFont((Font)item.params); 266 break; 267 case TEXT: 268 Caption c = (Caption)item.params; 269 g2.drawString(c.str, c.x, c.y); 270 break; 251 271 } 252 272 }
Note:
See TracChangeset
for help on using the changeset viewer.