Changeset 22836 in osm for applications


Ignore:
Timestamp:
2010-08-28T13:06:20+02:00 (14 years ago)
Author:
malcolmh
Message:

'New release'

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

Legend:

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

    r22828 r22836  
    171171                String str = Main.pref.get("mappaint.style.sources");
    172172                if (!str.contains("dev.openseamap.org")) {
    173                         if (!str.equals(""))
    174                                 str += new String(new char[] { 0x1e });
    175                         Main.pref.put("mappaint.style.sources", str
    176                                         + "http://dev.openseamap.org/josm/seamark_styles.xml");
     173                        if (!str.equals("")) str += new String(new char[] {0x1e});
     174                        Main.pref.put("mappaint.style.sources", str + "http://dev.openseamap.org/josm/seamark_styles.xml");
    177175                }
    178176        }
     
    180178        public void CloseDialog() {
    181179                onode = null;
    182                 DataSet.removeSelectionListener(SmpListener);
     180                DataSet.selListeners.remove(SmpListener);
     181//              DataSet.removeSelectionListener(SmpListener);
    183182                Selection = null;
    184183
     
    226225                // siehe org.openstreetmap.josm.plugins.osb -> OsbLayer.java
    227226                // Einhängen des Listeners in die Eventqueue von josm
    228                 DataSet.addSelectionListener(SmpListener);
     227                DataSet.selListeners.add(SmpListener);
     228//              DataSet.addSelectionListener(SmpListener);
    229229        }
    230230
     
    444444                                                PicRebuild();
    445445                                        // Deaktivierung des Listeners
    446                                         DataSet.removeSelectionListener(SmpListener);
     446                                        DataSet.selListeners.remove(SmpListener);
     447//                              DataSet.removeSelectionListener(SmpListener);
    447448                                        Selection = null;
    448449
     
    816817                                                PicRebuild();
    817818                                        // Deaktivierung des Listeners
    818                                         DataSet.removeSelectionListener(SmpListener);
     819                                        DataSet.selListeners.remove(SmpListener);
     820//                              DataSet.removeSelectionListener(SmpListener);
    819821                                        Selection = null;
    820822                                        SmpItem.setEnabled(true);
  • applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java

    r22746 r22836  
    117117                                        setColour(SeaMark.GREEN);
    118118                        }
    119                 } else if (cat.compareTo("starboard") == 0) {
     119                } else if (cat.equals("starboard")) {
    120120
    121121                        setBuoyIndex(STARBOARD_HAND);
    122122
    123                         if (col.compareTo("green") == 0) {
     123                        if (col.equals("green")) {
    124124                                setRegion(SeaMark.IALA_A);
    125125                                setColour(SeaMark.GREEN);
     
    133133                                        setColour(SeaMark.RED);
    134134                        }
    135                 } else if (cat.compareTo("preferred_channel_port") == 0) {
     135                } else if (cat.equals("preferred_channel_port")) {
    136136
    137137                        setBuoyIndex(PREF_PORT_HAND);
    138138
    139                         if (col.compareTo("red;green;red") == 0) {
     139                        if (col.equals("red;green;red")) {
    140140                                setRegion(SeaMark.IALA_A);
    141141                                setColour(SeaMark.RED_GREEN_RED);
    142                         } else if (col.compareTo("green;red;green") == 0) {
     142                        } else if (col.equals("green;red;green")) {
    143143                                setRegion(SeaMark.IALA_B);
    144144                                setColour(SeaMark.GREEN_RED_GREEN);
     
    150150                        }
    151151
    152                 } else if (cat.compareTo("preferred_channel_starboard") == 0) {
     152                } else if (cat.equals("preferred_channel_starboard")) {
    153153
    154154                        setBuoyIndex(PREF_STARBOARD_HAND);
    155155
    156                         if (col.compareTo("green;red;green") == 0) {
     156                        if (col.equals("green;red;green")) {
    157157                                setRegion(SeaMark.IALA_A);
    158158                                setColour(SeaMark.GREEN_RED_GREEN);
    159                         } else if (col.compareTo("red;green;red") == 0) {
     159                        } else if (col.equals("red;green;red")) {
    160160                                setRegion(SeaMark.IALA_B);
    161161                                setColour(SeaMark.RED_GREEN_RED);
     
    173173                        switch (getBuoyIndex()) {
    174174                        case PORT_HAND:
    175                                 if (str.compareTo("can") == 0)
     175                                if (str.equals("can"))
    176176                                        setStyleIndex(LAT_CAN);
    177                                 else if (str.compareTo("pillar") == 0)
     177                                else if (str.equals("pillar"))
    178178                                        setStyleIndex(LAT_PILLAR);
    179                                 else if (str.compareTo("spar") == 0)
     179                                else if (str.equals("spar"))
    180180                                        setStyleIndex(LAT_SPAR);
    181181                                break;
    182182
    183183                        case PREF_PORT_HAND:
    184                                 if (str.compareTo("can") == 0)
     184                                if (str.equals("can"))
    185185                                        setStyleIndex(LAT_CAN);
    186                                 else if (str.compareTo("pillar") == 0)
     186                                else if (str.equals("pillar"))
    187187                                        setStyleIndex(LAT_PILLAR);
    188                                 else if (str.compareTo("spar") == 0)
     188                                else if (str.equals("spar"))
    189189                                        setStyleIndex(LAT_SPAR);
    190190                                break;
    191191
    192192                        case STARBOARD_HAND:
    193                                 if (str.compareTo("conical") == 0)
     193                                if (str.equals("conical"))
    194194                                        setStyleIndex(LAT_CONE);
    195                                 else if (str.compareTo("pillar") == 0)
     195                                else if (str.equals("pillar"))
    196196                                        setStyleIndex(LAT_PILLAR);
    197                                 else if (str.compareTo("spar") == 0)
     197                                else if (str.equals("spar"))
    198198                                        setStyleIndex(LAT_SPAR);
    199199                                break;
    200200
    201201                        case PREF_STARBOARD_HAND:
    202                                 if (str.compareTo("conical") == 0)
     202                                if (str.equals("conical"))
    203203                                        setStyleIndex(LAT_CONE);
    204                                 else if (str.compareTo("pillar") == 0)
     204                                else if (str.equals("pillar"))
    205205                                        setStyleIndex(LAT_PILLAR);
    206                                 else if (str.compareTo("spar") == 0)
     206                                else if (str.equals("spar"))
    207207                                        setStyleIndex(LAT_SPAR);
    208208                                break;
    209209                        }
    210                 } else if (keys.containsKey("seamark:beacon_lateral:colour")) {
    211                         if (keys.containsKey("seamark:beacon_lateral:shape")) {
    212                                 str = keys.get("seamark:beacon_lateral:shape");
    213                                 if (str.compareTo("tower") == 0)
    214                                         setStyleIndex(LAT_TOWER);
    215                                 else
    216                                         setStyleIndex(LAT_BEACON);
    217                         } else
     210                } else if (keys.containsKey("seamark:beacon_lateral:shape")) {
     211                        str = keys.get("seamark:beacon_lateral:shape");
     212                        if (str.equals("tower"))
     213                                setStyleIndex(LAT_TOWER);
     214                        else if (str.equals("perch"))
     215                                setStyleIndex(LAT_PERCH);
     216                        else
    218217                                setStyleIndex(LAT_BEACON);
    219218                } else if (keys.containsKey("seamark:type")
     
    224223                refreshStyles();
    225224
    226                 if (keys.containsKey("seamark:topmark:shape")
    227                                 || keys.containsKey("seamark:topmark:colour")) {
    228                         setTopMark(true);
    229                 }
    230 
    231                 if (keys.containsKey("seamark:light:colour")) {
    232                         setLightColour(keys.get("seamark:light:colour"));
    233                         setFired(true);
    234                 }
    235 
    236                 if (keys.containsKey("seamark:light:character")) {
    237                         setLightGroup(keys);
    238                         setLightChar(keys.get("seamark:light:character"));
    239                         setLightPeriod(keys);
     225                if (getStyleIndex() != LAT_PERCH) {
     226                        if (keys.containsKey("seamark:topmark:shape")
     227                                        || keys.containsKey("seamark:topmark:colour")) {
     228                                setTopMark(true);
     229                        }
     230
     231                        if (keys.containsKey("seamark:light:colour")) {
     232                                setLightColour(keys.get("seamark:light:colour"));
     233                                setFired(true);
     234                        }
     235
     236                        if (keys.containsKey("seamark:light:character")) {
     237                                setLightGroup(keys);
     238                                setLightChar(keys.get("seamark:light:character"));
     239                                setLightPeriod(keys);
     240                        }
    240241                }
    241242        }
     
    312313                int style = getStyleIndex();
    313314
     315                if (style == LAT_PERCH) {
     316                        dlg.cM01Fired.setSelected(false);
     317                        dlg.cM01TopMark.setSelected(false);
     318                        dlg.cM01Fired.setEnabled(false);
     319                        dlg.cM01TopMark.setEnabled(false);
     320                } else {
     321                        dlg.cM01Fired.setEnabled(true);
     322                        dlg.cM01TopMark.setEnabled(true);
     323                }
     324
    314325                switch (getBuoyIndex()) {
    315326                case SeaMark.PORT_HAND:
     
    588599                                break;
    589600                        case LAT_PERCH:
    590                                 super.saveSign("buoy_lateral");
    591                                 Main.main.undoRedo.add(new ChangePropertyCommand(node,
    592                                                 "seamark:buoy_lateral:shape", "perch"));
     601                                super.saveSign("beacon_lateral");
     602                                Main.main.undoRedo.add(new ChangePropertyCommand(node,
     603                                                "seamark:beacon_lateral:shape", "perch"));
    593604                                break;
    594605                        default:
     
    598609                        case LAT_PILLAR:
    599610                        case LAT_SPAR:
     611                                Main.main.undoRedo.add(new ChangePropertyCommand(node,
     612                                                "seamark:buoy_lateral:category", "port"));
     613                                if (getRegion() != SeaMark.IALA_B) {
     614                                        Main.main.undoRedo.add(new ChangePropertyCommand(node,
     615                                                        "seamark:buoy_lateral:colour", "red"));
     616                                        colour = "red";
     617                                } else {
     618                                        Main.main.undoRedo.add(new ChangePropertyCommand(node,
     619                                                        "seamark:buoy_lateral:colour", "green"));
     620                                        colour = "green";
     621                                }
     622                                break;
    600623                        case LAT_PERCH:
    601624                                Main.main.undoRedo.add(new ChangePropertyCommand(node,
    602                                                 "seamark:buoy_lateral:category", "port"));
    603                                 if (getRegion() != SeaMark.IALA_B) {
    604                                         Main.main.undoRedo.add(new ChangePropertyCommand(node,
    605                                                         "seamark:buoy_lateral:colour", "red"));
    606                                         colour = "red";
    607                                 } else {
    608                                         Main.main.undoRedo.add(new ChangePropertyCommand(node,
    609                                                         "seamark:buoy_lateral:colour", "green"));
    610                                         colour = "green";
    611                                 }
     625                                                "seamark:beacon_lateral:category", "port"));
    612626                                break;
    613627                        case LAT_BEACON:
     
    752766                                break;
    753767                        case LAT_PERCH:
    754                                 super.saveSign("buoy_lateral");
    755                                 Main.main.undoRedo.add(new ChangePropertyCommand(node,
    756                                                 "seamark:buoy_lateral:shape", "perch"));
     768                                super.saveSign("beacon_lateral");
     769                                Main.main.undoRedo.add(new ChangePropertyCommand(node,
     770                                                "seamark:beacon_lateral:shape", "perch"));
    757771                                break;
    758772                        default:
     
    798812                                        colour = "red";
    799813                                }
     814                                break;
     815                        case LAT_PERCH:
     816                                Main.main.undoRedo.add(new ChangePropertyCommand(node,
     817                                                "seamark:beacon_lateral:category", "starboard"));
    800818                                break;
    801819                        }
Note: See TracChangeset for help on using the changeset viewer.