Changeset 29198 in osm for applications/editors/josm/plugins/smed2/src/symbols/Symbols.java
- Timestamp:
- 2013-01-14T19:11:27+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/symbols/Symbols.java
r29186 r29198 24 24 25 25 public enum Prim { 26 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, X226 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 27 27 } 28 28 … … 85 85 } 86 86 87 public static class TextStyle { 88 Font font; 89 90 public TextStyle(Font ifont) { 91 font = ifont; 92 } 93 } 94 87 95 public static class Caption { 88 String str;; 96 String str; 97 TextStyle style; 89 98 float x; 90 99 float y; 91 100 92 public Caption(String istr, float ix, float iy) { 101 public Caption(String istr, TextStyle istyle, float ix, float iy) { 93 102 str = istr; 103 style = istyle; 94 104 x = ix; 95 105 y = iy; … … 97 107 } 98 108 109 public static class LineStyle { 110 BasicStroke stroke; 111 Color line; 112 Color fill; 113 114 public LineStyle(BasicStroke istroke, Color iline, Color ifill) { 115 stroke = istroke; 116 line = iline; 117 fill = ifill; 118 } 119 } 120 99 121 public static class Symbol extends ArrayList<Instr> { 100 private static final long serialVersionUID = 1L;101 122 102 123 public Symbol() { … … 185 206 case COLR: 186 207 if ((cs != null) && (cs.col != null)) { 187 for (Instr patch : ( ArrayList<Instr>) item.params) {208 for (Instr patch : (Symbol) item.params) { 188 209 switch (patch.type) { 189 210 case P1: … … 271 292 drawSymbol(g2, s.instr, s.scale, s.x, s.y, s.delta, s.scheme); 272 293 break; 273 case FONT:274 g2.setFont((Font) item.params);275 break;276 294 case TEXT: 277 295 Caption c = (Caption) item.params; 296 g2.setFont(c.style.font); 278 297 g2.drawString(c.str, c.x, c.y); 279 298 break;
Note:
See TracChangeset
for help on using the changeset viewer.