Changeset 23141 in osm for applications/editors/josm/plugins/toms/src
- Timestamp:
- 2010-09-13T19:55:45+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/toms/src/toms/seamarks/buoys
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/Buoy.java
r23140 r23141 621 621 622 622 protected void saveLightData() { 623 623 String colour; 624 624 if (dlg.cM01Fired.isSelected()) { 625 setSectorIndex(0); 626 String colour = getLightColour(); 627 if (colour.equals("R")) { 625 if (!(colour = LightColour[0]).isEmpty()) 626 if (colour.equals("R")) { 627 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 628 "seamark:light:colour", "red")); 629 } else if (colour.equals("G")) { 630 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 631 "seamark:light:colour", "green")); 632 } else if (colour.equals("W")) { 633 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 634 "seamark:light:colour", "white")); 635 } 636 637 if (!LightPeriod[0].isEmpty()) 628 638 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 629 "seamark:light:colour", "red")); 630 } else if (colour.equals("G")) { 639 "seamark:light:period", LightPeriod[0])); 640 641 if (!LightChar[0].isEmpty()) 631 642 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 632 "seamark:light:colour", "green")); 633 } else if (colour.equals("W")) { 643 "seamark:light:character", LightChar[0])); 644 645 if (!LightGroup[0].isEmpty()) 634 646 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 635 "seamark:light:colour", "white")); 636 } 637 638 if (!getLightPeriod().isEmpty()) 647 "seamark:light:group", LightGroup[0])); 648 649 if (!Height[0].isEmpty()) 639 650 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 640 "seamark:light: period", getLightPeriod()));641 642 if (! getLightChar().isEmpty())651 "seamark:light:height", Height[0])); 652 653 if (!Range[0].isEmpty()) 643 654 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 644 "seamark:light:character", getLightChar())); 645 646 if (!getLightGroup().isEmpty()) 647 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 648 "seamark:light:group", getLightGroup())); 649 650 if (!getHeight().isEmpty()) 651 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 652 "seamark:light:height", getHeight())); 653 654 if (!getRange().isEmpty()) 655 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 656 "seamark:light:range", getRange())); 655 "seamark:light:range", Range[0])); 657 656 658 657 for (int i = 1; i < 10; i++) { 659 setSectorIndex(i); 660 661 colour = getLightColour(); 662 if (colour.equals("R")) { 663 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 664 "seamark:light:colour:" + i, "red")); 665 } else if (colour.equals("G")) { 666 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 667 "seamark:light:colour:" + i, "green")); 668 } else if (colour.equals("W")) { 669 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 670 "seamark:light:colour:" + i, "white")); 671 } 672 673 if (!getLightPeriod().isEmpty()) 674 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 675 "seamark:light:period:" + i, getLightPeriod())); 676 677 if (!getLightChar().isEmpty()) 678 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 679 "seamark:light:character:" + i, getLightChar())); 680 681 if (!getLightGroup().isEmpty()) 682 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 683 "seamark:light:group:" + i, getLightGroup())); 684 685 if (!getHeight().isEmpty()) 686 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 687 "seamark:light:height:" + i, getHeight())); 688 689 if (!getRange().isEmpty()) 690 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 691 "seamark:light:range:" + i, getRange())); 658 if ((colour = LightColour[i]) != null) 659 if (colour.equals("R")) { 660 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 661 "seamark:light:colour:" + i, "red")); 662 if ((Bearing1[i] != null) && (Bearing2[i] != null) && (Radius[i] != null)) 663 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 664 "seamark:light:" + i, "red:" + Bearing1[i] + ":" + Bearing2[i] + ":" + Radius[i])); 665 } else if (colour.equals("G")) { 666 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 667 "seamark:light:colour:" + i, "green")); 668 if ((Bearing1[i] != null) && (Bearing2[i] != null) && (Radius[i] != null)) 669 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 670 "seamark:light:" + i, "green:" + Bearing1[i] + ":" + Bearing2[i] + ":" + Radius[i])); 671 } else if (colour.equals("W")) { 672 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 673 "seamark:light:colour:" + i, "white")); 674 if ((Bearing1[i] != null) && (Bearing2[i] != null) && (Radius[i] != null)) 675 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 676 "seamark:light:" + i, "white:" + Bearing1[i] + ":" + Bearing2[i] + ":" + Radius[i])); 677 } 678 679 if (LightPeriod[i] != null) 680 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 681 "seamark:light:period:" + i, LightPeriod[i])); 682 683 if (LightChar[i] != null) 684 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 685 "seamark:light:character:" + i, LightChar[i])); 686 687 if (LightGroup[i] != null) 688 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 689 "seamark:light:group:" + i, LightGroup[i])); 690 691 if (Height[i] != null) 692 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 693 "seamark:light:height:" + i, Height[i])); 694 695 if (Range[i] != null) 696 Main.main.undoRedo.add(new ChangePropertyCommand(Node, 697 "seamark:light:range:" + i, Range[i])); 692 698 } 693 699 } -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyCard.java
r23140 r23141 210 210 dlg.cM01Fired.setEnabled(true); 211 211 dlg.cM01Fired.setVisible(true); 212 212 dlg.cbM01Colour.setVisible(false); 213 dlg.lM01Colour.setVisible(false); 214 215 if (isFired()) { 216 switch (getStyleIndex()) { 217 case LAT_BEACON: 218 case LAT_TOWER: 219 dlg.rbM01Fired1.setVisible(true); 220 dlg.rbM01FiredN.setVisible(true); 221 dlg.lM01Height.setVisible(true); 222 dlg.tfM01Height.setVisible(true); 223 dlg.lM01Range.setVisible(true); 224 dlg.tfM01Range.setVisible(true); 225 break; 226 case LAT_FLOAT: 227 dlg.lM01Height.setVisible(true); 228 dlg.tfM01Height.setVisible(true); 229 dlg.lM01Range.setVisible(true); 230 dlg.tfM01Range.setVisible(true); 231 break; 232 default: 233 } 234 } 213 235 String image = "/images/Cardinal"; //$NON-NLS-1$ 214 236 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyIsol.java
r23140 r23141 129 129 dlg.cM01Fog.setVisible(true); 130 130 dlg.cM01Fired.setVisible(true); 131 dlg.cbM01Colour.setVisible(false); 132 dlg.lM01Colour.setVisible(false); 131 133 134 if (isFired()) { 135 switch (getStyleIndex()) { 136 case SPEC_FLOAT: 137 dlg.lM01Height.setVisible(true); 138 dlg.tfM01Height.setVisible(true); 139 dlg.lM01Range.setVisible(true); 140 dlg.tfM01Range.setVisible(true); 141 break; 142 case SPEC_BEACON: 143 case SPEC_TOWER: 144 dlg.rbM01Fired1.setVisible(true); 145 dlg.rbM01FiredN.setVisible(true); 146 dlg.lM01Height.setVisible(true); 147 dlg.tfM01Height.setVisible(true); 148 dlg.lM01Range.setVisible(true); 149 dlg.tfM01Range.setVisible(true); 150 break; 151 default: 152 } 153 } 154 132 155 String image = "/images/Cardinal"; //$NON-NLS-1$ 133 156 -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java
r23140 r23141 25 25 26 26 resetMask(); 27 27 28 28 dlg.rbM01RegionA.setEnabled(true); 29 29 dlg.rbM01RegionB.setEnabled(true); … … 350 350 dlg.tfM01Name.setEnabled(true); 351 351 dlg.tfM01Name.setText(getName()); 352 353 String image = "/images/Lateral"; //$NON-NLS-1$354 352 355 353 int cat = getBuoyIndex(); … … 375 373 dlg.cM01TopMark.setEnabled(true); 376 374 } 375 dlg.cbM01Colour.setVisible(false); 376 dlg.lM01Colour.setVisible(false); 377 378 if (isFired()) { 379 switch (style) { 380 case LAT_BEACON: 381 case LAT_TOWER: 382 dlg.rbM01Fired1.setVisible(true); 383 dlg.rbM01FiredN.setVisible(true); 384 dlg.lM01Height.setVisible(true); 385 dlg.tfM01Height.setVisible(true); 386 dlg.lM01Range.setVisible(true); 387 dlg.tfM01Range.setVisible(true); 388 break; 389 case LAT_FLOAT: 390 dlg.lM01Height.setVisible(true); 391 dlg.tfM01Height.setVisible(true); 392 dlg.lM01Range.setVisible(true); 393 dlg.tfM01Range.setVisible(true); 394 break; 395 default: 396 } 397 } 398 String image = "/images/Lateral"; //$NON-NLS-1$ 377 399 378 400 switch (getBuoyIndex()) { -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySaw.java
r23140 r23141 129 129 dlg.cM01Fired.setVisible(true); 130 130 dlg.cM01Fired.setEnabled(true); 131 dlg.cbM01Colour.setVisible(false); 132 dlg.lM01Colour.setVisible(false); 133 134 if (isFired()) { 135 switch (getStyleIndex()) { 136 case SPEC_FLOAT: 137 dlg.lM01Height.setVisible(true); 138 dlg.tfM01Height.setVisible(true); 139 dlg.lM01Range.setVisible(true); 140 dlg.tfM01Range.setVisible(true); 141 break; 142 case SPEC_BEACON: 143 case SPEC_TOWER: 144 dlg.rbM01Fired1.setVisible(true); 145 dlg.rbM01FiredN.setVisible(true); 146 dlg.lM01Height.setVisible(true); 147 dlg.tfM01Height.setVisible(true); 148 dlg.lM01Range.setVisible(true); 149 dlg.tfM01Range.setVisible(true); 150 break; 151 default: 152 } 153 } 131 154 132 155 String image = "/images/Safe_Water"; //$NON-NLS-1$ -
applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySpec.java
r23140 r23141 156 156 dlg.cM01Fired.setVisible(true); 157 157 dlg.cM01Fired.setEnabled(true); 158 dlg.cbM01Colour.setVisible(false); 159 dlg.lM01Colour.setVisible(false); 160 161 if (isFired()) { 162 switch (getStyleIndex()) { 163 case SPEC_FLOAT: 164 dlg.lM01Height.setVisible(true); 165 dlg.tfM01Height.setVisible(true); 166 dlg.lM01Range.setVisible(true); 167 dlg.tfM01Range.setVisible(true); 168 break; 169 case SPEC_BEACON: 170 case SPEC_TOWER: 171 dlg.rbM01Fired1.setVisible(true); 172 dlg.rbM01FiredN.setVisible(true); 173 dlg.lM01Height.setVisible(true); 174 dlg.tfM01Height.setVisible(true); 175 dlg.lM01Range.setVisible(true); 176 dlg.tfM01Range.setVisible(true); 177 break; 178 default: 179 } 180 } 158 181 159 182 String image = "/images/Special_Purpose"; //$NON-NLS-1$
Note:
See TracChangeset
for help on using the changeset viewer.