Changeset 29929 in osm for applications/editors/josm/plugins/smed2/src/symbols
- Timestamp:
- 2013-09-18T12:41:49+02:00 (12 years ago)
- Location:
- applications/editors/josm/plugins/smed2/src/symbols
- Files:
-
- 2 edited
-
Notices.java (modified) (1 diff)
-
Symbols.java (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/symbols/Notices.java
r29884 r29929 972 972 973 973 public static final Symbol NoticeBnank = new Symbol(); 974 static { 975 NoticeBnank.add(new Instr(Prim.BBOX, new Rectangle(-30,-30,60,60))); 976 Symbol colours = new Symbol(); 977 Path2D.Double p = new Path2D.Double(); p.moveTo(0.0,-80.0); p.lineTo(-15.0,-47.0); p.lineTo(15.0,-47.0); p.closePath(); 978 colours.add(new Instr(Prim.P1, p)); 979 p = new Path2D.Double(); p.moveTo(0.0,-10.0); p.lineTo(-15.0,-43.0); p.lineTo(15.0,-43.0); p.closePath(); 980 colours.add(new Instr(Prim.P2, p)); 981 NoticeBnank.add(new Instr(Prim.COLR, colours)); 982 } 974 983 public static final Symbol NoticeBlmhr = new Symbol(); 975 984 public static final Symbol NoticeBwral = new Symbol(); -
applications/editors/josm/plugins/smed2/src/symbols/Symbols.java
r29286 r29929 18 18 import java.awt.geom.*; 19 19 import java.util.ArrayList; 20 import java.util.EnumMap;21 22 import s57.S57val.*;23 20 24 21 public class Symbols { … … 28 25 } 29 26 27 public enum Patt { 28 Z, H, V, D, B, S, C, X 29 } 30 30 31 public enum Handle { 31 32 CC, TL, TR, TC, LC, RC, BL, BR, BC 32 }33 34 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,35 0.0843, 0.0514, 0.0313, 0.0191, 0.0117, 0.007, 0.138 };36 37 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,38 0.0529, 0.0294, 0.0163, 0.0091, 0.0050, 0.0028, 0.0163 };39 40 private static final EnumMap<ColCOL, Color> bodyColours = new EnumMap<ColCOL, Color>(ColCOL.class);41 static {42 bodyColours.put(ColCOL.COL_UNK, new Color(0, true));43 bodyColours.put(ColCOL.COL_WHT, new Color(0xffffff));44 bodyColours.put(ColCOL.COL_BLK, new Color(0x000000));45 bodyColours.put(ColCOL.COL_RED, new Color(0xd40000));46 bodyColours.put(ColCOL.COL_GRN, new Color(0x00d400));47 bodyColours.put(ColCOL.COL_BLU, Color.blue);48 bodyColours.put(ColCOL.COL_YEL, new Color(0xffd400));49 bodyColours.put(ColCOL.COL_GRY, Color.gray);50 bodyColours.put(ColCOL.COL_BRN, new Color(0x8b4513));51 bodyColours.put(ColCOL.COL_AMB, new Color(0xfbf00f));52 bodyColours.put(ColCOL.COL_VIO, new Color(0xee82ee));53 bodyColours.put(ColCOL.COL_ORG, Color.orange);54 bodyColours.put(ColCOL.COL_MAG, new Color(0xf000f0));55 bodyColours.put(ColCOL.COL_PNK, Color.pink);56 33 } 57 34 … … 77 54 78 55 public static class Scheme { 79 public ArrayList< ColPAT> pat;80 public ArrayList<Col COL> col;81 82 public Scheme(ArrayList< ColPAT> ipat, ArrayList<ColCOL> icol) {56 public ArrayList<Patt> pat; 57 public ArrayList<Color> col; 58 59 public Scheme(ArrayList<Patt> ipat, ArrayList<Color> icol) { 83 60 pat = ipat; 84 61 col = icol; … … 205 182 case P1: 206 183 if (cn > 0) { 207 g2.setPaint( bodyColours.get(cs.col.get(0)));184 g2.setPaint(cs.col.get(0)); 208 185 g2.fill((Path2D.Double) patch.params); 209 186 } … … 212 189 if (cn > 0) { 213 190 if (cn > 1) { 214 g2.setPaint( bodyColours.get(cs.col.get(1)));191 g2.setPaint(cs.col.get(1)); 215 192 } else { 216 g2.setPaint( bodyColours.get(cs.col.get(0)));193 g2.setPaint(cs.col.get(0)); 217 194 } 218 195 g2.fill((Path2D.Double) patch.params); … … 220 197 break; 221 198 case H2: 222 if ((cn > 1) && (cs.pat.get(0) == ColPAT.PAT_HORI)) {223 g2.setPaint( bodyColours.get(cs.col.get(cs.col.size() - pn)));199 if ((cn > 1) && (cs.pat.get(0) == Patt.H)) { 200 g2.setPaint(cs.col.get(cs.col.size() - pn)); 224 201 g2.fill((Path2D.Double) patch.params); 225 202 } 226 203 break; 227 204 case H3: 228 if ((cn == 3) && (cs.pat.get(0) == ColPAT.PAT_HORI)) {229 g2.setPaint( bodyColours.get(cs.col.get(1)));205 if ((cn == 3) && (cs.pat.get(0) == Patt.H)) { 206 g2.setPaint(cs.col.get(1)); 230 207 g2.fill((Path2D.Double) patch.params); 231 208 } 232 209 break; 233 210 case H4: 234 if ((cn == 4) && (cs.pat.get(0) == ColPAT.PAT_HORI)) {235 g2.setPaint( bodyColours.get(cs.col.get(1)));211 if ((cn == 4) && (cs.pat.get(0) == Patt.H)) { 212 g2.setPaint(cs.col.get(1)); 236 213 g2.fill((Path2D.Double) patch.params); 237 214 } 238 215 break; 239 216 case H5: 240 if ((cn == 4) && (cs.pat.get(0) == ColPAT.PAT_HORI)) {241 g2.setPaint( bodyColours.get(cs.col.get(2)));217 if ((cn == 4) && (cs.pat.get(0) == Patt.H)) { 218 g2.setPaint(cs.col.get(2)); 242 219 g2.fill((Path2D.Double) patch.params); 243 220 } 244 221 break; 245 222 case V2: 246 if ((cn > 1) && (cs.pat.get(0) == ColPAT.PAT_VERT)) {247 g2.setPaint( bodyColours.get(cs.col.get(cs.col.size() - pn)));223 if ((cn > 1) && (cs.pat.get(0) == Patt.V)) { 224 g2.setPaint(cs.col.get(cs.col.size() - pn)); 248 225 g2.fill((Path2D.Double) patch.params); 249 226 }
Note:
See TracChangeset
for help on using the changeset viewer.
