Ignore:
Timestamp:
2010-09-10T17:02:59+02:00 (14 years ago)
Author:
malcolmh
Message:

break

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

Legend:

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

    r23086 r23093  
    663663                                public void actionPerformed(java.awt.event.ActionEvent e) {
    664664                                        buoy.setSectored(rbM01FiredN.isSelected());
     665                                        if (rbM01Fired1.isSelected()) buoy.setSectorIndex(0);
    665666                                        buoy.paintSign();
    666667                                }
     
    11851186                        tfM01Height.addFocusListener(new FocusAdapter() {
    11861187                                public void focusLost(FocusEvent e) {
    1187                                         buoy.setName(tfM01Height.getText().trim());
     1188                                        buoy.setHeight(tfM01Height.getText().trim());
    11881189                                }
    11891190                        });
     
    11981199                        tfM01Range.addFocusListener(new FocusAdapter() {
    11991200                                public void focusLost(FocusEvent e) {
    1200                                         buoy.setName(tfM01Range.getText().trim());
     1201                                        buoy.setRange(tfM01Range.getText().trim());
    12011202                                }
    12021203                        });
     
    12761277                        cbM01Sector.addActionListener(new ActionListener() {
    12771278                                public void actionPerformed(ActionEvent e) {
    1278                                         int sec = cbM01Sector.getSelectedIndex();
     1279                                        buoy.setSectorIndex(cbM01Sector.getSelectedIndex());
     1280                                        buoy.paintSign();
    12791281                                }
    12801282                        });
     
    12891291                        tfM01Bearing.addFocusListener(new FocusAdapter() {
    12901292                                public void focusLost(FocusEvent e) {
    1291 //                                      buoy.setName(tfM01Bearing.getText());
    12921293                                }
    12931294                        });
     
    13021303                        tfM02Bearing.addFocusListener(new FocusAdapter() {
    13031304                                public void focusLost(FocusEvent e) {
    1304 //                                      buoy.setName(tfM02Bearing.getText());
    13051305                                }
    13061306                        });
     
    13151315                        tfM01Radius.addFocusListener(new FocusAdapter() {
    13161316                                public void focusLost(FocusEvent e) {
    1317 //                                      buoy.setName(tfM01Radius.getText());
    13181317                                }
    13191318                        });
  • applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/Buoy.java

    r23086 r23093  
    66import java.util.Enumeration;
    77import java.util.Map;
     8import java.util.Iterator;
    89import java.util.Vector;
    910import java.util.regex.Matcher;
     
    158159        }
    159160
    160         private String LightChar = "";
     161        private int SectorIndex = 0;
     162
     163        public int getSectorIndex() {
     164                return SectorIndex;
     165        }
     166
     167        public void setSectorIndex(int sector) {
     168                SectorIndex = sector;
     169        }
     170
     171        private String[] LightChar = new String[10];
    161172
    162173        public String getLightChar() {
    163                 return LightChar;
     174                return LightChar[getSectorIndex()];
    164175        }
    165176
    166177        public void setLightChar(String lightChar) {
    167                 LightChar = lightChar;
    168         }
    169 
    170         private String LightColour = "";
     178                LightChar[getSectorIndex()] = lightChar;
     179        }
     180
     181        private String[] LightColour = new String[10];
    171182
    172183        public String getLightColour() {
    173                 return LightColour;
     184                return LightColour[getSectorIndex()];
    174185        }
    175186
    176187        public void setLightColour(String lightColour) {
    177                 LightColour = lightColour;
    178         }
    179 
    180         private String LightGroup = "";
     188                LightColour[getSectorIndex()] = lightColour;
     189        }
     190
     191        private String[] LightGroup = new String[10];
    181192
    182193        public String getLightGroup() {
    183                 return LightGroup;
     194                return LightGroup[getSectorIndex()];
    184195        }
    185196
    186197        public void setLightGroup(String lightGroup) {
    187                 LightGroup = lightGroup;
     198                LightGroup[getSectorIndex()] = lightGroup;
    188199        }
    189200
    190201        protected void setLightGroup(Map<String, String> k) {
    191202                String s = "";
    192 
    193203                if (k.containsKey("seamark:light:group")) {
    194204                        s = k.get("seamark:light:group");
    195 
    196                         LightGroup = s;
    197                 }
    198 
    199         }
    200 
    201         private String Height = "";
     205                        setLightGroup(s);
     206                }
     207        }
     208
     209        private String[] Height = new String[10];
    202210
    203211        public String getHeight() {
    204                 return Height;
     212                return Height[getSectorIndex()];
    205213        }
    206214
    207215        public void setHeight(String height) {
    208                 Height = height;
    209         }
    210 
    211         private String Range = "";
     216                Height[getSectorIndex()] = height;
     217        }
     218
     219        private String[] Range = new String[10];
    212220
    213221        public String getRange() {
    214                 return Range;
     222                return Range[getSectorIndex()];
    215223        }
    216224
    217225        public void setRange(String range) {
    218                 Range = range;
    219         }
    220 
    221         private String LightPeriod = "";
     226                Range[getSectorIndex()] = range;
     227        }
     228
     229        private String[] LightPeriod = new String[10];
    222230
    223231        public String getLightPeriod() {
    224                 return LightPeriod;
     232                return LightPeriod[getSectorIndex()];
    225233        }
    226234
     
    235243
    236244                if (matcher.find()) {
    237                         LightPeriod = lightPeriod;
    238 
     245                        LightPeriod[getSectorIndex()] = lightPeriod;
    239246                        setErrMsg(null);
    240247                } else {
     
    242249                        dlg.tfM01RepeatTime.requestFocus();
    243250                }
    244 
    245251        }
    246252
    247253        protected void setLightPeriod(Map<String, String> k) {
    248                 String s;
    249 
    250                 s = "";
    251 
    252                 if (k.containsKey("seamark:light:signal:period")) {
    253                         s = k.get("seamark:light:signal:period");
    254                         LightPeriod = s;
    255 
    256                         return;
    257                 }
    258 
     254                String s = "";
    259255                if (k.containsKey("seamark:light:period")) {
    260256                        s = k.get("seamark:light:period");
    261                         LightPeriod = s;
    262 
     257                        setSectorIndex(0);
     258                        setLightPeriod(s);
    263259                        return;
    264260                }
    265261        }
    266262
     263        public void parseLights(Map<String, String> k) {
     264    Iterator it = k.entrySet().iterator();
     265    while (it.hasNext()) {
     266        String key = (String)((Map.Entry)it.next()).getKey();
     267        if (key.contains("seamark:light:")) {
     268          String value = ((String)((Map.Entry)it.next()).getValue()).trim();
     269               
     270        }
     271    }
     272}
     273       
    267274        private Node Node = null;
    268275
     
    326333                        dlg.cM01Fired.setSelected(isFired());
    327334
    328                         dlg.tfM01RepeatTime.setText(LightPeriod);
     335                        dlg.tfM01RepeatTime.setText(getLightPeriod());
    329336
    330337                        dlg.tfM01Name.setText(getName());
     
    496503                                setLightColour("W");
    497504                        }
    498                         if (LightPeriod != "" && LightPeriod != " " && LightChar != "Q")
    499                                 Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    500                                                 "seamark:light:period", LightPeriod));
    501 
    502                         if (LightChar != "")
    503                                 Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    504                                                 "seamark:light:character", LightChar));
    505 
    506                         if (LightGroup != "")
    507                                 Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    508                                                 "seamark:light:group", LightGroup));
     505                        if (getLightPeriod() != "" && getLightPeriod() != " "
     506                                        && getLightChar() != "Q")
     507                                Main.main.undoRedo.add(new ChangePropertyCommand(Node,
     508                                                "seamark:light:period", getLightPeriod()));
     509
     510                        if (getLightChar() != "")
     511                                Main.main.undoRedo.add(new ChangePropertyCommand(Node,
     512                                                "seamark:light:character", getLightChar()));
     513
     514                        if (getLightGroup() != "")
     515                                Main.main.undoRedo.add(new ChangePropertyCommand(Node,
     516                                                "seamark:light:group", getLightGroup()));
    509517                }
    510518        }
     
    581589                                        break;
    582590                                }
    583                         if (!getFogGroup().equals(""))
    584                                 Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    585                                                 "seamark:fog_group:group", getFogGroup()));
    586                         if (!getFogPeriod().equals(""))
    587                                 Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    588                                                 "seamark:fog_period:group", getFogPeriod()));
     591                                if (!getFogGroup().equals(""))
     592                                        Main.main.undoRedo.add(new ChangePropertyCommand(Node,
     593                                                        "seamark:fog_group:group", getFogGroup()));
     594                                if (!getFogPeriod().equals(""))
     595                                        Main.main.undoRedo.add(new ChangePropertyCommand(Node,
     596                                                        "seamark:fog_period:group", getFogPeriod()));
    589597                        }
    590598                }
    591599        }
    592 
    593         public final static int FOG_HORN = 1;
    594         public final static int FOG_SIREN = 2;
    595         public final static int FOG_DIA = 3;
    596         public final static int FOG_BELL = 4;
    597         public final static int FOG_WHIS = 5;
    598         public final static int FOG_GONG = 6;
    599         public final static int FOG_EXPLOS = 7;
    600600
    601601        public void refreshStyles() {
     
    674674                dlg.rbM01FiredN.setVisible(false);
    675675                setSectored(false);
     676                setSectorIndex(0);
    676677                dlg.cbM01Kennung.removeAllItems();
    677678                dlg.cbM01Kennung.setVisible(false);
    678679                dlg.lM01Kennung.setVisible(false);
     680                setLightChar("");
    679681                dlg.tfM01Height.setText("");
    680682                dlg.tfM01Height.setVisible(false);
    681683                dlg.lM01Height.setVisible(false);
     684                setHeight("");
    682685                dlg.tfM01Range.setText("");
    683686                dlg.tfM01Range.setVisible(false);
    684687                dlg.lM01Range.setVisible(false);
     688                setRange("");
    685689                dlg.cbM01Colour.setVisible(false);
    686690                dlg.lM01Colour.setVisible(false);
     691                setLightColour("");
    687692                dlg.cbM01Sector.setVisible(false);
    688693                dlg.lM01Sector.setVisible(false);
     
    690695                dlg.tfM01Group.setVisible(false);
    691696                dlg.lM01Group.setVisible(false);
     697                setLightGroup("");
    692698                dlg.tfM01RepeatTime.setText("");
    693699                dlg.tfM01RepeatTime.setVisible(false);
    694700                dlg.lM01RepeatTime.setVisible(false);
     701                setLightPeriod("");
    695702                dlg.tfM01Bearing.setText("");
    696703                dlg.tfM01Bearing.setVisible(false);
  • applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java

    r23086 r23093  
    2525
    2626                resetMask();
    27 
     27               
    2828                dlg.rbM01RegionA.setEnabled(true);
    2929                dlg.rbM01RegionB.setEnabled(true);
Note: See TracChangeset for help on using the changeset viewer.