Changeset 30339 in osm for applications/editors/josm/plugins/smed2/src/symbols/Symbols.java
- Timestamp:
- 2014-03-24T15:05:25+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/symbols/Symbols.java
r30325 r30339 18 18 import java.util.ArrayList; 19 19 20 import s57.S57val.ColPAT; 21 20 22 public class Symbols { 21 23 22 24 public enum Form { 23 BBOX, STRK, COLR, FILL, LINE, RECT, RRCT, ELPS, EARC, PLIN, PGON, RSHP, TEXT, SYMB, P1, P2, H2, H3, H4, H5, V2, V3, D2, D3, D4, B 2, S2, S3, S4, C2, X225 BBOX, STRK, COLR, FILL, LINE, RECT, RRCT, ELPS, EARC, PLIN, PGON, RSHP, TEXT, SYMB, P1, P2, H2, H3, H4, H5, V2, V3, D2, D3, D4, B1, S2, S3, S4, C2, X2 24 26 } 25 27 … … 149 151 int pn = 0; 150 152 int cn = 0; 153 Patt bpat = Patt.Z; 154 Color bcol = null; 151 155 g2.setPaint(Color.black); 152 156 if (cs != null) { 157 if ((cs.pat.size() > 0) && (cs.col.size() > 0) && (cs.pat.get(0) == Patt.B)) { 158 bpat = (cs.pat.remove(0)); 159 bcol = (cs.col.remove(0)); 160 } 153 161 pn = cs.pat.size(); 154 162 cn = cs.col.size() - ((pn != 0) ? pn - 1 : 0); … … 231 239 break; 232 240 case H2: 233 if ((cn > 1) && ( cs.pat.get(0) == Patt.H)) {241 if ((cn > 1) && (pn > 0) && (cs.pat.get(0) == Patt.H)) { 234 242 g2.setPaint(cs.col.get(cs.col.size() - pn)); 235 243 g2.fill((Path2D.Double) patch.params); … … 237 245 break; 238 246 case H3: 239 if ((cn == 3) && ( cs.pat.get(0) == Patt.H)) {247 if ((cn == 3) && (pn > 0) && (cs.pat.get(0) == Patt.H)) { 240 248 g2.setPaint(cs.col.get(1)); 241 249 g2.fill((Path2D.Double) patch.params); … … 243 251 break; 244 252 case H4: 245 if ((cn == 4) && ( cs.pat.get(0) == Patt.H)) {253 if ((cn == 4) && (pn > 0) && (cs.pat.get(0) == Patt.H)) { 246 254 g2.setPaint(cs.col.get(1)); 247 255 g2.fill((Path2D.Double) patch.params); … … 249 257 break; 250 258 case H5: 251 if ((cn == 4) && ( cs.pat.get(0) == Patt.H)) {259 if ((cn == 4) && (pn > 0) && (cs.pat.get(0) == Patt.H)) { 252 260 g2.setPaint(cs.col.get(2)); 253 261 g2.fill((Path2D.Double) patch.params); … … 255 263 break; 256 264 case V2: 257 if ((cn > 1) && ( cs.pat.get(0) == Patt.V)) {265 if ((cn > 1) && (pn > 0) && (cs.pat.get(0) == Patt.V)) { 258 266 g2.setPaint(cs.col.get(cs.col.size() - pn)); 259 267 g2.fill((Path2D.Double) patch.params); … … 261 269 break; 262 270 case V3: 263 if ((cn == 3) && ( cs.pat.get(0) == Patt.V)) {271 if ((cn == 3) && (pn > 0) && (cs.pat.get(0) == Patt.V)) { 264 272 g2.setPaint(cs.col.get(1)); 273 g2.fill((Path2D.Double) patch.params); 274 } 275 break; 276 case B1: 277 if (bpat == Patt.B) { 278 g2.setPaint(bcol); 265 279 g2.fill((Path2D.Double) patch.params); 266 280 }
Note:
See TracChangeset
for help on using the changeset viewer.