Ignore:
Timestamp:
2010-08-18T19:05:24+02:00 (14 years ago)
Author:
malcolmh
Message:

added special purpose float

Location:
applications/editors/josm/plugins/toms/src/toms
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/toms/src/toms/dialogs/SmpDialogAction.java

    r22657 r22683  
    349349                                }
    350350
    351                                 if (name.compareTo("") == 0) {
     351                                if (name.equals("")) {
    352352                                        if (keys.containsKey("seamark:buoy_lateral:name"))
    353353                                                name = keys.get("seamark:buoy_lateral:name");
     
    364364                                }
    365365
    366                                 if (cat.compareTo("port") == 0) {
     366                                if (cat.equals("port")) {
    367367
    368368                                        buoy = new BuoyLat(this, SeaMark.PORT_HAND);
     
    13371337                                                i1 = it.indexOf("+");
    13381338                                                i2 = it.length();
    1339                                                 if (c == "")
     1339                                                if (c.equals(""))
    13401340                                                        c = it;
    13411341                                                else
     
    13431343                                        }
    13441344
    1345                                         if (c == "")
     1345                                        if (c.equals(""))
    13461346                                                c = it;
    13471347                                        buoy.setLightChar(c);
  • applications/editors/josm/plugins/toms/src/toms/seamarks/SeaMark.java

    r22647 r22683  
    9090        public final static int SPEC_SPHERE = 3;
    9191        public final static int SPEC_BARREL = 4;
    92         public final static int SPEC_BEACON = 5;
     92        public final static int SPEC_FLOAT = 5;
     93        public final static int SPEC_BEACON = 6;
    9394        public final static int LIGHT_HOUSE = 1;
    9495        public final static int LIGHT_MAJOR = 2;
  • applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/Buoy.java

    r22657 r22683  
    142142
    143143        public void setLightPeriod(String lightPeriod) {
    144                 String regex = "^[\\d\\s]+$";
     144                String regex = "^[\\d\\s.]+$";
    145145
    146146                if (lightPeriod.length() == 0)
     
    299299
    300300                if (dlg.cM01Fired.isSelected()) {
    301                         if (colour == "red") {
     301                        if (colour.equals("red")) {
    302302                                Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    303303                                                "seamark:light:colour", "red"));
    304304                                setLightColour("R");
    305                         } else if (colour == "green") {
     305                        } else if (colour.equals("green")) {
    306306                                Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    307307                                                "seamark:light:colour", "green"));
    308308                                setLightColour("G");
    309                         } else if (colour == "white") {
     309                        } else if (colour.equals("white")) {
    310310                                Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    311311                                                "seamark:light:colour", "white"));
  • applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyCard.java

    r22626 r22683  
    167167
    168168                                        dlg.cbM01Kennung.setSelectedItem(c);
    169                                         if (dlg.cbM01Kennung.getSelectedItem() == "Not set")
     169                                        if (dlg.cbM01Kennung.getSelectedItem().equals("Not set"))
    170170                                                c = "";
    171171                                }
  • applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyIsol.java

    r22626 r22683  
    8484
    8585                                        dlg.cbM01Kennung.setSelectedItem(c);
    86                                         if (dlg.cbM01Kennung.getSelectedItem() == "Not set")
     86                                        if (dlg.cbM01Kennung.getSelectedItem().equals("Not set"))
    8787                                                c = "";
    8888                                }
  • applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java

    r22657 r22683  
    343343
    344344                                dlg.cbM01Kennung.setSelectedItem(c);
    345                                 if (dlg.cbM01Kennung.getSelectedItem() == "Not set")
     345                                if (dlg.cbM01Kennung.getSelectedItem().equals("Not set"))
    346346                                        c = "";
    347347                        }
     
    814814                case PREF_PORT_HAND:
    815815                        if (getRegion() == IALA_A) {
    816                                 if (str.compareTo("red") == 0) {
     816                                if (str.equals("red")) {
    817817                                        setFired(true);
    818818                                        super.setLightColour("R");
     
    821821                                }
    822822                        } else {
    823                                 if (str.compareTo("green") == 0) {
     823                                if (str.equals("green")) {
    824824                                        setFired(true);
    825825                                        super.setLightColour("G");
     
    833833                case PREF_STARBOARD_HAND:
    834834                        if (getRegion() == IALA_A) {
    835                                 if (str.compareTo("green") == 0) {
     835                                if (str.equals("green")) {
    836836                                        setFired(true);
    837837                                        super.setLightColour("G");
     
    840840                                }
    841841                        } else {
    842                                 if (str.compareTo("red") == 0) {
     842                                if (str.equals("red")) {
    843843                                        setFired(true);
    844844                                        super.setLightColour("R");
  • applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySaw.java

    r22647 r22683  
    8989
    9090                                        dlg.cbM01Kennung.setSelectedItem(c);
    91                                         if (dlg.cbM01Kennung.getSelectedItem() == "Not set")
     91                                        if (dlg.cbM01Kennung.getSelectedItem().equals("Not set"))
    9292                                                c = "";
    9393                                }
  • applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoySpec.java

    r22647 r22683  
    2525                dlg.cbM01StyleOfMark.addItem("Sphere Buoy");
    2626                dlg.cbM01StyleOfMark.addItem("Barrel");
     27                dlg.cbM01StyleOfMark.addItem("Float");
    2728                dlg.cbM01StyleOfMark.addItem("Beacon");
    2829
    2930                dlg.cbM01Kennung.removeAllItems();
    3031                dlg.cbM01Kennung.addItem("Not set");
     32                dlg.cbM01Kennung.addItem("Fl");
     33                dlg.cbM01Kennung.addItem("Fl(2)");
     34                dlg.cbM01Kennung.addItem("Fl(3)");
     35                dlg.cbM01Kennung.addItem("Fl(4)");
     36                dlg.cbM01Kennung.addItem("Fl(5)");
     37                dlg.cbM01Kennung.addItem("Oc(2)");
     38                dlg.cbM01Kennung.addItem("Oc(3)");
     39                dlg.cbM01Kennung.addItem("Q");
     40                dlg.cbM01Kennung.addItem("IQ");
     41                dlg.cbM01Kennung.setSelectedIndex(0);
    3142
    3243                dlg.cM01Fired.setSelected(false);
     
    6677                        image += "_Barrel";
    6778                        break;
     79                case SPEC_FLOAT:
     80                        image += "_Float";
     81                        break;
    6882                case SPEC_BEACON:
    6983                        image += "_Beacon";
     
    8599
    86100                                        dlg.cbM01Kennung.setSelectedItem(c);
    87                                         if (dlg.cbM01Kennung.getSelectedItem() == "Not set")
     101                                        if (dlg.cbM01Kennung.getSelectedItem().equals("Not set"))
    88102                                                c = "";
    89103                                }
     
    132146                                        "seamark:buoy_special_purpose:colour", "yellow"));
    133147                        break;
     148                case SPEC_FLOAT:
     149                        super.saveSign("light_Float");
     150                        Main.main.undoRedo.add(new ChangePropertyCommand(node,
     151                                        "seamark:light_float:colour", "yellow"));
     152                        break;
    134153                case SPEC_BEACON:
    135154                        super.saveSign("beacon_special_purpose");
     
    161180                        str = keys.get("seamark:topmark:shape");
    162181
    163                         if (str.compareTo("x-shape") == 0) {
     182                        if (str.equals("x-shape")) {
    164183                                setTopMark(true);
    165184
     
    193212                        }
    194213
    195                         if (str.compareTo("white") == 0) {
     214                        if (str.equals("white")) {
    196215                                setFired(true);
    197216                                setLightColour("W");
     
    225244                        str = keys.get("seamark:buoy_special_purpose:shape");
    226245
    227                         if (str.compareTo("pillar") == 0)
     246                        if (str.equals("pillar"))
    228247                                setStyleIndex(SPEC_PILLAR);
    229                         else if (str.compareTo("spar") == 0)
     248                        else if (str.equals("spar"))
    230249                                setStyleIndex(SPEC_SPAR);
    231                         else if (str.compareTo("sphere") == 0)
     250                        else if (str.equals("sphere"))
    232251                                setStyleIndex(SPEC_SPHERE);
    233                         else if (str.compareTo("barrel") == 0)
     252                        else if (str.equals("barrel"))
    234253                                setStyleIndex(SPEC_BARREL);
    235254                        else
     
    239258                if (keys.containsKey("seamark:beacon_special_purpose"))
    240259                        setStyleIndex(SPEC_BEACON);
    241                         return ret;
     260                else if (keys.containsKey("seamark:light_float")
     261                                && keys.containsKey("seamark:light_float:colour")
     262                                && keys.get("seamark:light_float:colour").equals("yellow"))
     263                        setStyleIndex(SPEC_FLOAT);
     264
     265                return ret;
    242266        }
    243267
Note: See TracChangeset for help on using the changeset viewer.