Ignore:
Timestamp:
2011-06-11T23:03:02+02:00 (13 years ago)
Author:
malcolmh
Message:

save

Location:
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChr.java

    r26110 r26124  
    2020import oseam.Messages;
    2121import oseam.dialogs.OSeaMAction;
    22 import oseam.seamarks.SeaMark.Chr;
    2322import oseam.seamarks.SeaMark;
     23import oseam.seamarks.Light;
     24import oseam.seamarks.Light.Chr;
    2425
    2526public class PanelChr extends JPanel {
     
    7677                                }
    7778                        }
    78                         if (SeaMark.ChrMAP.containsKey(combo)) {
    79                                 charBox.setText(SeaMark.ChrMAP.get(combo));
     79                        if (Light.ChrMAP.containsKey(combo)) {
     80                                charBox.setText(Light.ChrMAP.get(combo));
    8081                        } else {
    8182                                for (Chr chr : buttons.keySet()) {
    8283                                        JToggleButton button = buttons.get(chr);
    8384                                        if (button == source) {
    84                                                 charBox.setText(SeaMark.ChrMAP.get(EnumSet.of(chr)));
     85                                                charBox.setText(Light.ChrMAP.get(EnumSet.of(chr)));
    8586                                                button.setSelected(true);
    8687                                                button.setBorderPainted(true);
     
    9798                        String str = charBox.getText();
    9899                        EnumSet<Chr> set = EnumSet.noneOf(Chr.class);
    99                         for (EnumSet<Chr> map : SeaMark.ChrMAP.keySet()) {
    100                                 if (str.equals(SeaMark.ChrMAP.get(map))) {
     100                        for (EnumSet<Chr> map : Light.ChrMAP.keySet()) {
     101                                if (str.equals(Light.ChrMAP.get(map))) {
    101102                                        set = map;
    102103                                        break;
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java

    r26114 r26124  
    99import javax.swing.JTextField;
    1010import javax.swing.JComboBox;
    11 import javax.swing.JTable;
    1211import javax.swing.SwingConstants;
    13 import javax.swing.JFrame;
    1412
    1513import java.awt.Color;
     
    8280                                        if (dlg.mark.light.getRowCount() == 1) {
    8381                                                dlg.mark.light.addSector(1);
    84                                                 dlg.mark.setSectored(true);
     82                                                dlg.mark.light.setSectored(true);
    8583                                        }
    8684                                        panelSector.setVisible(true);
    8785                                } else {
    88                                         dlg.mark.setSectored(false);
     86                                        dlg.mark.light.setSectored(false);
    8987                                        panelSector.setVisible(false);
    9088                                }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSectors.java

    r26114 r26124  
    11package oseam.panels;
    2 
    3 import java.util.ArrayList;
    42
    53import javax.swing.ImageIcon;
     
    97import javax.swing.JTable;
    108import javax.swing.JButton;
    11 import javax.swing.table.AbstractTableModel;
    129
    1310import oseam.seamarks.Light;
    14 import oseam.seamarks.SeaMark;
    1511
    1612public class PanelSectors extends JFrame {
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/Light.java

    r26114 r26124  
    22
    33import java.util.ArrayList;
     4import java.util.EnumSet;
     5import java.util.HashMap;
     6import java.util.Map;
     7import java.util.regex.Matcher;
     8import java.util.regex.Pattern;
    49
    510import javax.swing.table.AbstractTableModel;
    611
     12import oseam.dialogs.OSeaMAction;
     13import oseam.seamarks.SeaMark.Col;
     14
    715public class Light extends AbstractTableModel {
     16       
     17        OSeaMAction dlg;
    818
    919        private String[] columns = { "Sector", "Start", "End", "Colour",
     
    1121        private ArrayList<Object[]> lights;
    1222       
    13         public Light() {
     23        public Light(OSeaMAction dia) {
    1424                super();
     25                dlg = dia;
    1526                lights = new ArrayList<Object[]>();
    1627                lights.add(new Object[12]);
     
    4253
    4354        public void setValueAt(Object value, int row, int col) {
    44 //              lights.set(row, value)[col] = value;
    45                 fireTableCellUpdated(row, col);
     55                ((Object[])lights.get(row+1))[col+1] = value;
    4656        }
    4757        public void addSector(int idx) {
    48                 lights.add(idx, new Object[12]);
     58                lights.add(idx, new Object[]{null, null, null, null, null, null, null, null, null, null, null, null});
    4959        }
    5060       
     
    5363        }
    5464       
     65        private boolean Fired = false;
     66
     67        public boolean isFired() {
     68                return Fired;
     69        }
     70
     71        public void setFired(boolean fired) {
     72                Fired = fired;
     73        }
     74
     75        private boolean Sectored = false;
     76
     77        public boolean isSectored() {
     78                return Sectored;
     79        }
     80
     81        public void setSectored(boolean sectored) {
     82                Sectored = sectored;
     83                if (sectored) {
     84                        setLightColour(0, Col.UNKNOWN);
     85                } else {
     86                        setLightChar(0, Chr.UNKNOWN);
     87                        setLightColour(0, Col.UNKNOWN);
     88                        setLightGroup(0, "");
     89                        setHeight(0, "");
     90                        setRange(0, "");
     91                        setBearing1(0, "");
     92                        setBearing2(0, "");
     93                        setVisibility(0, Vis.UNKNOWN);
     94                }
     95        }
     96
     97        public String getBearing1(int idx) {
     98                return (String)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 1);
     99        }
     100
     101        public void setBearing1(int idx, String bearing) {
     102                dlg.panelMain.panelLit.panelSector.table.setValueAt(bearing, idx, 1);
     103        }
     104
     105        public String getBearing2(int idx) {
     106                return (String)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 2);
     107        }
     108
     109        public void setBearing2(int idx, String bearing) {
     110                dlg.panelMain.panelLit.panelSector.table.setValueAt(bearing, idx, 2);
     111        }
     112
     113        public Col getLightColour(int idx) {
     114                return (Col)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 3);
     115        }
     116
     117        public void setLightColour(int idx, Col col) {
     118                dlg.panelMain.panelLit.panelSector.table.setValueAt(col, idx, 3);
     119        }
     120
     121        public enum Chr {
     122                UNKNOWN, FIXED, FLASH, LONGFLASH, QUICK, VERYQUICK, ULTRAQUICK,
     123                ISOPHASED, OCCULTING, MORSE, ALTERNATING, INTERRUPTEDQUICK, INTERRUPTEDVERYQUICK, INTERRUPTEDULTRAQUICK
     124        }
     125
     126        public static final Map<EnumSet<Chr>, String> ChrMAP = new HashMap<EnumSet<Chr>, String>();
     127        static {
     128                ChrMAP.put(EnumSet.of(Chr.UNKNOWN), "");
     129                ChrMAP.put(EnumSet.of(Chr.FIXED), "F");
     130                ChrMAP.put(EnumSet.of(Chr.FLASH), "Fl");
     131                ChrMAP.put(EnumSet.of(Chr.LONGFLASH), "LFl");
     132                ChrMAP.put(EnumSet.of(Chr.QUICK), "Q");
     133                ChrMAP.put(EnumSet.of(Chr.VERYQUICK), "VQ");
     134                ChrMAP.put(EnumSet.of(Chr.ULTRAQUICK), "UQ");
     135                ChrMAP.put(EnumSet.of(Chr.INTERRUPTEDQUICK), "IQ");
     136                ChrMAP.put(EnumSet.of(Chr.INTERRUPTEDVERYQUICK), "IVQ");
     137                ChrMAP.put(EnumSet.of(Chr.INTERRUPTEDULTRAQUICK), "IUQ");
     138                ChrMAP.put(EnumSet.of(Chr.ISOPHASED), "Iso");
     139                ChrMAP.put(EnumSet.of(Chr.OCCULTING), "Oc");
     140                ChrMAP.put(EnumSet.of(Chr.MORSE), "Mo");
     141                ChrMAP.put(EnumSet.of(Chr.ALTERNATING), "Al");
     142                ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FIXED), "Al.F");
     143                ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FLASH), "Al.Fl");
     144                ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FIXED, Chr.FLASH), "F.Al.Fl");
     145                ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.LONGFLASH), "Al.LFl");
     146                ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.ISOPHASED), "Al.Iso");
     147                ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.OCCULTING), "Al.Oc");
     148                ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.FLASH), "FFl");
     149                ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.LONGFLASH), "FLFl");
     150                ChrMAP.put(EnumSet.of(Chr.OCCULTING, Chr.FLASH), "OcFl");
     151                ChrMAP.put(EnumSet.of(Chr.FLASH, Chr.LONGFLASH), "FlLFl");
     152                ChrMAP.put(EnumSet.of(Chr.QUICK, Chr.LONGFLASH), "Q+LFl");
     153                ChrMAP.put(EnumSet.of(Chr.VERYQUICK, Chr.LONGFLASH), "VQ+LFl");
     154                ChrMAP.put(EnumSet.of(Chr.ULTRAQUICK, Chr.LONGFLASH), "UQ+LFl");
     155        }
     156       
     157        public Chr getLightChar(int idx) {
     158                return (Chr)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 4);
     159        }
     160
     161        public void setLightChar(int idx, Chr chr) {
     162                dlg.panelMain.panelLit.panelSector.table.setValueAt(chr, idx, 4);
     163        }
     164
     165        public String getLightGroup(int idx) {
     166                return (String)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 5);
     167        }
     168
     169        public void setLightGroup(int idx, String grp) {
     170                dlg.panelMain.panelLit.panelSector.table.setValueAt(grp, idx, 5);
     171        }
     172
     173        protected void setLightGroup(int idx, Map<String, String> keys) {
     174                String s = "";
     175                if (keys.containsKey("seamark:light:group")) {
     176                        s = keys.get("seamark:light:group");
     177                        setLightGroup(0, s);
     178                }
     179        }
     180
     181        public String getLightPeriod(int idx) {
     182                return (String)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 6);
     183        }
     184
     185        public void setLightPeriod(int idx, String prd) {
     186                String regex = "^[\\d\\s.]+$";
     187
     188                if (!prd.isEmpty()) {
     189
     190                        Pattern pat = Pattern.compile(regex);
     191                        Matcher matcher = pat.matcher(prd);
     192
     193                        if (matcher.find()) {
     194                                // setErrMsg(null);
     195                        } else {
     196                                // setErrMsg("Must be a number");
     197                                prd = "";
     198                                // dlg.tfM01RepeatTime.requestFocus();
     199                        }
     200                }
     201                dlg.panelMain.panelLit.panelSector.table.setValueAt(prd, idx, 6);
     202        }
     203
     204        public String getHeight(int idx) {
     205                return (String)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 7);
     206        }
     207
     208        public void setHeight(int idx, String hgt) {
     209                dlg.panelMain.panelLit.panelSector.table.setValueAt(hgt, idx, 7);
     210        }
     211
     212        public String getRange(int idx) {
     213                return (String)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 8);
     214        }
     215
     216        public void setRange(int idx, String rng) {
     217                dlg.panelMain.panelLit.panelSector.table.setValueAt(rng, idx, 8);
     218        }
     219
     220        public enum Vis { UNKNOWN, HIGH, LOW, FAINT, INTEN, UNINTEN, REST, OBS, PARTOBS }
     221        public static final Map<EnumSet<Vis>, String> VisMAP = new HashMap<EnumSet<Vis>, String>();
     222        static {
     223                VisMAP.put(EnumSet.of(Vis.UNKNOWN), "");
     224                VisMAP.put(EnumSet.of(Vis.HIGH), "high");
     225                VisMAP.put(EnumSet.of(Vis.LOW), "low");
     226                VisMAP.put(EnumSet.of(Vis.FAINT), "faint");
     227                VisMAP.put(EnumSet.of(Vis.INTEN), "intensified");
     228                VisMAP.put(EnumSet.of(Vis.UNINTEN), "unintensified");
     229                VisMAP.put(EnumSet.of(Vis.REST), "restricted");
     230                VisMAP.put(EnumSet.of(Vis.OBS), "obscured");
     231                VisMAP.put(EnumSet.of(Vis.PARTOBS), "part_obscured");
     232        }
     233       
     234        public Vis getVisibility(int idx) {
     235                return (Vis)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 9);
     236        }
     237
     238        public void setVisibility(int idx, Vis vis) {
     239                dlg.panelMain.panelLit.panelSector.table.setValueAt(vis, idx, 9);
     240        }
     241
     242        public enum Lit { UNKNOWN, VERT, VERT2, VERT3, VERT4, HORIZ, HORIZ2, HORIZ3, HORIZ4,
     243                UPPER, LOWER, REAR, FRONT, AERO, AIROBS, FOGDET, FLOOD, STRIP, SUBS, SPOT, MOIRE, EMERG, BEAR }
     244        public static final Map<EnumSet<Lit>, String> LitMAP = new HashMap<EnumSet<Lit>, String>();
     245        static {
     246                LitMAP.put(EnumSet.of(Lit.UNKNOWN), "");
     247        }
     248               
     249                public Lit getLightCategory(int idx) {
     250                return (Lit)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 10);
     251        }
     252
     253        public void setLightCategory(int idx, Lit cat) {
     254                dlg.panelMain.panelLit.panelSector.table.setValueAt(cat, idx, 10);
     255        }
     256
     257        public enum Exh { UNKNOWN, H24, DAY, NIGHT, FOG }
     258        public static final Map<EnumSet<Exh>, String> ExhMAP = new HashMap<EnumSet<Exh>, String>();
     259        static {
     260                ExhMAP.put(EnumSet.of(Exh.UNKNOWN), "");
     261                ExhMAP.put(EnumSet.of(Exh.H24), "24h");
     262                ExhMAP.put(EnumSet.of(Exh.DAY), "day");
     263                ExhMAP.put(EnumSet.of(Exh.NIGHT), "night");
     264                ExhMAP.put(EnumSet.of(Exh.FOG), "fog");
     265        }
     266       
     267        public Exh getExhibition(int idx) {
     268                return (Exh)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 11);
     269        }
     270
     271        public void setExhibition(int idx, Exh exh) {
     272                dlg.panelMain.panelLit.panelSector.table.setValueAt(exh, idx, 11);
     273        }
     274
     275        public String getOrientation(int idx) {
     276                return (String)dlg.panelMain.panelLit.panelSector.table.getValueAt(idx, 12);
     277        }
     278
     279        public void setOrientation(int idx, String ori) {
     280                dlg.panelMain.panelLit.panelSector.table.setValueAt(ori, idx, 12);
     281        }
     282
    55283}
    56284
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java

    r26114 r26124  
    1616import oseam.Messages;
    1717import oseam.dialogs.OSeaMAction;
     18import oseam.seamarks.Light;
    1819
    1920public class SeaMark {
     
    234235                case DAYMARK:
    235236                        return dayColour;
    236                 case LIGHT:
    237                         return lightColour[sectorIndex];
     237//              case LIGHT:
     238//                      return light.getLightColour();
    238239                }
    239240                return Col.UNKNOWN;
     
    254255                        dayColour = col;
    255256                        break;
    256                 case LIGHT:
    257                         lightColour[sectorIndex] = col;
    258                         break;
     257//              case LIGHT:
     258//                      light.setLightColour(col);
     259//                      break;
    259260                }
    260261        }
     
    411412        }
    412413
    413         private boolean Fired = false;
    414 
    415         public boolean isFired() {
    416                 return Fired;
    417         }
    418 
    419         public void setFired(boolean fired) {
    420                 Fired = fired;
    421         }
    422 
    423         private boolean Sectored = false;
    424 
    425         public boolean isSectored() {
    426                 return Sectored;
    427         }
    428 
    429         public void setSectored(boolean sectored) {
    430                 Sectored = sectored;
    431                 if (sectored) {
    432                         lightColour[0] = Col.UNKNOWN;
    433                 } else {
    434                         setsectorIndex(0);
    435                         setLightChar("");
    436                         setLightColour(Col.UNKNOWN);
    437                         setLightGroup("");
    438                         setHeight("");
    439                         setRange("");
    440                         setBearing1("");
    441                         setBearing2("");
    442                         setVisibility(Vis.UNKNOWN);
    443                 }
    444         }
    445 
    446         private int sectorIndex = 0;
    447 
    448         public int getsectorIndex() {
    449                 return sectorIndex;
    450         }
    451 
    452         public void setsectorIndex(int sector) {
    453                 sectorIndex = sector;
    454         }
     414        public Light light = new Light(dlg);
    455415       
    456         public enum Chr {
    457                 UNKNOWN, FIXED, FLASH, LONGFLASH, QUICK, VERYQUICK, ULTRAQUICK,
    458                 ISOPHASED, OCCULTING, MORSE, ALTERNATING, INTERRUPTEDQUICK, INTERRUPTEDVERYQUICK, INTERRUPTEDULTRAQUICK
    459         }
    460 
    461         public static final Map<EnumSet<Chr>, String> ChrMAP = new HashMap<EnumSet<Chr>, String>();
    462         static {
    463                 ChrMAP.put(EnumSet.of(Chr.UNKNOWN), "");
    464                 ChrMAP.put(EnumSet.of(Chr.FIXED), "F");
    465                 ChrMAP.put(EnumSet.of(Chr.FLASH), "Fl");
    466                 ChrMAP.put(EnumSet.of(Chr.LONGFLASH), "LFl");
    467                 ChrMAP.put(EnumSet.of(Chr.QUICK), "Q");
    468                 ChrMAP.put(EnumSet.of(Chr.VERYQUICK), "VQ");
    469                 ChrMAP.put(EnumSet.of(Chr.ULTRAQUICK), "UQ");
    470                 ChrMAP.put(EnumSet.of(Chr.INTERRUPTEDQUICK), "IQ");
    471                 ChrMAP.put(EnumSet.of(Chr.INTERRUPTEDVERYQUICK), "IVQ");
    472                 ChrMAP.put(EnumSet.of(Chr.INTERRUPTEDULTRAQUICK), "IUQ");
    473                 ChrMAP.put(EnumSet.of(Chr.ISOPHASED), "Iso");
    474                 ChrMAP.put(EnumSet.of(Chr.OCCULTING), "Oc");
    475                 ChrMAP.put(EnumSet.of(Chr.MORSE), "Mo");
    476                 ChrMAP.put(EnumSet.of(Chr.ALTERNATING), "Al");
    477                 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FIXED), "Al.F");
    478                 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FLASH), "Al.Fl");
    479                 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.FIXED, Chr.FLASH), "F.Al.Fl");
    480                 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.LONGFLASH), "Al.LFl");
    481                 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.ISOPHASED), "Al.Iso");
    482                 ChrMAP.put(EnumSet.of(Chr.ALTERNATING, Chr.OCCULTING), "Al.Oc");
    483                 ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.FLASH), "FFl");
    484                 ChrMAP.put(EnumSet.of(Chr.FIXED, Chr.LONGFLASH), "FLFl");
    485                 ChrMAP.put(EnumSet.of(Chr.OCCULTING, Chr.FLASH), "OcFl");
    486                 ChrMAP.put(EnumSet.of(Chr.FLASH, Chr.LONGFLASH), "FlLFl");
    487                 ChrMAP.put(EnumSet.of(Chr.QUICK, Chr.LONGFLASH), "Q+LFl");
    488                 ChrMAP.put(EnumSet.of(Chr.VERYQUICK, Chr.LONGFLASH), "VQ+LFl");
    489                 ChrMAP.put(EnumSet.of(Chr.ULTRAQUICK, Chr.LONGFLASH), "UQ+LFl");
    490         }
    491        
    492         public Light light = new Light();
    493        
    494         private String[] LightChar = new String[10];
    495 
    496         public String getLightChar() {
    497                 if (LightChar[sectorIndex] == null)
    498                         return (LightChar[0]);
    499                 return LightChar[sectorIndex];
    500         }
    501 
    502         public void setLightChar(String lightChar) {
    503                 if (sectorIndex == 0) {
    504                         LightChar = new String[10];
    505                         LightChar[0] = lightChar;
    506                 } else if (LightChar[0].isEmpty())
    507                         LightChar[sectorIndex] = lightChar;
    508         }
    509 
    510         private Col[] lightColour = new Col[10];
    511 
    512         public Col getLightColour() {
    513                 if (lightColour[sectorIndex] == null)
    514                         return (lightColour[0]);
    515                 return lightColour[sectorIndex];
    516         }
    517 
    518         public void setLightColour(Col col) {
    519                 lightColour[sectorIndex] = col;
    520         }
    521 
    522         private String[] LightGroup = new String[10];
    523 
    524         public String getLightGroup() {
    525                 if (LightGroup[sectorIndex] == null)
    526                         return (LightGroup[0]);
    527                 return LightGroup[sectorIndex];
    528         }
    529 
    530         public void setLightGroup(String lightGroup) {
    531                 if (sectorIndex == 0)
    532                         LightGroup = new String[10];
    533                 LightGroup[sectorIndex] = lightGroup;
    534         }
    535 
    536         protected void setLightGroup(Map<String, String> keys) {
    537                 String s = "";
    538                 if (keys.containsKey("seamark:light:group")) {
    539                         s = keys.get("seamark:light:group");
    540                         setLightGroup(s);
    541                 }
    542         }
    543 
    544         private String[] Height = new String[10];
    545 
    546         public String getHeight() {
    547                 if (Height[sectorIndex] == null)
    548                         return (Height[0]);
    549                 return Height[sectorIndex];
    550         }
    551 
    552         public void setHeight(String height) {
    553                 if (sectorIndex == 0)
    554                         Height = new String[10];
    555                 Height[sectorIndex] = height;
    556         }
    557 
    558         private String[] Range = new String[10];
    559 
    560         public String getRange() {
    561                 if (Range[sectorIndex] == null)
    562                         return (Range[0]);
    563                 return Range[sectorIndex];
    564         }
    565 
    566         public void setRange(String range) {
    567                 if (sectorIndex == 0)
    568                         Range = new String[10];
    569                 Range[sectorIndex] = range;
    570         }
    571 
    572         private String[] Bearing1 = new String[10];
    573 
    574         public String getBearing1() {
    575                 if (Bearing1[sectorIndex] == null)
    576                         return (Bearing1[0]);
    577                 return Bearing1[sectorIndex];
    578         }
    579 
    580         public void setBearing1(String bearing) {
    581                 if (sectorIndex == 0)
    582                         Bearing1 = new String[10];
    583                 Bearing1[sectorIndex] = bearing;
    584         }
    585 
    586         private String[] Bearing2 = new String[10];
    587 
    588         public String getBearing2() {
    589                 if (Bearing2[sectorIndex] == null)
    590                         return (Bearing2[0]);
    591                 return Bearing2[sectorIndex];
    592         }
    593 
    594         public void setBearing2(String bearing) {
    595                 if (sectorIndex == 0)
    596                         Bearing2 = new String[10];
    597                 Bearing2[sectorIndex] = bearing;
    598         }
    599 
    600         public enum Vis { UNKNOWN, HIGH, LOW, FAINT, INTEN, UNINTEN, REST, OBS, PARTOBS }
    601         public static final Map<EnumSet<Vis>, String> VisMAP = new HashMap<EnumSet<Vis>, String>();
    602         static {
    603                 VisMAP.put(EnumSet.of(Vis.UNKNOWN), "");
    604                 VisMAP.put(EnumSet.of(Vis.HIGH), "high");
    605                 VisMAP.put(EnumSet.of(Vis.LOW), "low");
    606                 VisMAP.put(EnumSet.of(Vis.FAINT), "faint");
    607                 VisMAP.put(EnumSet.of(Vis.INTEN), "intensified");
    608                 VisMAP.put(EnumSet.of(Vis.UNINTEN), "unintensified");
    609                 VisMAP.put(EnumSet.of(Vis.REST), "restricted");
    610                 VisMAP.put(EnumSet.of(Vis.OBS), "obscured");
    611                 VisMAP.put(EnumSet.of(Vis.PARTOBS), "part_obscured");
    612         }
    613        
    614         private Vis[] Visibility = new Vis[10];
    615 
    616         public Vis getVisibility() {
    617                 if (Visibility[sectorIndex] == null)
    618                         return (Visibility[0]);
    619                 return Visibility[sectorIndex];
    620         }
    621 
    622         public void setVisibility(Vis visibility) {
    623                 if (sectorIndex == 0)
    624                         Visibility = new Vis[10];
    625                 Visibility[sectorIndex] = visibility;
    626         }
    627 
    628         private String[] LightPeriod = new String[10];
    629 
    630         public String getLightPeriod() {
    631                 if (LightPeriod[sectorIndex] == null)
    632                         return (LightPeriod[0]);
    633                 return LightPeriod[sectorIndex];
    634         }
    635 
    636         public void setLightPeriod(String lightPeriod) {
    637                 String regex = "^[\\d\\s.]+$";
    638 
    639                 if (!lightPeriod.isEmpty()) {
    640 
    641                         Pattern pat = Pattern.compile(regex);
    642                         Matcher matcher = pat.matcher(lightPeriod);
    643 
    644                         if (matcher.find()) {
    645                                 // setErrMsg(null);
    646                         } else {
    647                                 // setErrMsg("Must be a number");
    648                                 lightPeriod = "";
    649                                 // dlg.tfM01RepeatTime.requestFocus();
    650                         }
    651                 }
    652                 if (sectorIndex == 0)
    653                         LightPeriod = new String[10];
    654                 LightPeriod[sectorIndex] = lightPeriod;
    655         }
    656 
    657416        private boolean paintlock = false;
    658417
     
    918677                        str = keys.get("seamark:topmark:shape");
    919678                }
    920 
     679/*
    921680                for (Map.Entry<String, String> entry : keys.entrySet()) {
    922681                        String key = entry.getKey();
    923682                        String value = entry.getValue().trim();
    924683                        if (key.contains("seamark:light:")) {
    925                                 setFired(true);
     684                                light.setFired(true);
    926685                                int index = 0;
    927686                                key = key.substring(14);
     
    967726                        }
    968727                }
    969 
     728*/
    970729                if (keys.containsKey("seamark:fog_signal") || keys.containsKey("seamark:fog_signal:category")
    971730                    || keys.containsKey("seamark:fog_signal:group") || keys.containsKey("seamark:fog_signal:period")) {
     
    1182941                                Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:daymark:colour", str));
    1183942                }
    1184 
     943/*
    1185944                Col colour;
    1186945                if (isFired()) {
     
    1236995                                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light:" + i + ":sector_end", Bearing2[i]));
    1237996                        }
    1238                 }
     997                }*/
    1239998                if (hasRadar()) {
    1240999                        Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_reflector", "yes"));
Note: See TracChangeset for help on using the changeset viewer.