Changeset 26951 in osm for applications/editors
- Timestamp:
- 2011-10-23T16:35:40+02:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java
r26925 r26951 24 24 public void actionPerformed(java.awt.event.ActionEvent e) { 25 25 Shp shp = Shp.UNKNOWN; 26 if (dlg.mark != null) 26 if (dlg.mark != null) { 27 27 shp = dlg.mark.getShape(); 28 if (northButton.isSelected()) { 29 dlg.mark.setCategory(Cat.CAM_NORTH); 30 dlg.mark.setColour(Ent.BODY, Col.BLACK); 31 dlg.mark.addColour(Ent.BODY, Col.YELLOW); 32 dlg.mark.setPattern(Ent.BODY, Pat.HORIZ); 33 if (shapes.containsKey(shp)) 34 shapes.get(shp).doClick(); 35 northButton.setBorderPainted(true); 36 } else { 37 northButton.setBorderPainted(false); 38 } 39 if (southButton.isSelected()) { 40 dlg.mark.setCategory(Cat.CAM_SOUTH); 41 dlg.mark.setColour(Ent.BODY, Col.YELLOW); 42 dlg.mark.addColour(Ent.BODY, Col.BLACK); 43 dlg.mark.setPattern(Ent.BODY, Pat.HORIZ); 44 if (shapes.containsKey(shp)) 45 shapes.get(shp).doClick(); 46 southButton.setBorderPainted(true); 47 } else { 48 southButton.setBorderPainted(false); 49 } 50 if (eastButton.isSelected()) { 51 dlg.mark.setCategory(Cat.CAM_EAST); 52 dlg.mark.setColour(Ent.BODY, Col.BLACK); 53 dlg.mark.addColour(Ent.BODY, Col.YELLOW); 54 dlg.mark.addColour(Ent.BODY, Col.BLACK); 55 dlg.mark.setPattern(Ent.BODY, Pat.HORIZ); 56 if (shapes.containsKey(shp)) 57 shapes.get(shp).doClick(); 58 eastButton.setBorderPainted(true); 59 } else { 60 eastButton.setBorderPainted(false); 61 } 62 if (westButton.isSelected()) { 63 dlg.mark.setCategory(Cat.CAM_WEST); 64 dlg.mark.setColour(Ent.BODY, Col.YELLOW); 65 dlg.mark.addColour(Ent.BODY, Col.BLACK); 66 dlg.mark.addColour(Ent.BODY, Col.YELLOW); 67 dlg.mark.setPattern(Ent.BODY, Pat.HORIZ); 68 if (shapes.containsKey(shp)) 69 shapes.get(shp).doClick(); 70 westButton.setBorderPainted(true); 71 } else { 72 westButton.setBorderPainted(false); 73 } 74 if (isolButton.isSelected()) { 75 dlg.mark.setCategory(Cat.UNKNOWN); 76 dlg.mark.setColour(Ent.BODY, Col.BLACK); 77 dlg.mark.addColour(Ent.BODY, Col.RED); 78 dlg.mark.addColour(Ent.BODY, Col.BLACK); 79 dlg.mark.setPattern(Ent.BODY, Pat.HORIZ); 80 if (shapes.containsKey(shp)) 81 shapes.get(shp).doClick(); 82 isolButton.setBorderPainted(true); 83 } else { 84 isolButton.setBorderPainted(false); 28 dlg.panelMain.panelMore.panelPat.clearSelections(); 29 dlg.panelMain.panelMore.panelPat.horizButton.doClick(); 30 if (northButton.isSelected()) { 31 dlg.mark.setCategory(Cat.CAM_NORTH); 32 dlg.panelMain.panelMore.panelPat.panelCol.blackButton.doClick(); 33 dlg.panelMain.panelMore.panelPat.panelCol.addButton.doClick(); 34 dlg.panelMain.panelMore.panelPat.panelCol.yellowButton.doClick(); 35 if (shapes.containsKey(shp)) 36 shapes.get(shp).doClick(); 37 northButton.setBorderPainted(true); 38 } else { 39 northButton.setBorderPainted(false); 40 } 41 if (southButton.isSelected()) { 42 dlg.mark.setCategory(Cat.CAM_SOUTH); 43 dlg.panelMain.panelMore.panelPat.panelCol.yellowButton.doClick(); 44 dlg.panelMain.panelMore.panelPat.panelCol.addButton.doClick(); 45 dlg.panelMain.panelMore.panelPat.panelCol.blackButton.doClick(); 46 if (shapes.containsKey(shp)) 47 shapes.get(shp).doClick(); 48 southButton.setBorderPainted(true); 49 } else { 50 southButton.setBorderPainted(false); 51 } 52 if (eastButton.isSelected()) { 53 dlg.mark.setCategory(Cat.CAM_EAST); 54 dlg.panelMain.panelMore.panelPat.panelCol.blackButton.doClick(); 55 dlg.panelMain.panelMore.panelPat.panelCol.addButton.doClick(); 56 dlg.panelMain.panelMore.panelPat.panelCol.yellowButton.doClick(); 57 dlg.panelMain.panelMore.panelPat.panelCol.addButton.doClick(); 58 dlg.panelMain.panelMore.panelPat.panelCol.blackButton.doClick(); 59 if (shapes.containsKey(shp)) 60 shapes.get(shp).doClick(); 61 eastButton.setBorderPainted(true); 62 } else { 63 eastButton.setBorderPainted(false); 64 } 65 if (westButton.isSelected()) { 66 dlg.mark.setCategory(Cat.CAM_WEST); 67 dlg.panelMain.panelMore.panelPat.panelCol.yellowButton.doClick(); 68 dlg.panelMain.panelMore.panelPat.panelCol.addButton.doClick(); 69 dlg.panelMain.panelMore.panelPat.panelCol.blackButton.doClick(); 70 dlg.panelMain.panelMore.panelPat.panelCol.addButton.doClick(); 71 dlg.panelMain.panelMore.panelPat.panelCol.yellowButton.doClick(); 72 if (shapes.containsKey(shp)) 73 shapes.get(shp).doClick(); 74 westButton.setBorderPainted(true); 75 } else { 76 westButton.setBorderPainted(false); 77 } 78 if (isolButton.isSelected()) { 79 dlg.mark.setCategory(Cat.UNKNOWN); 80 dlg.panelMain.panelMore.panelPat.panelCol.blackButton.doClick(); 81 dlg.panelMain.panelMore.panelPat.panelCol.addButton.doClick(); 82 dlg.panelMain.panelMore.panelPat.panelCol.redButton.doClick(); 83 dlg.panelMain.panelMore.panelPat.panelCol.addButton.doClick(); 84 dlg.panelMain.panelMore.panelPat.panelCol.blackButton.doClick(); 85 if (shapes.containsKey(shp)) 86 shapes.get(shp).doClick(); 87 isolButton.setBorderPainted(true); 88 } else { 89 isolButton.setBorderPainted(false); 90 } 85 91 } 86 92 } … … 114 120 } 115 121 if (dlg.mark != null) { 116 if ((dlg.mark.getObject() != Obj.UNKNOWN) && (dlg.mark.getShape() != Shp.UNKNOWN)) 122 if ((dlg.mark.getObject() != Obj.UNKNOWN) && (dlg.mark.getShape() != Shp.UNKNOWN)) { 123 topmarkButton.setVisible(true); 117 124 dlg.panelMain.moreButton.setVisible(true); 118 else 125 } else { 126 topmarkButton.setVisible(false); 119 127 dlg.panelMain.moreButton.setVisible(false); 128 } 120 129 dlg.mark.paintSign(); 121 130 } … … 125 134 private ActionListener alTop = new ActionListener() { 126 135 public void actionPerformed(java.awt.event.ActionEvent e) { 127 if (topmarkButton.isSelected()) { 128 topmarkButton.setBorderPainted(true); 129 } else { 130 topmarkButton.setBorderPainted(false); 136 if (dlg.mark != null) { 137 dlg.panelMain.panelTop.clearSelections(); 138 if (topmarkButton.isSelected()) { 139 dlg.panelMain.panelTop.panelPat.noneButton.doClick(); 140 dlg.panelMain.panelTop.panelPat.panelCol.blackButton.doClick(); 141 switch (dlg.mark.getCategory()) { 142 case CAM_NORTH: 143 dlg.panelMain.panelTop.northTopButton.doClick(); 144 break; 145 case CAM_SOUTH: 146 dlg.panelMain.panelTop.southTopButton.doClick(); 147 break; 148 case CAM_EAST: 149 dlg.panelMain.panelTop.eastTopButton.doClick(); 150 break; 151 case CAM_WEST: 152 dlg.panelMain.panelTop.westTopButton.doClick(); 153 break; 154 default: 155 dlg.panelMain.panelTop.spheres2TopButton.doClick(); 156 break; 157 } 158 topmarkButton.setBorderPainted(true); 159 } else { 160 topmarkButton.setBorderPainted(false); 161 } 131 162 } 132 163 } … … 147 178 this.add(getShapeButton(coneButton, 55, 96, 34, 32, "Cone", Shp.CONE, Obj.BOYCAR, Obj.BOYISD), null); 148 179 this.add(getShapeButton(sphereButton, 55, 128, 34, 32, "Sphere", Shp.SPHERE, Obj.BOYCAR, Obj.BOYISD), null); 149 this.add(getShapeButton(floatButton, 90, 0, 34, 32, "Float", Shp.FLOAT, Obj.LITFLT, Obj.LITFLT), null);180 this.add(getShapeButton(floatButton, 90, 0, 34, 32, "Float", Shp.FLOAT, Obj.LITFLT, Obj.LITFLT), null); 150 181 this.add(getShapeButton(beaconButton, 90, 32, 34, 32, "Beacon", Shp.BEACON, Obj.BCNCAR, Obj.BCNISD), null); 151 182 this.add(getShapeButton(towerButton, 90, 64, 34, 32, "Tower", Shp.TOWER, Obj.BCNCAR, Obj.BCNISD), null); … … 159 190 public void clearSelections() { 160 191 topmarkButton.setSelected(false); 192 topmarkButton.setVisible(false); 161 193 alTop.actionPerformed(null); 162 194 catButtons.clearSelection(); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r26949 r26951 97 97 98 98 public enum Ent { 99 BODY, BUOY, BEACON, FLOAT, TOPMARK, DAYMARK,LIGHT, MOORING, STATION99 BODY, BUOY, BEACON, FLOAT, TOPMARK, LIGHT, MOORING, STATION 100 100 } 101 101 … … 305 305 private ArrayList<Col> bodyColour = new ArrayList<Col>(); 306 306 private ArrayList<Col> topColour = new ArrayList<Col>(); 307 private ArrayList<Col> dayColour = new ArrayList<Col>();308 307 private ArrayList<Col> lightColour = new ArrayList<Col>(); 309 308 … … 321 320 return topColour.get(i); 322 321 break; 323 case DAYMARK:324 if (i < dayColour.size())325 return dayColour.get(i);326 break;327 322 case LIGHT: 328 323 if (i < lightColour.size()) … … 346 341 topColour.add(col); 347 342 break; 348 case DAYMARK:349 dayColour.clear();350 dayColour.add(col);351 break;352 343 case LIGHT: 353 344 lightColour.clear(); … … 368 359 topColour.set(i, col); 369 360 break; 370 case DAYMARK:371 dayColour.set(i, col);372 break;373 361 case LIGHT: 374 362 lightColour.set(i, col); … … 388 376 topColour.add(i, col); 389 377 break; 390 case DAYMARK:391 dayColour.add(i, col);392 break;393 378 case LIGHT: 394 379 lightColour.add(i, col); … … 408 393 topColour.add(col); 409 394 break; 410 case DAYMARK:411 dayColour.add(col);412 break;413 395 case LIGHT: 414 396 lightColour.add(col); … … 428 410 topColour.remove(i); 429 411 break; 430 case DAYMARK:431 dayColour.remove(i);432 break;433 412 case LIGHT: 434 413 lightColour.remove(i); … … 452 431 private Pat bodyPattern = Pat.NONE; 453 432 private Pat topPattern = Pat.NONE; 454 private Pat dayPattern = Pat.NONE;455 433 456 434 public Pat getPattern(Ent ent) { … … 463 441 case TOPMARK: 464 442 return topPattern; 465 case DAYMARK:466 return dayPattern;467 443 } 468 444 return Pat.NONE; … … 479 455 case TOPMARK: 480 456 topPattern = pat; 481 break;482 case DAYMARK:483 dayPattern = pat;484 457 break; 485 458 }
Note:
See TracChangeset
for help on using the changeset viewer.