Changeset 29120 in osm for applications/editors/josm/plugins/smed2/src/symbols/Symbols.java
- Timestamp:
- 2012-12-26T14:12:40+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/symbols/Symbols.java
r29114 r29120 23 23 24 24 public enum Prim { 25 BBOX, STRK, COLR, FILL, LINE, RECT, RRCT, ELPS, EARC, PLIN, PGON, SYMB, P1, P2, H2, H3, H4, H5, V2, D2, D3, D4, B2, S2, S3, S4, C2, X2 25 BBOX, STRK, COLR, FILL, LINE, RECT, RRCT, ELPS, EARC, PLIN, PGON, RSHP, TEXT, SYMB, P1, P2, H2, H3, H4, H5, V2, D2, D3, D4, B2, S2, S3, S4, C2, X2 26 26 } 27 27 … … 30 30 } 31 31 32 public static final double symbolScale[] = { 1.0, 128.0, 64.0, 32.0, 16.0, 8.0, 4.0, 2.0, 1.0, 0.61, 0.372, 0.227, 0.138,32 public static final double symbolScale[] = { 256.0, 128.0, 64.0, 32.0, 16.0, 8.0, 4.0, 2.0, 1.0, 0.61, 0.372, 0.227, 0.138, 33 33 0.0843, 0.0514, 0.0313, 0.0191, 0.0117, 0.007, 0.138 }; 34 34 35 public static final double textScale[] = { 1.0, 128.0, 64.0, 32.0, 16.0, 8.0, 4.0, 2.0, 1.0, 0.5556, 0.3086, 0.1714, 0.0953,35 public static final double textScale[] = { 256.0, 128.0, 64.0, 32.0, 16.0, 8.0, 4.0, 2.0, 1.0, 0.5556, 0.3086, 0.1714, 0.0953, 36 36 0.0529, 0.0294, 0.0163, 0.0091, 0.0050, 0.0028, 0.0163 }; 37 37 … … 84 84 } 85 85 86 public static void drawSymbol(Graphics2D g2, ArrayList<Instr> symbol, int zoom, double x, double y, Delta dd, Scheme cs) { 86 public static class Symbol { 87 ArrayList<Instr> instr; 88 double scale; 89 double x; 90 double y; 91 Delta delta; 92 Scheme scheme; 93 94 public Symbol(ArrayList<Instr> iinstr, double iscale, double ix, double iy, Delta idelta, Scheme ischeme) { 95 instr = iinstr; 96 scale = iscale; 97 x = ix; 98 y = iy; 99 delta = idelta; 100 scheme = ischeme; 101 } 102 } 103 104 public static void drawSymbol(Graphics2D g2, ArrayList<Instr> symbol, double scale, double x, double y, Delta dd, Scheme cs) { 87 105 int pn = 0; 88 106 int cn = 0; … … 93 111 AffineTransform savetr = g2.getTransform(); 94 112 g2.translate(x, y); 95 g2.scale(s ymbolScale[zoom], symbolScale[zoom]);113 g2.scale(scale, scale); 96 114 for (Instr item : symbol) { 97 115 switch (item.type) { … … 224 242 g2.fill((Path2D.Double) item.params); 225 243 break; 244 case RSHP: 245 g2.fill((RectangularShape) item.params); 246 break; 226 247 case SYMB: 227 drawSymbol(g2, (ArrayList<Instr>) item.params, 0, 0.0, 0.0, null, null); 248 Symbol s = (Symbol) item.params; 249 drawSymbol(g2, s.instr, s.scale, s.x, s.y, s.delta, s.scheme); 250 break; 251 case TEXT: 228 252 break; 229 253 }
Note:
See TracChangeset
for help on using the changeset viewer.
