Changeset 24896 in osm


Ignore:
Timestamp:
2010-12-28T17:37:50+01:00 (14 years ago)
Author:
malcolmh
Message:

save

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

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/dialogs/OSeaMAction.java

    r24839 r24896  
    1919import oseam.Messages;
    2020import oseam.seamarks.SeaMark;
     21import oseam.seamarks.SeaMark.Obj;
    2122import oseam.seamarks.MarkCard;
    2223import oseam.seamarks.MarkIsol;
     
    100101                if (keys.containsKey("seamark:type"))
    101102                        type = keys.get("seamark:type");
    102                 if (type.equals("buoy_lateral") || type.equals("beacon_lateral")) {
    103                         mark = new MarkLat(this);
    104                 } else if (type.equals("buoy_cardinal") || type.equals("beacon_cardinal")) {
    105                         mark = new MarkCard(this);
    106                 } else if (type.equals("buoy_safe_water") || type.equals("beacon_safe_water")) {
    107                         mark = new MarkSaw(this);
    108                 } else if (type.equals("buoy_special_purpose") || type.equals("beacon_special_purpose")) {
    109                         mark = new MarkSpec(this);
    110                 } else if (type.equals("buoy_isolated_danger") || type.equals("beacon_isolated_danger")) {
    111                         mark = new MarkIsol(this);
     103                if (type.equals("buoy_lateral")) {
     104                        mark = new MarkLat(this);
     105                        mark.setObject(Obj.BOYLAT);
     106                } else if (type.equals("beacon_lateral")) {
     107                        mark = new MarkLat(this);
     108                        mark.setObject(Obj.BCNLAT);
     109                } else if (type.equals("buoy_cardinal")) {
     110                        mark = new MarkCard(this);
     111                        mark.setObject(Obj.BOYCAR);
     112                } else if (type.equals("beacon_cardinal")) {
     113                        mark = new MarkCard(this);
     114                        mark.setObject(Obj.BCNCAR);
     115                } else if (type.equals("buoy_safe_water")) {
     116                        mark = new MarkSaw(this);
     117                        mark.setObject(Obj.BOYSAW);
     118                } else if (type.equals("beacon_safe_water")) {
     119                        mark = new MarkSaw(this);
     120                        mark.setObject(Obj.BCNSAW);
     121                } else if (type.equals("buoy_special_purpose")) {
     122                        mark = new MarkSpec(this);
     123                        mark.setObject(Obj.BOYSPP);
     124                } else if (type.equals("beacon_special_purpose")) {
     125                        mark = new MarkSpec(this);
     126                        mark.setObject(Obj.BCNSPP);
     127                } else if (type.equals("buoy_isolated_danger")) {
     128                        mark = new MarkIsol(this);
     129                        mark.setObject(Obj.BOYISD);
     130                } else if (type.equals("beacon_isolated_danger")) {
     131                        mark = new MarkIsol(this);
     132                        mark.setObject(Obj.BCNISD);
    112133                } else if (type.equals("landmark") || type.equals("light_vessel") || type.equals("light_major") || type.equals("light_minor")) {
    113134                        mark = new MarkLight(this);
     135                        mark.setObject(Obj.LIGHTS);
    114136                } else if (type.equals("light_float")) {
    115137                        if (keys.containsKey("seamark:light_float:colour")) {
     
    117139                                if (str.equals("red") || str.equals("green") || str.equals("red;green;red") || str.equals("green;red;green")) {
    118140                                        mark = new MarkLat(this);
     141                                        mark.setObject(Obj.BOYLAT);
    119142                                } else if (str.equals("black;yellow") || str.equals("black;yellow;black") || str.equals("yellow;black")
    120143                                                || str.equals("yellow;black;yellow")) {
    121144                                        mark = new MarkCard(this);
     145                                        mark.setObject(Obj.BOYCAR);
    122146                                } else if (str.equals("black;red;black")) {
    123147                                        mark = new MarkIsol(this);
     148                                        mark.setObject(Obj.BOYISD);
    124149                                } else if (str.equals("red;white")) {
    125150                                        mark = new MarkSaw(this);
     151                                        mark.setObject(Obj.BOYSAW);
    126152                                } else if (str.equals("yellow")) {
    127153                                        mark = new MarkSpec(this);
     154                                        mark.setObject(Obj.BOYSPP);
    128155                                }
    129156                        } else if (keys.containsKey("seamark:light_float:topmark:shape")) {
     
    131158                                if (str.equals("cylinder") || str.equals("cone, point up")) {
    132159                                        mark = new MarkLat(this);
     160                                        mark.setObject(Obj.BOYLAT);
    133161                                }
    134162                        } else if (keys.containsKey("seamark:light_float:topmark:colour")) {
     
    136164                                if (str.equals("red") || str.equals("green")) {
    137165                                        mark = new MarkLat(this);
     166                                        mark.setObject(Obj.BOYLAT);
    138167                                }
    139168                        }
    140                 } else if (keys.containsKey("buoy_lateral:category") || keys.containsKey("beacon_lateral:category")) {
    141                         mark = new MarkLat(this);
    142                 } else if (keys.containsKey("buoy_cardinal:category") || keys.containsKey("beacon_cardinal:category")) {
    143                         mark = new MarkCard(this);
    144                 } else if (keys.containsKey("buoy_isolated_danger:category") || keys.containsKey("beacon_isolated_danger:category")) {
    145                         mark = new MarkIsol(this);
    146                 } else if (keys.containsKey("buoy_safe_water:category") || keys.containsKey("beacon_safe_water:category")) {
    147                         mark = new MarkSaw(this);
    148                 } else if (keys.containsKey("buoy_special_purpose:category") || keys.containsKey("beacon_special_purpose:category")) {
    149                         mark = new MarkSpec(this);
    150                 } else if (keys.containsKey("buoy_lateral:shape") || keys.containsKey("beacon_lateral:shape")) {
    151                         mark = new MarkLat(this);
    152                 } else if (keys.containsKey("buoy_cardinal:shape") || keys.containsKey("beacon_cardinal:shape")) {
    153                         mark = new MarkCard(this);
    154                 } else if (keys.containsKey("buoy_isolated_danger:shape") || keys.containsKey("beacon_isolated_danger:shape")) {
    155                         mark = new MarkIsol(this);
    156                 } else if (keys.containsKey("buoy_safe_water:shape") || keys.containsKey("beacon_safe_water:shape")) {
    157                         mark = new MarkSaw(this);
    158                 } else if (keys.containsKey("buoy_special_purpose:shape") || keys.containsKey("beacon_special_purpose:shape")) {
    159                         mark = new MarkSpec(this);
    160                 } else if (keys.containsKey("buoy_lateral:colour") || keys.containsKey("beacon_lateral:colour")) {
    161                         mark = new MarkLat(this);
    162                 } else if (keys.containsKey("buoy_cardinal:colour") || keys.containsKey("beacon_cardinal:colour")) {
    163                         mark = new MarkCard(this);
    164                 } else if (keys.containsKey("buoy_isolated_danger:colour") || keys.containsKey("beacon_isolated_danger:colour")) {
    165                         mark = new MarkIsol(this);
    166                 } else if (keys.containsKey("buoy_safe_water:colour") || keys.containsKey("beacon_safe_water:colour")) {
    167                         mark = new MarkSaw(this);
    168                 } else if (keys.containsKey("buoy_special_purpose:colour") || keys.containsKey("beacon_special_purpose:colour")) {
    169                         mark = new MarkSpec(this);
     169                } else if (keys.containsKey("buoy_lateral:category") || keys.containsKey("buoy_lateral:shape") || keys.containsKey("buoy_lateral:colour")) {
     170                        mark = new MarkLat(this);
     171                        mark.setObject(Obj.BOYLAT);
     172                } else if (keys.containsKey("beacon_lateral:category") || keys.containsKey("beacon_lateral:shape") || keys.containsKey("beacon_lateral:colour")) {
     173                        mark = new MarkLat(this);
     174                        mark.setObject(Obj.BCNLAT);
     175                } else if (keys.containsKey("buoy_cardinal:category") || keys.containsKey("buoy_cardinal:shape") || keys.containsKey("buoy_cardinal:colour")) {
     176                        mark = new MarkCard(this);
     177                        mark.setObject(Obj.BOYCAR);
     178                } else if (keys.containsKey("beacon_cardinal:category") || keys.containsKey("beacon_cardinal:shape") || keys.containsKey("beacon_cardinal:colour")) {
     179                        mark = new MarkCard(this);
     180                        mark.setObject(Obj.BCNCAR);
     181                } else if (keys.containsKey("buoy_isolated_danger:category") || keys.containsKey("buoy_isolated_danger:shape") || keys.containsKey("buoy_isolated_danger:colour")) {
     182                        mark = new MarkIsol(this);
     183                        mark.setObject(Obj.BOYISD);
     184                } else if (keys.containsKey("beacon_isolated_danger:category") || keys.containsKey("beacon_isolated_danger:shape") || keys.containsKey("beacon_isolated_danger:colour")) {
     185                        mark = new MarkIsol(this);
     186                        mark.setObject(Obj.BCNISD);
     187                } else if (keys.containsKey("buoy_safe_water:category") || keys.containsKey("buoy_safe_water:shape") || keys.containsKey("buoy_safe_water:colour")) {
     188                        mark = new MarkSaw(this);
     189                        mark.setObject(Obj.BOYSAW);
     190                } else if (keys.containsKey("beacon_safe_water:category") || keys.containsKey("beacon_safe_water:shape") || keys.containsKey("beacon_safe_water:colour")) {
     191                        mark = new MarkSaw(this);
     192                        mark.setObject(Obj.BCNSAW);
     193                } else if (keys.containsKey("buoy_special_purpose:category") || keys.containsKey("buoy_special_purpose:shape") || keys.containsKey("buoy_special_purpose:colour")) {
     194                        mark = new MarkSpec(this);
     195                        mark.setObject(Obj.BOYSPP);
     196                } else if (keys.containsKey("beacon_special_purpose:category") || keys.containsKey("beacon_special_purpose:shape") || keys.containsKey("beacon_special_purpose:colour")) {
     197                        mark = new MarkSpec(this);
     198                        mark.setObject(Obj.BCNSPP);
    170199                }
    171200
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java

    r24885 r24896  
    2020import oseam.seamarks.SeaMark.Col;
    2121import oseam.seamarks.SeaMark.Ent;
     22import oseam.seamarks.SeaMark.Shp;
    2223import oseam.seamarks.MarkLat;
    2324import oseam.seamarks.MarkSaw;
     
    3940        private ActionListener alCat = new ActionListener() {
    4041                public void actionPerformed(java.awt.event.ActionEvent e) {
     42                        Shp shp = null;
     43                        if (dlg.mark != null) shp = dlg.mark.getShape();
    4144                        if (portButton.isSelected()) {
    42                                 if (!(dlg.mark instanceof MarkLat) || (dlg.mark.getCategory() != Cat.LAT_PORT))
     45                                if (!(dlg.mark instanceof MarkLat))
    4346                                        dlg.mark = new MarkLat(dlg);
    4447                                dlg.mark.setCategory(Cat.LAT_PORT);
     48                                if (panelPort.shapes.containsKey(shp)) {
     49                                        panelPort.shapes.get(shp).doClick();
     50                                } else {
     51                                        panelPort.clearSelections();
     52                                        dlg.mark.setShape(Shp.UNKNOWN);
     53                                }
    4554                                if (dlg.mark.getRegion() == SeaMark.IALA_A) {
    4655                                        dlg.mark.setColour(Ent.BODY, Col.RED);
     
    5867                        }
    5968                        if (stbdButton.isSelected()) {
    60                                 if (!(dlg.mark instanceof MarkLat) || (dlg.mark.getCategory() != Cat.LAT_STBD))
     69                                if (!(dlg.mark instanceof MarkLat))
    6170                                        dlg.mark = new MarkLat(dlg);
    6271                                dlg.mark.setCategory(Cat.LAT_STBD);
     72                                if (panelStbd.shapes.containsKey(shp)) {
     73                                        panelStbd.shapes.get(shp).doClick();
     74                                } else {
     75                                        panelStbd.clearSelections();
     76                                        dlg.mark.setShape(Shp.UNKNOWN);
     77                                }
    6378                                if (dlg.mark.getRegion() == SeaMark.IALA_A) {
    6479                                        dlg.mark.setColour(Ent.BODY, Col.GREEN);
     
    7691                        }
    7792                        if (prefPortButton.isSelected()) {
    78                                 if (!(dlg.mark instanceof MarkLat) || (dlg.mark.getCategory() != Cat.LAT_PREF_PORT))
     93                                if (!(dlg.mark instanceof MarkLat))
    7994                                        dlg.mark = new MarkLat(dlg);
    8095                                dlg.mark.setCategory(Cat.LAT_PREF_PORT);
     96                                if (panelPort.shapes.containsKey(shp) && (shp != Shp.PERCH)) {
     97                                        panelPort.shapes.get(shp).doClick();
     98                                } else {
     99                                        panelPort.clearSelections();
     100                                        dlg.mark.setShape(Shp.UNKNOWN);
     101                                }
    81102                                if (dlg.mark.getRegion() == SeaMark.IALA_A) {
    82103                                        dlg.mark.setColour(Ent.BODY, Col.RED_GREEN_RED);
     
    94115                        }
    95116                        if (prefStbdButton.isSelected()) {
    96                                 if (!(dlg.mark instanceof MarkLat) || (dlg.mark.getCategory() != Cat.LAT_PREF_STBD))
     117                                if (!(dlg.mark instanceof MarkLat))
    97118                                        dlg.mark = new MarkLat(dlg);
    98119                                dlg.mark.setCategory(Cat.LAT_PREF_STBD);
     120                                if (panelStbd.shapes.containsKey(shp) && (shp != Shp.PERCH)) {
     121                                        panelStbd.shapes.get(shp).doClick();
     122                                } else {
     123                                        panelStbd.clearSelections();
     124                                        dlg.mark.setShape(Shp.UNKNOWN);
     125                                }
    99126                                if (dlg.mark.getRegion() == SeaMark.IALA_A) {
    100127                                        dlg.mark.setColour(Ent.BODY, Col.GREEN_RED_GREEN);
     
    112139                        }
    113140                        if (safeWaterButton.isSelected()) {
    114                                 if (!(dlg.mark instanceof MarkSaw))
     141                                if (!(dlg.mark instanceof MarkSaw)) {
    115142                                        dlg.mark = new MarkSaw(dlg);
     143                                        if (panelSaw.shapes.containsKey(shp)) {
     144                                                panelSaw.shapes.get(shp).doClick();
     145                                        } else {
     146                                                panelSaw.clearSelections();
     147                                                dlg.mark.setShape(Shp.UNKNOWN);
     148                                        }
     149                                }
    116150                                dlg.mark.setColour(Ent.BODY, Col.RED_WHITE);
    117151                                safeWaterButton.setBorderPainted(true);
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java

    r24885 r24896  
    1212
    1313        private OSeaMAction dlg;
    14         private PanelCol panelCol = null;
     14        public PanelCol panelCol = null;
    1515
    1616        public PanelLit(OSeaMAction dia) {
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java

    r24870 r24896  
    3131        public JLabel lightIcon = null;
    3232        public JLabel topIcon = null;
    33         public JLabel reflIcon = null;
    3433        public JLabel radarIcon = null;
    3534        public JLabel fogIcon = null;
     
    9594                topIcon.setBounds(new Rectangle(265, 170, 125, 185));
    9695                this.add(topIcon, null);
    97                 reflIcon = new JLabel();
    98                 reflIcon.setBounds(new Rectangle(265, 170, 125, 185));
    99                 this.add(reflIcon, null);
    10096                radarIcon = new JLabel();
    10197                radarIcon.setBounds(new Rectangle(265, 170, 130, 185));
     
    265261                lightIcon.setIcon(null);
    266262                topIcon.setIcon(null);
    267                 reflIcon.setIcon(null);
    268263                radarIcon.setIcon(null);
    269264                fogIcon.setIcon(null);
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java

    r24885 r24896  
    4040        public JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
    4141        public JRadioButton perchButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PerchPButton.png")));
    42         private EnumMap<Shp, JRadioButton> shapes = new EnumMap<Shp, JRadioButton>(Shp.class);
    43         private EnumMap<Shp, Obj> objects = new EnumMap<Shp, Obj>(Shp.class);
     42        public EnumMap<Shp, JRadioButton> shapes = new EnumMap<Shp, JRadioButton>(Shp.class);
     43        public EnumMap<Shp, Obj> objects = new EnumMap<Shp, Obj>(Shp.class);
    4444        private ActionListener alShape = new ActionListener() {
    4545                public void actionPerformed(java.awt.event.ActionEvent e) {
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSaw.java

    r24885 r24896  
    2323        private OSeaMAction dlg;
    2424        private ButtonGroup shapeButtons = new ButtonGroup();
    25         private JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
    26         private JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
    27         private JRadioButton sphereButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereButton.png")));
    28         private JRadioButton barrelButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BarrelButton.png")));
    29         private JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
    30         private EnumMap<Shp, JRadioButton> shapes = new EnumMap<Shp, JRadioButton>(Shp.class);
    31         private EnumMap<Shp, Obj> objects = new EnumMap<Shp, Obj>(Shp.class);
     25        public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
     26        public JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
     27        public JRadioButton sphereButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereButton.png")));
     28        public JRadioButton barrelButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BarrelButton.png")));
     29        public JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
     30        public EnumMap<Shp, JRadioButton> shapes = new EnumMap<Shp, JRadioButton>(Shp.class);
     31        public EnumMap<Shp, Obj> objects = new EnumMap<Shp, Obj>(Shp.class);
    3232        private ActionListener alShape = new ActionListener() {
    3333                public void actionPerformed(java.awt.event.ActionEvent e) {
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSpec.java

    r24885 r24896  
    2424        private OSeaMAction dlg;
    2525        private ButtonGroup shapeButtons = new ButtonGroup();
    26         private JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
    27         private JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
    28         private JRadioButton canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png")));
    29         private JRadioButton coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png")));
    30         private JRadioButton sphereButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereButton.png")));
    31         private JRadioButton barrelButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BarrelButton.png")));
    32         private JRadioButton superButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SuperButton.png")));
    33         private JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
    34         private JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
    35         private JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
    36         private EnumMap<Shp, JRadioButton> shapes = new EnumMap<Shp, JRadioButton>(Shp.class);
    37         private EnumMap<Shp, Obj> objects = new EnumMap<Shp, Obj>(Shp.class);
    38         private PanelCol panelCol = null;
     26        public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
     27        public JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
     28        public JRadioButton canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png")));
     29        public JRadioButton coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png")));
     30        public JRadioButton sphereButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereButton.png")));
     31        public JRadioButton barrelButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BarrelButton.png")));
     32        public JRadioButton superButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SuperButton.png")));
     33        public JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
     34        public JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
     35        public JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
     36        public EnumMap<Shp, JRadioButton> shapes = new EnumMap<Shp, JRadioButton>(Shp.class);
     37        public EnumMap<Shp, Obj> objects = new EnumMap<Shp, Obj>(Shp.class);
     38        public PanelCol panelCol = null;
    3939        private ActionListener alShape = new ActionListener() {
    4040                public void actionPerformed(java.awt.event.ActionEvent e) {
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java

    r24885 r24896  
    4040        public JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
    4141        public JRadioButton perchButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PerchSButton.png")));
    42         private EnumMap<Shp, JRadioButton> shapes = new EnumMap<Shp, JRadioButton>(Shp.class);
    43         private EnumMap<Shp, Obj> objects = new EnumMap<Shp, Obj>(Shp.class);
     42        public EnumMap<Shp, JRadioButton> shapes = new EnumMap<Shp, JRadioButton>(Shp.class);
     43        public EnumMap<Shp, Obj> objects = new EnumMap<Shp, Obj>(Shp.class);
    4444        private ActionListener alShape = new ActionListener() {
    4545                public void actionPerformed(java.awt.event.ActionEvent e) {
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkCard.java

    r24885 r24896  
    33import java.util.Map;
    44import javax.swing.ImageIcon;
    5 
    6 import org.openstreetmap.josm.Main;
    7 import org.openstreetmap.josm.command.ChangePropertyCommand;
    85
    96import oseam.dialogs.OSeaMAction;
     
    8986                } else if (keys.containsKey("seamark:type") && (keys.get("seamark:type").equals("light_float"))) {
    9087                        dlg.panelMain.panelHaz.floatButton.doClick();
     88                } else {
     89                        dlg.panelMain.panelHaz.beaconButton.doClick();
    9190                }
    9291
     
    9493                parseFogRadar(keys);
    9594
    96                 // dlg.cbM01CatOfMark.setSelectedIndex(getMarkIndex());
    97                 // dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());
    98                 // dlg.tfM01Name.setText(getName());
    99                 // dlg.cM01TopMark.setSelected(hasTopMark());
    10095        }
    10196
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkIsol.java

    r24885 r24896  
    55import javax.swing.ImageIcon;
    66
    7 import org.openstreetmap.josm.Main;
    8 import org.openstreetmap.josm.command.ChangePropertyCommand;
    9 
    107import oseam.dialogs.OSeaMAction;
    118import oseam.seamarks.SeaMark;
    12 import oseam.seamarks.SeaMark.Col;
    139
    1410public class MarkIsol extends SeaMark {
     
    5955                } else if (keys.containsKey("seamark:type") && (keys.get("seamark:type").equals("light_float"))) {
    6056                        dlg.panelMain.panelHaz.floatButton.doClick();
     57                } else {
     58                        dlg.panelMain.panelHaz.beaconButton.doClick();
    6159                }
    6260
    6361                parseLights(keys);
    6462                parseFogRadar(keys);
    65 
    66                 // dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());
    67                 // dlg.tfM01Name.setText(getName());
    68                 // dlg.cM01TopMark.setSelected(hasTopMark());
    6963        }
    7064
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLat.java

    r24885 r24896  
    55import javax.swing.ImageIcon;
    66
    7 import org.openstreetmap.josm.Main;
    8 import org.openstreetmap.josm.command.ChangePropertyCommand;
    9 
    107import oseam.dialogs.OSeaMAction;
    11 import oseam.seamarks.SeaMark.Col;
    128
    139public class MarkLat extends SeaMark {
     
    7167                }
    7268
    73                 /*
    74                  * if (cat.isEmpty()) { if (col.equals("red")) { setColour(RED); if
    75                  * (top.equals("cylinder")) { setBuoyIndex(PORT_HAND); setRegion(IALA_A); }
    76                  * else if (top.equals("cone, point up")) { setBuoyIndex(STARBOARD_HAND);
    77                  * setRegion(IALA_B); } else { if (getRegion() == IALA_A)
    78                  * setBuoyIndex(PORT_HAND); else setBuoyIndex(STARBOARD_HAND); } } else if
    79                  * (col.equals("green")) { setColour(GREEN); if
    80                  * (top.equals("cone, point up")) { setBuoyIndex(STARBOARD_HAND);
    81                  * setRegion(IALA_A); } else if (top.equals("cylinder")) {
    82                  * setBuoyIndex(PORT_HAND); setRegion(IALA_B); } else { if (getRegion() ==
    83                  * IALA_A) setBuoyIndex(STARBOARD_HAND); else setBuoyIndex(PORT_HAND); } }
    84                  * else if (col.equals("red;green;red")) { setColour(RED_GREEN_RED); if
    85                  * (top.equals("cylinder")) { setBuoyIndex(PREF_PORT_HAND);
    86                  * setRegion(IALA_A); } else if (top.equals("cone, point up")) {
    87                  * setBuoyIndex(PREF_STARBOARD_HAND); setRegion(IALA_B); } else { if
    88                  * (getRegion() == IALA_A) setBuoyIndex(PREF_PORT_HAND); else
    89                  * setBuoyIndex(PREF_STARBOARD_HAND); } } else if
    90                  * (col.equals("green;red;green")) { setColour(GREEN_RED_GREEN); if
    91                  * (top.equals("cone, point up")) { setBuoyIndex(PREF_STARBOARD_HAND);
    92                  * setRegion(IALA_A); } else if (top.equals("cylinder")) {
    93                  * setBuoyIndex(PREF_PORT_HAND); setRegion(IALA_B); } else { if (getRegion()
    94                  * == IALA_A) setBuoyIndex(PREF_STARBOARD_HAND); else
    95                  * setBuoyIndex(PREF_PORT_HAND); } } } else if (cat.equals("port")) {
    96                  *
    97                  * setBuoyIndex(PORT_HAND);
    98                  *
    99                  * if (col.equals("red")) { setRegion(IALA_A); setColour(RED); } else if
    100                  * (col.equals("green")) { setRegion(IALA_B); setColour(GREEN); } else { if
    101                  * (getRegion() == IALA_A) setColour(RED); else setColour(GREEN); } } else
    102                  * if (cat.equals("starboard")) {
    103                  *
    104                  * setBuoyIndex(STARBOARD_HAND);
    105                  *
    106                  * if (col.equals("green")) { setRegion(IALA_A); setColour(GREEN); } else if
    107                  * (col.equals("red")) { setRegion(IALA_B); setColour(RED); } else { if
    108                  * (getRegion() == IALA_A) setColour(GREEN); else setColour(RED); } } else
    109                  * if (cat.equals("preferred_channel_port")) {
    110                  *
    111                  * setBuoyIndex(PREF_PORT_HAND);
    112                  *
    113                  * if (col.equals("red;green;red")) { setRegion(IALA_A);
    114                  * setColour(RED_GREEN_RED); } else if (col.equals("green;red;green")) {
    115                  * setRegion(IALA_B); setColour(GREEN_RED_GREEN); } else { if (getRegion()
    116                  * == IALA_A) setColour(RED_GREEN_RED); else setColour(GREEN_RED_GREEN); }
    117                  *
    118                  * } else if (cat.equals("preferred_channel_starboard")) {
    119                  *
    120                  * setBuoyIndex(PREF_STARBOARD_HAND);
    121                  *
    122                  * if (col.equals("green;red;green")) { setRegion(IALA_A);
    123                  * setColour(GREEN_RED_GREEN); } else if (col.equals("red;green;red")) {
    124                  * setRegion(IALA_B); setColour(RED_GREEN_RED); } else { if (getRegion() ==
    125                  * IALA_A) setColour(GREEN_RED_GREEN); else setColour(RED_GREEN_RED); } }
    126                  *
    127                  * if (keys.containsKey("seamark:buoy_lateral:shape")) { str =
    128                  * keys.get("seamark:buoy_lateral:shape");
    129                  *
    130                  * switch (getBuoyIndex()) { case PORT_HAND: if (str.equals("can"))
    131                  * setStyleIndex(CAN); else if (str.equals("pillar")) setStyleIndex(PILLAR);
    132                  * else if (str.equals("spar")) setStyleIndex(SPAR); break;
    133                  *
    134                  * case PREF_PORT_HAND: if (str.equals("can")) setStyleIndex(CAN); else if
    135                  * (str.equals("pillar")) setStyleIndex(PILLAR); else if
    136                  * (str.equals("spar")) setStyleIndex(SPAR); break;
    137                  *
    138                  * case STARBOARD_HAND: if (str.equals("conical")) setStyleIndex(CONE); else
    139                  * if (str.equals("pillar")) setStyleIndex(PILLAR); else if
    140                  * (str.equals("spar")) setStyleIndex(SPAR); break;
    141                  *
    142                  * case PREF_STARBOARD_HAND: if (str.equals("conical")) setStyleIndex(CONE);
    143                  * else if (str.equals("pillar")) setStyleIndex(PILLAR); else if
    144                  * (str.equals("spar")) setStyleIndex(SPAR); break; } } else if
    145                  * (keys.containsKey("seamark:beacon_lateral:shape")) { str =
    146                  * keys.get("seamark:beacon_lateral:shape"); if (str.equals("tower"))
    147                  * setStyleIndex(TOWER); else if (str.equals("perch")) setStyleIndex(PERCH);
    148                  * else setStyleIndex(BEACON); } else if (keys.containsKey("seamark:type")
    149                  * && (keys.get("seamark:type").equals("beacon_lateral"))) {
    150                  * setStyleIndex(BEACON); } else if (keys.containsKey("seamark:type") &&
    151                  * (keys.get("seamark:type").equals("light_float"))) { setStyleIndex(FLOAT);
    152                  * }
    153                  *
    154                  * parseLights(keys); parseFogRadar(keys); setLightColour();
    155                  */}
     69                if (cat.isEmpty()) {
     70                        if (col.equals("red")) {
     71                                setColour(Ent.BODY, Col.RED);
     72                                if (top.equals("cylinder")) {
     73                                        dlg.panelMain.panelChan.portButton.doClick();
     74                                        dlg.panelMain.panelChan.panelPort.regionAButton.doClick();
     75                                } else if (top.equals("cone, point up")) {
     76                                        dlg.panelMain.panelChan.stbdButton.doClick();
     77                                        dlg.panelMain.panelChan.panelPort.regionBButton.doClick();
     78                                } else {
     79                                        if (getRegion() == IALA_A)
     80                                                dlg.panelMain.panelChan.portButton.doClick();
     81                                        else
     82                                                dlg.panelMain.panelChan.stbdButton.doClick();
     83                                }
     84                        } else if (col.equals("green")) {
     85                                setColour(Ent.BODY, Col.GREEN);
     86                                if (top.equals("cone, point up")) {
     87                                        dlg.panelMain.panelChan.stbdButton.doClick();
     88                                        dlg.panelMain.panelChan.panelPort.regionAButton.doClick();
     89                                } else if (top.equals("cylinder")) {
     90                                        dlg.panelMain.panelChan.portButton.doClick();
     91                                        dlg.panelMain.panelChan.panelPort.regionBButton.doClick();
     92                                } else {
     93                                        if (getRegion() == IALA_A)
     94                                                dlg.panelMain.panelChan.stbdButton.doClick();
     95                                        else
     96                                                dlg.panelMain.panelChan.portButton.doClick();
     97                                }
     98                        } else if (col.equals("red;green;red")) {
     99                                setColour(Ent.BODY, Col.RED_GREEN_RED);
     100                                if (top.equals("cylinder")) {
     101                                        dlg.panelMain.panelChan.prefPortButton.doClick();
     102                                        dlg.panelMain.panelChan.panelPort.regionAButton.doClick();
     103                                } else if (top.equals("cone, point up")) {
     104                                        dlg.panelMain.panelChan.prefStbdButton.doClick();
     105                                        dlg.panelMain.panelChan.panelPort.regionBButton.doClick();
     106                                } else {
     107                                        if (getRegion() == IALA_A)
     108                                                dlg.panelMain.panelChan.prefPortButton.doClick();
     109                                        else
     110                                                dlg.panelMain.panelChan.prefStbdButton.doClick();
     111                                }
     112                        } else if (col.equals("green;red;green")) {
     113                                setColour(Ent.BODY, Col.GREEN_RED_GREEN);
     114                                if (top.equals("cone, point up")) {
     115                                        dlg.panelMain.panelChan.prefStbdButton.doClick();
     116                                        dlg.panelMain.panelChan.panelPort.regionAButton.doClick();
     117                                } else if (top.equals("cylinder")) {
     118                                        dlg.panelMain.panelChan.prefPortButton.doClick();
     119                                        dlg.panelMain.panelChan.panelPort.regionBButton.doClick();
     120                                } else {
     121                                        if (getRegion() == IALA_A)
     122                                                dlg.panelMain.panelChan.prefStbdButton.doClick();
     123                                        else
     124                                                dlg.panelMain.panelChan.prefPortButton.doClick();
     125                                }
     126                        }
     127                } else if (cat.equals("port")) {
     128
     129                        dlg.panelMain.panelChan.portButton.doClick();
     130
     131                        if (col.equals("red")) {
     132                                dlg.panelMain.panelChan.panelPort.regionAButton.doClick();
     133                        } else if (col.equals("green")) {
     134                                dlg.panelMain.panelChan.panelPort.regionBButton.doClick();
     135                        }
     136                } else if (cat.equals("starboard")) {
     137
     138                        dlg.panelMain.panelChan.stbdButton.doClick();
     139
     140                        if (col.equals("green")) {
     141                                dlg.panelMain.panelChan.panelPort.regionAButton.doClick();
     142                        } else if (col.equals("red")) {
     143                                dlg.panelMain.panelChan.panelPort.regionBButton.doClick();
     144                        }
     145                } else if (cat.equals("preferred_channel_port")) {
     146
     147                        dlg.panelMain.panelChan.prefPortButton.doClick();
     148
     149                        if (col.equals("red;green;red")) {
     150                                dlg.panelMain.panelChan.panelPort.regionAButton.doClick();
     151                        } else if (col.equals("green;red;green")) {
     152                                dlg.panelMain.panelChan.panelPort.regionBButton.doClick();
     153                        }
     154
     155                } else if (cat.equals("preferred_channel_starboard")) {
     156
     157                        dlg.panelMain.panelChan.prefStbdButton.doClick();
     158
     159                        if (col.equals("green;red;green")) {
     160                                dlg.panelMain.panelChan.panelPort.regionAButton.doClick();
     161                        } else if (col.equals("red;green;red")) {
     162                                dlg.panelMain.panelChan.panelPort.regionBButton.doClick();
     163                        }
     164                }
     165
     166                if (keys.containsKey("seamark:buoy_lateral:shape"))
     167                        str = keys.get("seamark:buoy_lateral:shape");
     168                else if (keys.containsKey("seamark:beacon_lateral:shape"))
     169                        str = keys.get("seamark:beacon_lateral:shape");
     170                else str = "";
     171
     172                switch (getCategory()) {
     173                case LAT_PORT:
     174                case LAT_PREF_PORT:
     175                        if (str.equals("can"))
     176                                dlg.panelMain.panelChan.panelPort.canButton.doClick();
     177                        else if (str.equals("pillar"))
     178                                dlg.panelMain.panelChan.panelPort.pillarButton.doClick();
     179                        else if (str.equals("spar"))
     180                                dlg.panelMain.panelChan.panelPort.sparButton.doClick();
     181                        else if (str.equals("tower"))
     182                                setShape(Shp.TOWER);
     183                        else if (str.equals("perch"))
     184                                setShape(Shp.PERCH);
     185                        else if (keys.containsKey("seamark:type") && (keys.get("seamark:type").equals("light_float")))
     186                                dlg.panelMain.panelChan.panelPort.floatButton.doClick();
     187                        else
     188                                dlg.panelMain.panelChan.panelPort.beaconButton.doClick();
     189                        break;
     190
     191                case LAT_STBD:
     192                case LAT_PREF_STBD:
     193                        if (str.equals("conical"))
     194                                dlg.panelMain.panelChan.panelStbd.coneButton.doClick();
     195                        else if (str.equals("pillar"))
     196                                dlg.panelMain.panelChan.panelStbd.pillarButton.doClick();
     197                        else if (str.equals("spar"))
     198                                dlg.panelMain.panelChan.panelStbd.sparButton.doClick();
     199                        else if (str.equals("tower"))
     200                                setShape(Shp.TOWER);
     201                        else if (str.equals("perch"))
     202                                setShape(Shp.PERCH);
     203                        else if (keys.containsKey("seamark:type") && (keys.get("seamark:type").equals("light_float")))
     204                                dlg.panelMain.panelChan.panelStbd.floatButton.doClick();
     205                        else
     206                                dlg.panelMain.panelChan.panelStbd.beaconButton.doClick();
     207                        break;
     208                }
     209
     210                parseLights(keys);
     211                parseFogRadar(keys);
     212                setLightColour();
     213        }
    156214
    157215        public void setLightColour() {
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLight.java

    r24885 r24896  
    44
    55import javax.swing.ImageIcon;
    6 
    7 import org.openstreetmap.josm.Main;
    8 import org.openstreetmap.josm.command.ChangePropertyCommand;
    96
    107import oseam.dialogs.OSeaMAction;
     
    4138                        setName(keys.get("seamark:light_float:name"));
    4239
    43                 /*
    44                  * if (keys.containsKey("seamark:type")) { String type =
    45                  * keys.get("seamark:type"); if (type.equals("landmark"))
    46                  * setBuoyIndex(LIGHT_HOUSE); else if (type.equals("light_major"))
    47                  * setBuoyIndex(LIGHT_MAJOR); else if (type.equals("light_minor"))
    48                  * setBuoyIndex(LIGHT_MINOR); else if (type.equals("light_vessel"))
    49                  * setBuoyIndex(LIGHT_VESSEL); }
    50                  *
    51                  * parseLights(keys); parseFogRadar(keys); setTopMark(false);
    52                  * setFired(true);
    53                  *
    54                  * dlg.cbM01CatOfMark.setSelectedIndex(getBuoyIndex());
    55                  * dlg.tfM01Name.setText(getName()); dlg.cM01Fired.setEnabled(false);
    56                  * dlg.cM01Fired.setSelected(true);
    57                  */}
     40                if (keys.containsKey("seamark:type")) {
     41                        String type = keys.get("seamark:type");
     42                        if (type.equals("landmark"))
     43                                setCategory(Cat.LIGHT_HOUSE);
     44                        else if (type.equals("light_major"))
     45                                setCategory(Cat.LIGHT_MAJOR);
     46                        else if (type.equals("light_minor"))
     47                                setCategory(Cat.LIGHT_MINOR);
     48                        else if (type.equals("light_vessel"))
     49                                setCategory(Cat.LIGHT_VESSEL);
     50                        else if (type.equals("light_float"))
     51                                setCategory(Cat.LIGHT_FLOAT);
     52                }
     53
     54                parseLights(keys);
     55                parseFogRadar(keys);
     56                setFired(true);
     57        }
    5858
    5959        public void paintSign() {
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSaw.java

    r24885 r24896  
    44
    55import javax.swing.ImageIcon;
    6 
    7 import org.openstreetmap.josm.Main;
    8 import org.openstreetmap.josm.command.ChangePropertyCommand;
    96
    107import oseam.dialogs.OSeaMAction;
     
    4037                        setName(keys.get("seamark:light_float:name"));
    4138
    42                 /*
    43                  *
    44                  * setBuoyIndex(SAFE_WATER); setColour(SeaMark.RED_WHITE);
    45                  * setLightColour("W");
    46                  * setRegion(Main.pref.get("tomsplugin.IALA").equals("B"));
    47                  *
    48                  * if (keys.containsKey("seamark:buoy_safe_water:shape")) { str =
    49                  * keys.get("seamark:buoy_safe_water:shape");
    50                  *
    51                  * if (str.equals("pillar")) setStyleIndex(SAFE_PILLAR); else if
    52                  * (str.equals("spar")) setStyleIndex(SAFE_SPAR); else if
    53                  * (str.equals("sphere")) setStyleIndex(SAFE_SPHERE); } else if
    54                  * ((keys.containsKey("seamark:type")) &&
    55                  * (keys.get("seamark:type").equals("light_float"))) {
    56                  * setStyleIndex(SAFE_FLOAT); } else if ((keys.containsKey("seamark:type"))
    57                  * && (keys.get("seamark:type").equals("beacon_safe_water"))) {
    58                  * setStyleIndex(SAFE_BEACON); }
    59                  *
    60                  * if (getStyleIndex() >= dlg.cbM01StyleOfMark.getItemCount())
    61                  * setStyleIndex(0);
    62                  *
    63                  * if (keys.containsKey("seamark:topmark:shape") ||
    64                  * keys.containsKey("seamark:topmark:colour")) { setTopMark(true); }
    65                  *
    66                  * refreshLights(); parseLights(keys); parseFogRadar(keys);
    67                  *
    68                  * dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());
    69                  * dlg.tfM01Name.setText(getName());
    70                  * dlg.cM01TopMark.setSelected(hasTopMark());
    71                  */}
     39                if (keys.containsKey("seamark:buoy_safe_water:shape")) {
     40                        str = keys.get("seamark:buoy_safe_water:shape");
    7241
    73         /*
    74          * public void refreshLights() { dlg.cbM01Kennung.removeAllItems();
    75          * dlg.cbM01Kennung.addItem(Messages.getString("SmpDialogAction.212"));
    76          * dlg.cbM01Kennung.addItem("Iso"); dlg.cbM01Kennung.addItem("Oc");
    77          * dlg.cbM01Kennung.addItem("LFl"); dlg.cbM01Kennung.addItem("Mo");
    78          * dlg.cbM01Kennung.setSelectedIndex(0); }
    79          *
    80          * public void setLightColour() { super.setLightColour("W"); }
    81          */
     42                        if (str.equals("pillar"))
     43                                dlg.panelMain.panelChan.panelSaw.pillarButton.doClick();
     44                        else if (str.equals("spar"))
     45                                dlg.panelMain.panelChan.panelSaw.sparButton.doClick();
     46                        else if (str.equals("sphere"))
     47                                dlg.panelMain.panelChan.panelSaw.sphereButton.doClick();
     48                        else if (str.equals("barrel"))
     49                                dlg.panelMain.panelChan.panelSaw.barrelButton.doClick();
     50                } else if ((keys.containsKey("seamark:type")) && (keys.get("seamark:type").equals("light_float"))) {
     51                        dlg.panelMain.panelChan.panelSaw.floatButton.doClick();
     52                }
     53
     54                if (keys.containsKey("seamark:topmark:shape") || keys.containsKey("seamark:topmark:colour")) {
     55//                      setTopMark(true);
     56                }
     57
     58                parseLights(keys);
     59                parseFogRadar(keys);
     60        }
     61
    8262        public void paintSign() {
    8363
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSpec.java

    r24885 r24896  
    55import javax.swing.ImageIcon;
    66
    7 import org.openstreetmap.josm.Main;
    8 import org.openstreetmap.josm.command.ChangePropertyCommand;
    9 
    107import oseam.dialogs.OSeaMAction;
    11 import oseam.seamarks.SeaMark;
    12 import oseam.seamarks.SeaMark.Col;
    13 import oseam.seamarks.SeaMark.Ent;
    148
    159public class MarkSpec extends SeaMark {
     
    4034                        setName(keys.get("seamark:light_float:name"));
    4135
    42                 /*
    43                  * dlg.cM01TopMark.setEnabled(true);
    44                  *
    45                  * setBuoyIndex(SPECIAL_PURPOSE); setColour(SeaMark.YELLOW);
    46                  * setLightColour("W");
    47                  * setRegion(Main.pref.get("tomsplugin.IALA").equals("B"));
    48                  *
    49                  * if (keys.containsKey("seamark:buoy_special_purpose:shape")) { str =
    50                  * keys.get("seamark:buoy_special_purpose:shape");
    51                  *
    52                  * if (str.equals("pillar")) setStyleIndex(PILLAR); else if
    53                  * (str.equals("can")) setStyleIndex(CAN); else if (str.equals("conical"))
    54                  * setStyleIndex(CONE); else if (str.equals("spar")) setStyleIndex(SPAR);
    55                  * else if (str.equals("sphere")) setStyleIndex(SPHERE); else if
    56                  * (str.equals("barrel")) setStyleIndex(BARREL); }
    57                  *
    58                  * if (keys.containsKey("seamark:beacon_special_purpose:shape")) { str =
    59                  * keys.get("seamark:beacon_special_purpose:shape"); if
    60                  * (str.equals("tower")) setStyleIndex(TOWER); else setStyleIndex(BEACON); }
    61                  *
    62                  * if (keys.containsKey("seamark:light_float:colour")) {
    63                  * setStyleIndex(FLOAT); }
    64                  *
    65                  * if ((keys.containsKey("seamark:type") && keys.get("seamark:type").equals(
    66                  * "beacon_special_purpose")) ||
    67                  * keys.containsKey("seamark:beacon_special_purpose:colour") ||
    68                  * keys.containsKey("seamark:beacon_special_purpose:shape")) { if
    69                  * (keys.containsKey("seamark:beacon_special_purpose:shape") &&
    70                  * keys.get("seamark:beacon_special_purpose:shape").equals("tower"))
    71                  * setStyleIndex(TOWER); else setStyleIndex(BEACON); } else if
    72                  * (keys.containsKey("seamark:light_float:colour") &&
    73                  * keys.get("seamark:light_float:colour").equals("yellow"))
    74                  * setStyleIndex(FLOAT);
    75                  *
    76                  * if (getStyleIndex() >= dlg.cbM01StyleOfMark.getItemCount())
    77                  * setStyleIndex(0);
    78                  *
    79                  * keys = node.getKeys(); if (keys.containsKey("seamark:topmark:shape")) {
    80                  * str = keys.get("seamark:topmark:shape"); setTopMark(true); if
    81                  * (str.equals("x-shape")) { if (keys.containsKey("seamark:topmark:colour"))
    82                  * { if (keys.get("seamark:topmark:colour").equals("red"))
    83                  * setTopMarkIndex(TOP_RED_X); else setTopMarkIndex(TOP_YELLOW_X); } } else
    84                  * if (str.equals("cone, point up")) { setTopMarkIndex(TOP_YELLOW_CONE); }
    85                  * else if (str.equals("cylinder")) { setTopMarkIndex(TOP_YELLOW_CAN); } }
    86                  *
    87                  * parseLights(keys); parseFogRadar(keys);
    88                  *
    89                  * dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());
    90                  * dlg.tfM01Name.setText(getName());
    91                  * dlg.cM01TopMark.setSelected(hasTopMark());
    92                  */}
    93 
    94         public void setLightColour() {
    95                 super.setLightColour(Col.WHITE);
     36                dlg.panelMain.panelSpec.panelCol.yellowButton.doClick();
     37                dlg.panelMain.panelLit.panelCol.whiteButton.doClick();
     38
     39                if (keys.containsKey("seamark:buoy_special_purpose:shape")) {
     40                        str = keys.get("seamark:buoy_special_purpose:shape");
     41
     42                        if (str.equals("pillar"))
     43                                dlg.panelMain.panelSpec.pillarButton.doClick();
     44                        else if (str.equals("can"))
     45                                dlg.panelMain.panelSpec.canButton.doClick();
     46                        else if (str.equals("conical"))
     47                                dlg.panelMain.panelSpec.coneButton.doClick();
     48                        else if (str.equals("spar"))
     49                                dlg.panelMain.panelSpec.sparButton.doClick();
     50                        else if (str.equals("sphere"))
     51                                dlg.panelMain.panelSpec.sphereButton.doClick();
     52                        else if (str.equals("barrel"))
     53                                dlg.panelMain.panelSpec.barrelButton.doClick();
     54                }
     55
     56                if (keys.containsKey("seamark:beacon_special_purpose:shape")) {
     57                        str = keys.get("seamark:beacon_special_purpose:shape");
     58                        if (str.equals("tower"))
     59                                dlg.panelMain.panelSpec.towerButton.doClick();
     60                        else
     61                                dlg.panelMain.panelSpec.beaconButton.doClick();
     62                }
     63
     64                if (keys.containsKey("seamark:light_float:colour")) {
     65                        dlg.panelMain.panelSpec.floatButton.doClick();
     66                }
     67
     68                if ((keys.containsKey("seamark:type") && keys.get("seamark:type").equals("beacon_special_purpose"))
     69                                || keys.containsKey("seamark:beacon_special_purpose:colour") || keys.containsKey("seamark:beacon_special_purpose:shape")) {
     70                        if (keys.containsKey("seamark:beacon_special_purpose:shape")
     71                                        && keys.get("seamark:beacon_special_purpose:shape").equals("tower"))
     72                                dlg.panelMain.panelSpec.towerButton.doClick();
     73                        else
     74                                dlg.panelMain.panelSpec.beaconButton.doClick();
     75                } else if (keys.containsKey("seamark:light_float:colour") && keys.get("seamark:light_float:colour").equals("yellow"))
     76                        dlg.panelMain.panelSpec.floatButton.doClick();
     77
     78                if (keys.containsKey("seamark:topmark:shape")) {
     79                        str = keys.get("seamark:topmark:shape");
     80/*                      setTopMark(true);
     81                        if (str.equals("x-shape")) {
     82                                if (keys.containsKey("seamark:topmark:colour")) {
     83                                        if (keys.get("seamark:topmark:colour").equals("red"))
     84                                                setTopMarkIndex(TOP_RED_X);
     85                                        else
     86                                                setTopMarkIndex(TOP_YELLOW_X);
     87                                }
     88                        } else if (str.equals("cone, point up")) {
     89                                setTopMarkIndex(TOP_YELLOW_CONE);
     90                        } else if (str.equals("cylinder")) {
     91                                setTopMarkIndex(TOP_YELLOW_CAN);
     92                        }
     93*/              }
     94
     95                parseLights(keys);
     96                parseFogRadar(keys);
    9697        }
    9798
     
    133134                        image += ".png";
    134135                        dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(image)));
    135                         /*
    136                          * if (hasTopMark()) { image = ""; switch (getShape()) { case PILLAR: case
    137                          * SPAR: switch (getTopMarkIndex()) { case TOP_YELLOW_X: image =
    138                          * "/images/Top_X_Yellow_Buoy.png"; break; case TOP_RED_X: image =
    139                          * "/images/Top_X_Red_Buoy.png"; break; case TOP_YELLOW_CAN: image =
    140                          * "/images/Top_Can_Yellow_Buoy.png"; break; case TOP_YELLOW_CONE: image =
    141                          * "/images/Top_Cone_Yellow_Buoy.png"; break; } break; case CAN: case
    142                          * CONE: case SPHERE: case BARREL: switch (getTopMarkIndex()) { case
    143                          * TOP_YELLOW_X: image = "/images/Top_X_Yellow_Buoy_Small.png"; break;
    144                          * case TOP_RED_X: image = "/images/Top_X_Red_Buoy_Small.png"; break; case
    145                          * TOP_YELLOW_CAN: image = "/images/Top_Can_Yellow_Buoy_Small.png"; break;
    146                          * case TOP_YELLOW_CONE: image = "/images/Top_Cone_Yellow_Buoy_Small.png";
    147                          * break; } break; case BEACON: case TOWER: switch (getTopMarkIndex()) {
    148                          * case TOP_YELLOW_X: image = "/images/Top_X_Yellow_Beacon.png"; break;
    149                          * case TOP_RED_X: image = "/images/Top_X_Red_Beacon.png"; break; case
    150                          * TOP_YELLOW_CAN: image = "/images/Top_Can_Yellow_Beacon.png"; break;
    151                          * case TOP_YELLOW_CONE: image = "/images/Top_Cone_Yellow_Beacon.png";
    152                          * break; } break; case FLOAT: switch (getTopMarkIndex()) { case
    153                          * TOP_YELLOW_X: image = "/images/Top_X_Yellow_Float.png"; break; case
    154                          * TOP_RED_X: image = "/images/Top_X_Red_Float.png"; break; case
    155                          * TOP_YELLOW_CAN: image = "/images/Top_Can_Yellow_Float.png"; break; case
    156                          * TOP_YELLOW_CONE: image = "/images/Top_Cone_Yellow_Float.png"; break; }
    157                          * break; } if (!image.isEmpty()) dlg.lM06Icon.setIcon(new
    158                          * ImageIcon(getClass().getResource(image))); }
    159                          */
     136
     137                        if (hasTopmark()) {
     138                                image = "";
     139                                switch (getShape()) {
     140                                case PILLAR:
     141                                case SPAR:
     142                                        switch (getTopmark()) {
     143                                        case X_SHAPE:
     144                                                if (getColour(Ent.TOPMARK) == Col.YELLOW)
     145                                                        image = "/images/Top_X_Yellow_Buoy.png";
     146                                                else
     147                                                        image = "/images/Top_X_Red_Buoy.png";
     148                                                break;
     149                                        case CAN:
     150                                                image = "/images/Top_Can_Yellow_Buoy.png";
     151                                                break;
     152                                        case CONE:
     153                                                image = "/images/Top_Cone_Yellow_Buoy.png";
     154                                                break;
     155                                        }
     156                                        break;
     157                                case CAN:
     158                                case CONE:
     159                                case SPHERE:
     160                                case BARREL:
     161                                        switch (getTopmark()) {
     162                                        case X_SHAPE:
     163                                                if (getColour(Ent.TOPMARK) == Col.YELLOW)
     164                                                        image = "/images/Top_X_Yellow_Buoy_Small.png";
     165                                                else
     166                                                        image = "/images/Top_X_Red_Buoy_Small.png";
     167                                                break;
     168                                        case CAN:
     169                                                image = "/images/Top_Can_Yellow_Buoy_Small.png";
     170                                                break;
     171                                        case CONE:
     172                                                image = "/images/Top_Cone_Yellow_Buoy_Small.png";
     173                                                break;
     174                                        }
     175                                        break;
     176                                case BEACON:
     177                                case TOWER:
     178                                        switch (getTopmark()) {
     179                                        case X_SHAPE:
     180                                                if (getColour(Ent.TOPMARK) == Col.YELLOW)
     181                                                        image = "/images/Top_X_Yellow_Beacon.png";
     182                                                else
     183                                                        image = "/images/Top_X_Red_Beacon.png";
     184                                                break;
     185                                        case CAN:
     186                                                image = "/images/Top_Can_Yellow_Beacon.png";
     187                                                break;
     188                                        case CONE:
     189                                                image = "/images/Top_Cone_Yellow_Beacon.png";
     190                                                break;
     191                                        }
     192                                        break;
     193                                case FLOAT:
     194                                case SUPER:
     195                                        switch (getTopmark()) {
     196                                        case X_SHAPE:
     197                                                if (getColour(Ent.TOPMARK) == Col.YELLOW)
     198                                                        image = "/images/Top_X_Yellow_Float.png";
     199                                                else
     200                                                        image = "/images/Top_X_Red_Float.png";
     201                                                break;
     202                                        case CAN:
     203                                                image = "/images/Top_Can_Yellow_Float.png";
     204                                                break;
     205                                        case CONE:
     206                                                image = "/images/Top_Cone_Yellow_Float.png";
     207                                                break;
     208                                        }
     209                                        break;
     210                                }
     211                                if (!image.isEmpty())
     212                                        dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(image)));
     213                        }
     214
    160215                } else
    161216                        dlg.panelMain.shapeIcon.setIcon(null);
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java

    r24886 r24896  
    11package oseam.seamarks;
     2
     3import javax.swing.ImageIcon;
    24
    35import java.util.Iterator;
     
    5254
    5355        public enum Obj {
    54                 UNKNOWN, BCNCAR, BCNISD, BCNLAT, BCNSAW, BCNSPP, BOYCAR, BOYISD, BOYLAT, BOYSAW, BOYSPP, LIGHTS, LITFLT, LITVES, LNDMRK
     56                UNKNOWN, BCNCAR, BCNISD, BCNLAT, BCNSAW, BCNSPP, BOYCAR, BOYISD, BOYLAT, BOYSAW, BOYSPP, LIGHTS, LITFLT, LITVES, LNDMRK, MORFAC
    5557        }
    5658
     
    108110
    109111        public enum Cat {
    110                 UNKNOWN, LAT_PORT, LAT_STBD, LAT_PREF_PORT, LAT_PREF_STBD, CARD_NORTH, CARD_EAST, CARD_SOUTH, CARD_WEST, LIGHT_HOUSE, LIGHT_MAJOR, LIGHT_MINOR, LIGHT_VESSEL, LIGHT_FLOAT
     112                UNKNOWN, LAT_PORT, LAT_STBD, LAT_PREF_PORT, LAT_PREF_STBD, CARD_NORTH, CARD_EAST, CARD_SOUTH, CARD_WEST, LIGHT_HOUSE, LIGHT_MAJOR, LIGHT_MINOR, LIGHT_VESSEL, LIGHT_FLOAT, MOORING_BUOY
    111113        }
    112114
     
    149151                return topShape;
    150152        }
    151        
     153
    152154        public void setTopmark(Top top) {
    153155                topShape = top;
     
    547549
    548550        public void paintSign() {
    549                 /*
    550                  * dlg.lM01NameMark.setText(getName());
    551                  *
    552                  * dlg.bM01Save.setEnabled(true);
    553                  *
    554                  * dlg.cM01TopMark.setSelected(hasTopMark());
    555                  * dlg.cM01Fired.setSelected(isFired());
    556                  *
    557                  * dlg.tfM01RepeatTime.setText(getLightPeriod());
    558                  *
    559                  * dlg.tfM01Name.setText(getName()); dlg.tfM01Name.setEnabled(true);
    560                  *
    561                  * if (hasRadar()) { dlg.lM03Icon.setIcon(new
    562                  * ImageIcon(getClass().getResource( "/images/Radar_Reflector_355.png"))); }
    563                  *
    564                  * else if (hasRacon()) { dlg.lM04Icon.setIcon(new
    565                  * ImageIcon(getClass().getResource( "/images/Radar_Station.png"))); if
    566                  * (getRaType() != 0) { String c = (String)
    567                  * dlg.cbM01Racon.getSelectedItem(); if ((getRaType() == RATYPE_RACON) &&
    568                  * !getRaconGroup().isEmpty()) c += ("(" + getRaconGroup() + ")");
    569                  * dlg.lM01RadarMark.setText(c); } dlg.cbM01Racon.setVisible(true); if
    570                  * (getRaType() == RATYPE_RACON) { dlg.lM01Racon.setVisible(true);
    571                  * dlg.tfM01Racon.setVisible(true); dlg.tfM01Racon.setEnabled(true); } else
    572                  * { dlg.lM01Racon.setVisible(false); dlg.tfM01Racon.setVisible(false); } }
    573                  * else { dlg.cbM01Racon.setVisible(false); dlg.lM01Racon.setVisible(false);
    574                  * dlg.tfM01Racon.setVisible(false); }
    575                  *
    576                  * if (hasFog()) { dlg.lM05Icon.setIcon(new
    577                  * ImageIcon(getClass().getResource( "/images/Fog_Signal.png"))); if
    578                  * (getFogSound() != 0) { String c = (String)
    579                  * dlg.cbM01Fog.getSelectedItem(); if (!getFogGroup().isEmpty()) c += ("(" +
    580                  * getFogGroup() + ")"); if (!getFogPeriod().isEmpty()) c += (" " +
    581                  * getFogPeriod() + "s"); dlg.lM01FogMark.setText(c); }
    582                  * dlg.cbM01Fog.setVisible(true); if (getFogSound() == 0) {
    583                  * dlg.lM01FogGroup.setVisible(false); dlg.tfM01FogGroup.setVisible(false);
    584                  * dlg.lM01FogPeriod.setVisible(false);
    585                  * dlg.tfM01FogPeriod.setVisible(false); } else {
    586                  * dlg.lM01FogGroup.setVisible(true); dlg.tfM01FogGroup.setVisible(true);
    587                  * dlg.lM01FogPeriod.setVisible(true); dlg.tfM01FogPeriod.setVisible(true);
    588                  * } } else { dlg.cbM01Fog.setVisible(false);
    589                  * dlg.lM01FogGroup.setVisible(false); dlg.tfM01FogGroup.setVisible(false);
    590                  * dlg.lM01FogPeriod.setVisible(false);
    591                  * dlg.tfM01FogPeriod.setVisible(false); }
    592                  *
    593                  * if (isFired()) { String lp, c; String tmp = null; int i1;
    594                  *
    595                  * String col = getLightColour(); if (col.equals("W")) {
    596                  * dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource(
    597                  * "/images/Light_White_120.png")));
    598                  * dlg.cbM01Colour.setSelectedIndex(WHITE_LIGHT); } else if
    599                  * (col.equals("R")) { dlg.lM02Icon.setIcon(new
    600                  * ImageIcon(getClass().getResource( "/images/Light_Red_120.png")));
    601                  * dlg.cbM01Colour.setSelectedIndex(RED_LIGHT); } else if (col.equals("G"))
    602                  * { dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource(
    603                  * "/images/Light_Green_120.png")));
    604                  * dlg.cbM01Colour.setSelectedIndex(GREEN_LIGHT); } else {
    605                  * dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource(
    606                  * "/images/Light_Magenta_120.png")));
    607                  * dlg.cbM01Colour.setSelectedIndex(UNKNOWN_COLOUR); }
    608                  *
    609                  * c = getLightChar(); dlg.cbM01Kennung.setSelectedItem(c); if
    610                  * (c.contains("+")) { i1 = c.indexOf("+"); tmp = c.substring(i1,
    611                  * c.length()); c = c.substring(0, i1); if (!getLightGroup().isEmpty()) { c
    612                  * = c + "(" + getLightGroup() + ")"; } if (tmp != null) c = c + tmp;
    613                  * dlg.cbM01Kennung.setSelectedItem(c); } else if
    614                  * (!getLightGroup().isEmpty()) c = c + "(" + getLightGroup() + ")"; if
    615                  * (dlg.cbM01Kennung.getSelectedIndex() == 0)
    616                  * dlg.cbM01Kennung.setSelectedItem(c); c = c + " " + getLightColour(); lp =
    617                  * getLightPeriod(); if (!lp.isEmpty()) c = c + " " + lp + "s";
    618                  * dlg.lM01FireMark.setText(c); dlg.cM01Fired.setVisible(true);
    619                  * dlg.lM01Kennung.setVisible(true); dlg.cbM01Kennung.setVisible(true); if
    620                  * (((String) dlg.cbM01Kennung.getSelectedItem()).contains("(")) {
    621                  * dlg.tfM01Group.setVisible(false); dlg.lM01Group.setVisible(false); } else
    622                  * { dlg.lM01Group.setVisible(true); dlg.tfM01Group.setVisible(true); }
    623                  * dlg.tfM01Group.setText(getLightGroup());
    624                  * dlg.lM01RepeatTime.setVisible(true);
    625                  * dlg.tfM01RepeatTime.setVisible(true); if (isSectored()) {
    626                  * dlg.rbM01Fired1.setSelected(false); dlg.rbM01FiredN.setSelected(true); if
    627                  * ((getsectorIndex() != 0) && (!LightChar[0].isEmpty()))
    628                  * dlg.cbM01Kennung.setEnabled(false); else
    629                  * dlg.cbM01Kennung.setEnabled(true);
    630                  * dlg.cbM01Kennung.setSelectedItem(getLightChar()); if ((getsectorIndex()
    631                  * != 0) && (!LightGroup[0].isEmpty())) dlg.tfM01Group.setEnabled(false);
    632                  * else dlg.tfM01Group.setEnabled(true);
    633                  * dlg.tfM01Group.setText(getLightGroup()); if ((getsectorIndex() != 0) &&
    634                  * (!LightPeriod[0].isEmpty())) dlg.tfM01RepeatTime.setEnabled(false); else
    635                  * dlg.tfM01RepeatTime.setEnabled(true);
    636                  * dlg.tfM01RepeatTime.setText(getLightPeriod()); if ((getsectorIndex() !=
    637                  * 0) && (!Height[0].isEmpty())) dlg.tfM01Height.setEnabled(false); else
    638                  * dlg.tfM01Height.setEnabled(true); dlg.tfM01Height.setText(getHeight());
    639                  * if ((getsectorIndex() != 0) && (!Range[0].isEmpty()))
    640                  * dlg.tfM01Range.setEnabled(false); else dlg.tfM01Range.setEnabled(true);
    641                  * dlg.tfM01Range.setText(getRange()); dlg.lM01Sector.setVisible(true);
    642                  * dlg.cbM01Sector.setVisible(true); } else { } } else { } } else {
    643                  */}
     551/*
     552                dlg.lM01NameMark.setText(getName());
     553
     554                dlg.bM01Save.setEnabled(true);
     555
     556                dlg.cM01TopMark.setSelected(hasTopMark());
     557                dlg.cM01Fired.setSelected(isFired());
     558
     559                dlg.tfM01RepeatTime.setText(getLightPeriod());
     560
     561                dlg.tfM01Name.setText(getName());
     562                dlg.tfM01Name.setEnabled(true);
     563*/
     564                if (hasRadar()) {
     565                        dlg.panelMain.radarIcon.setIcon(new ImageIcon(getClass().getResource("/images/Radar_Reflector_355.png")));
     566                }       else if (hasRacon()) {
     567                        dlg.panelMain.radarIcon.setIcon(new ImageIcon(getClass().getResource("/images/Radar_Station.png")));
     568//                      if (getRaType() != 0) {
     569//                              String c = (String) dlg.cbM01Racon.getSelectedItem();
     570//                              if ((getRaType() == RATYPE_RACON) && !getRaconGroup().isEmpty())
     571//                                      c += ("(" + getRaconGroup() + ")");
     572//                              dlg.lM01RadarMark.setText(c);
     573//                      }
     574                }
     575
     576                if (hasFog()) {
     577                        dlg.panelMain.fogIcon.setIcon(new ImageIcon(getClass().getResource("/images/Fog_Signal.png")));
     578//                      if (getFogSound() != 0) {
     579//                              String c = (String) dlg.cbM01Fog.getSelectedItem();
     580//                              if (!getFogGroup().isEmpty())
     581//                                      c += ("(" + getFogGroup() + ")");
     582//                              if (!getFogPeriod().isEmpty())
     583//                                      c += (" " + getFogPeriod() + "s");
     584//                              dlg.lM01FogMark.setText(c);
     585//                      }
     586                }
     587
     588                if (isFired()) {
     589                        String lp, c;
     590                        String tmp = null;
     591                        int i1;
     592
     593                        Col col = getColour(Ent.LIGHT);
     594                        if (col == Col.WHITE) {
     595                                dlg.panelMain.lightIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_White_120.png")));
     596                        } else if (col == Col.RED) {
     597                                dlg.panelMain.lightIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Red_120.png")));
     598                        } else if (col == Col.GREEN) {
     599                                dlg.panelMain.lightIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Green_120.png")));
     600                        } else {
     601                                dlg.panelMain.lightIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Magenta_120.png")));
     602                        }
     603
     604/*                      c = getLightChar();
     605                        if (c.contains("+")) {
     606                                i1 = c.indexOf("+");
     607                                tmp = c.substring(i1, c.length());
     608                                c = c.substring(0, i1);
     609                                if (!getLightGroup().isEmpty()) {
     610                                        c = c + "(" + getLightGroup() + ")";
     611                                }
     612                                if (tmp != null)
     613                                        c = c + tmp;
     614                        } else if (!getLightGroup().isEmpty())
     615                                c = c + "(" + getLightGroup() + ")";
     616                        c = c + " " + getLightColour();
     617                        lp = getLightPeriod();
     618                        if (!lp.isEmpty())
     619                                c = c + " " + lp + "s";
     620*/              }
     621        }
    644622
    645623        public void saveSign() {
     
    658636                if (!name.isEmpty())
    659637                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:name", name));
    660                
     638
    661639                String objStr = "";
    662640                switch (object) {
     
    689667                        break;
    690668                case BOYSPP:
    691                         if (topShape == Top.MOORING)
    692                                 objStr = "mooring";
    693                         else
    694                                 objStr = "buoy_special_purpose";
     669                        objStr = "buoy_special_purpose";
    695670                        break;
    696671                case LIGHTS:
     
    709684                        objStr = "landmark";
    710685                        break;
     686                case MORFAC:
     687                        objStr = "mooring";
     688                        break;
    711689                }
    712690                if (!objStr.isEmpty()) {
     
    724702                                break;
    725703                        case LAT_PREF_STBD:
    726                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":category", "preferred_channel_starboard"));
     704                                Main.main.undoRedo
     705                                                .add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":category", "preferred_channel_starboard"));
    727706                                break;
    728707                        case CARD_NORTH:
     
    738717                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":category", "west"));
    739718                                break;
    740                         }
    741                         if ((object == Obj.BOYSPP) && (topShape == Top.MOORING))
    742                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:mooring:category", "mooring-buoy"));
     719                        case MOORING_BUOY:
     720                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":category", "mooring_buoy"));
     721                                break;
     722                        }
    743723
    744724                        switch (shape) {
     
    774754                                break;
    775755                        }
    776                        
     756
    777757                        switch (bodyColour) {
    778758                        case WHITE:
     
    805785                        case RED_GREEN_RED:
    806786                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "red;green;red"));
    807                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern",     "horizontal stripes"));
     787                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "horizontal stripes"));
    808788                                break;
    809789                        case GREEN_RED_GREEN:
    810790                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "green;red;green"));
    811                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern",     "horizontal stripes"));
     791                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "horizontal stripes"));
    812792                                break;
    813793                        case RED_WHITE:
    814794                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "red;white"));
    815                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern",     "vertical stripes"));
     795                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "vertical stripes"));
    816796                                break;
    817797                        case BLACK_YELLOW:
    818798                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "black;yellow"));
    819                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern",     "horizontal stripes"));
     799                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "horizontal stripes"));
    820800                                break;
    821801                        case BLACK_YELLOW_BLACK:
    822802                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "black;yellow;black"));
    823                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern",     "horizontal stripes"));
     803                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "horizontal stripes"));
    824804                                break;
    825805                        case YELLOW_BLACK:
    826806                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "yellow;black"));
    827                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern",     "horizontal stripes"));
     807                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "horizontal stripes"));
    828808                                break;
    829809                        case YELLOW_BLACK_YELLOW:
    830810                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "yellow;black;yellow"));
    831                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern",     "horizontal stripes"));
     811                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "horizontal stripes"));
    832812                                break;
    833813                        case BLACK_RED_BLACK:
    834814                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour", "black;red;black"));
    835                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern",     "horizontal stripes"));
    836                                 break;
    837                         }
    838                 }
    839                        
     815                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:" + objStr + ":colour_pattern", "horizontal stripes"));
     816                                break;
     817                        }
     818                }
     819
    840820                String top = "";
    841821                switch (topShape) {
     
    928908                        }
    929909                }
    930                
     910
    931911                Col colour;
    932912                if (isFired()) {
     
    954934                                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:" + i + ":colour", "red"));
    955935                                                if ((Bearing1[i] != null) && (Bearing2[i] != null) && (Radius[i] != null))
    956                                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:" + i, "red:" + Bearing1[i] + ":" + Bearing2[i]
    957                                                                         + ":" + Radius[i]));
     936                                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:" + i, "red:" + Bearing1[i] + ":"
     937                                                                        + Bearing2[i] + ":" + Radius[i]));
    958938                                        } else if (colour.equals("G")) {
    959939                                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light:" + i + ":colour", "green"));
Note: See TracChangeset for help on using the changeset viewer.