Ignore:
Timestamp:
2010-12-22T15:09:12+01:00 (14 years ago)
Author:
malcolmh
Message:

save

Location:
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
Files:
1 deleted
25 edited

Legend:

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

    r24545 r24839  
    55
    66public class Messages {
    7     private static final String BUNDLE_NAME = "oseam.msg.messages";
     7        private static final String BUNDLE_NAME = "oseam.msg.messages";
    88
    9     private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
    10             .getBundle(BUNDLE_NAME);
     9        private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
    1110
    12     private Messages() {
    13     }
     11        private Messages() {
     12        }
    1413
    15     public static String getString(String key) {
    16         try {
    17             return RESOURCE_BUNDLE.getString(key);
    18         } catch (MissingResourceException e) {
    19             return '!' + key + '!';
    20         }
    21     }
     14        public static String getString(String key) {
     15                try {
     16                        return RESOURCE_BUNDLE.getString(key);
     17                } catch (MissingResourceException e) {
     18                        return '!' + key + '!';
     19                }
     20        }
    2221}
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/OSeaM.java

    r24823 r24839  
    2929        @Override
    3030        public boolean stop() {
    31 //              DataSet.removeSelectionListener(oseam.SmpListener);
     31                // DataSet.removeSelectionListener(oseam.SmpListener);
    3232                return true;
    3333        }
     
    3535        @Override
    3636        public boolean hasFocus() {
    37 //              DataSet.addSelectionListener(oseam.SmpListener);
     37                // DataSet.addSelectionListener(oseam.SmpListener);
    3838                return true;
    3939        }
     
    4141        @Override
    4242        public boolean lostFocus() {
    43 //              DataSet.removeSelectionListener(oseam.SmpListener);
     43                // DataSet.removeSelectionListener(oseam.SmpListener);
    4444                return true;
    4545        }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/dialogs/OSeaMAction.java

    r24830 r24839  
    2424import oseam.seamarks.MarkLight;
    2525import oseam.seamarks.MarkSpec;
    26 import oseam.seamarks.MarkUkn;
    2726import oseam.seamarks.MarkSaw;
    2827import smed.plug.ifc.SmedPluginManager;
     
    3635        public Node node = null;
    3736        private Collection<? extends OsmPrimitive> Selection = null;
    38         private OsmPrimitive lastNode = null;
    3937
    4038        public SelectionChangedListener SmpListener = new SelectionChangedListener() {
    41                 public void selectionChanged(
    42                                 Collection<? extends OsmPrimitive> newSelection) {
     39                public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
    4340                        Node nextNode = null;
    4441                        Selection = newSelection;
     
    4946                                        nextNode = (Node) osm;
    5047                                        if (Selection.size() == 1) {
    51                                                 if (nextNode.compareTo(lastNode) != 0) {
    52                                                         lastNode = nextNode;
    53                                                         parseNode(nextNode);
     48                                                if (nextNode.compareTo(node) != 0) {
     49                                                        node = nextNode;
     50                                                        parseNode();
    5451                                                }
    5552                                        } else
     
    5855                        }
    5956                        if (nextNode == null) {
     57                                node = null;
     58                                mark = null;
    6059                                panelMain.clearSelections();
    61                                 lastNode = null;
    6260                                manager.showVisualMessage(Messages.getString("SelectNode"));
    6361                        }
     
    7371                        if (!str.isEmpty())
    7472                                str += new String(new char[] { 0x1e });
    75                         Main.pref.put("mappaint.style.sources", str
    76                                         + "http://dev.openseamap.org/josm/seamark_styles.xml");
     73                        Main.pref.put("mappaint.style.sources", str + "http://dev.openseamap.org/josm/seamark_styles.xml");
    7774                }
    7875                str = Main.pref.get("color.background");
     
    9087        }
    9188
    92         private void parseNode(Node newNode) {
     89        private void parseNode() {
    9390
    9491                Map<String, String> keys;
    9592
    9693                manager.showVisualMessage("");
    97                 node = newNode;
    9894                mark = null;
    9995                String type = "";
     
    106102                if (type.equals("buoy_lateral") || type.equals("beacon_lateral")) {
    107103                        mark = new MarkLat(this);
    108                 } else if (type.equals("buoy_cardinal")
    109                                 || type.equals("beacon_cardinal")) {
     104                } else if (type.equals("buoy_cardinal") || type.equals("beacon_cardinal")) {
    110105                        mark = new MarkCard(this);
    111                 } else if (type.equals("buoy_safe_water")
    112                                 || type.equals("beacon_safe_water")) {
     106                } else if (type.equals("buoy_safe_water") || type.equals("beacon_safe_water")) {
    113107                        mark = new MarkSaw(this);
    114                 } else if (type.equals("buoy_special_purpose")
    115                                 || type.equals("beacon_special_purpose")) {
     108                } else if (type.equals("buoy_special_purpose") || type.equals("beacon_special_purpose")) {
    116109                        mark = new MarkSpec(this);
    117                 } else if (type.equals("buoy_isolated_danger")
    118                                 || type.equals("beacon_isolated_danger")) {
     110                } else if (type.equals("buoy_isolated_danger") || type.equals("beacon_isolated_danger")) {
    119111                        mark = new MarkIsol(this);
    120                 } else if (type.equals("landmark") || type.equals("light_vessel")
    121                                 || type.equals("light_major") || type.equals("light_minor")) {
     112                } else if (type.equals("landmark") || type.equals("light_vessel") || type.equals("light_major") || type.equals("light_minor")) {
    122113                        mark = new MarkLight(this);
    123114                } else if (type.equals("light_float")) {
    124115                        if (keys.containsKey("seamark:light_float:colour")) {
    125116                                str = keys.get("seamark:light_float:colour");
    126                                 if (str.equals("red") || str.equals("green")
    127                                                 || str.equals("red;green;red")
    128                                                 || str.equals("green;red;green")) {
     117                                if (str.equals("red") || str.equals("green") || str.equals("red;green;red") || str.equals("green;red;green")) {
    129118                                        mark = new MarkLat(this);
    130                                 } else if (str.equals("black;yellow")
    131                                                 || str.equals("black;yellow;black")
    132                                                 || str.equals("yellow;black")
     119                                } else if (str.equals("black;yellow") || str.equals("black;yellow;black") || str.equals("yellow;black")
    133120                                                || str.equals("yellow;black;yellow")) {
    134121                                        mark = new MarkCard(this);
     
    151138                                }
    152139                        }
    153                 } else if (keys.containsKey("buoy_lateral:category")
    154                                 || keys.containsKey("beacon_lateral:category")) {
     140                } else if (keys.containsKey("buoy_lateral:category") || keys.containsKey("beacon_lateral:category")) {
    155141                        mark = new MarkLat(this);
    156                 } else if (keys.containsKey("buoy_cardinal:category")
    157                                 || keys.containsKey("beacon_cardinal:category")) {
     142                } else if (keys.containsKey("buoy_cardinal:category") || keys.containsKey("beacon_cardinal:category")) {
    158143                        mark = new MarkCard(this);
    159                 } else if (keys.containsKey("buoy_isolated_danger:category")
    160                                 || keys.containsKey("beacon_isolated_danger:category")) {
     144                } else if (keys.containsKey("buoy_isolated_danger:category") || keys.containsKey("beacon_isolated_danger:category")) {
    161145                        mark = new MarkIsol(this);
    162                 } else if (keys.containsKey("buoy_safe_water:category")
    163                                 || keys.containsKey("beacon_safe_water:category")) {
     146                } else if (keys.containsKey("buoy_safe_water:category") || keys.containsKey("beacon_safe_water:category")) {
    164147                        mark = new MarkSaw(this);
    165                 } else if (keys.containsKey("buoy_special_purpose:category")
    166                                 || keys.containsKey("beacon_special_purpose:category")) {
     148                } else if (keys.containsKey("buoy_special_purpose:category") || keys.containsKey("beacon_special_purpose:category")) {
    167149                        mark = new MarkSpec(this);
    168                 } else if (keys.containsKey("buoy_lateral:shape")
    169                                 || keys.containsKey("beacon_lateral:shape")) {
     150                } else if (keys.containsKey("buoy_lateral:shape") || keys.containsKey("beacon_lateral:shape")) {
    170151                        mark = new MarkLat(this);
    171                 } else if (keys.containsKey("buoy_cardinal:shape")
    172                                 || keys.containsKey("beacon_cardinal:shape")) {
     152                } else if (keys.containsKey("buoy_cardinal:shape") || keys.containsKey("beacon_cardinal:shape")) {
    173153                        mark = new MarkCard(this);
    174                 } else if (keys.containsKey("buoy_isolated_danger:shape")
    175                                 || keys.containsKey("beacon_isolated_danger:shape")) {
     154                } else if (keys.containsKey("buoy_isolated_danger:shape") || keys.containsKey("beacon_isolated_danger:shape")) {
    176155                        mark = new MarkIsol(this);
    177                 } else if (keys.containsKey("buoy_safe_water:shape")
    178                                 || keys.containsKey("beacon_safe_water:shape")) {
     156                } else if (keys.containsKey("buoy_safe_water:shape") || keys.containsKey("beacon_safe_water:shape")) {
    179157                        mark = new MarkSaw(this);
    180                 } else if (keys.containsKey("buoy_special_purpose:shape")
    181                                 || keys.containsKey("beacon_special_purpose:shape")) {
     158                } else if (keys.containsKey("buoy_special_purpose:shape") || keys.containsKey("beacon_special_purpose:shape")) {
    182159                        mark = new MarkSpec(this);
    183                 } else if (keys.containsKey("buoy_lateral:colour")
    184                                 || keys.containsKey("beacon_lateral:colour")) {
     160                } else if (keys.containsKey("buoy_lateral:colour") || keys.containsKey("beacon_lateral:colour")) {
    185161                        mark = new MarkLat(this);
    186                 } else if (keys.containsKey("buoy_cardinal:colour")
    187                                 || keys.containsKey("beacon_cardinal:colour")) {
     162                } else if (keys.containsKey("buoy_cardinal:colour") || keys.containsKey("beacon_cardinal:colour")) {
    188163                        mark = new MarkCard(this);
    189                 } else if (keys.containsKey("buoy_isolated_danger:colour")
    190                                 || keys.containsKey("beacon_isolated_danger:colour")) {
     164                } else if (keys.containsKey("buoy_isolated_danger:colour") || keys.containsKey("beacon_isolated_danger:colour")) {
    191165                        mark = new MarkIsol(this);
    192                 } else if (keys.containsKey("buoy_safe_water:colour")
    193                                 || keys.containsKey("beacon_safe_water:colour")) {
     166                } else if (keys.containsKey("buoy_safe_water:colour") || keys.containsKey("beacon_safe_water:colour")) {
    194167                        mark = new MarkSaw(this);
    195                 } else if (keys.containsKey("buoy_special_purpose:colour")
    196                                 || keys.containsKey("beacon_special_purpose:colour")) {
     168                } else if (keys.containsKey("buoy_special_purpose:colour") || keys.containsKey("beacon_special_purpose:colour")) {
    197169                        mark = new MarkSpec(this);
    198170                }
     
    200172                if (mark == null) {
    201173                        manager.showVisualMessage(Messages.getString("NoMark"));
    202                         mark = new MarkUkn(this);
     174                        panelMain.clearSelections();
    203175                } else {
    204176                        mark.parseMark();
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java

    r24835 r24839  
    7979                        public void actionPerformed(java.awt.event.ActionEvent e) {
    8080                                if (portButton.isSelected()) {
    81                                         if (!(dlg.mark instanceof MarkLat)
    82                                                         || (dlg.mark.getCategory() != Cat.LAT_PORT))
     81                                        if (!(dlg.mark instanceof MarkLat) || (dlg.mark.getCategory() != Cat.LAT_PORT))
    8382                                                dlg.mark = new MarkLat(dlg);
    8483                                        dlg.mark.setCategory(Cat.LAT_PORT);
     
    9897                                }
    9998                                if (stbdButton.isSelected()) {
    100                                         if (!(dlg.mark instanceof MarkLat)
    101                                                         || (dlg.mark.getCategory() != Cat.LAT_STBD))
     99                                        if (!(dlg.mark instanceof MarkLat) || (dlg.mark.getCategory() != Cat.LAT_STBD))
    102100                                                dlg.mark = new MarkLat(dlg);
    103101                                        dlg.mark.setCategory(Cat.LAT_STBD);
     
    117115                                }
    118116                                if (prefPortButton.isSelected()) {
    119                                         if (!(dlg.mark instanceof MarkLat)
    120                                                         || (dlg.mark.getCategory() != Cat.LAT_PREF_PORT))
     117                                        if (!(dlg.mark instanceof MarkLat) || (dlg.mark.getCategory() != Cat.LAT_PREF_PORT))
    121118                                                dlg.mark = new MarkLat(dlg);
    122119                                        dlg.mark.setCategory(Cat.LAT_PREF_PORT);
     
    136133                                }
    137134                                if (prefStbdButton.isSelected()) {
    138                                         if (!(dlg.mark instanceof MarkLat)
    139                                                         || (dlg.mark.getCategory() != Cat.LAT_PREF_STBD))
     135                                        if (!(dlg.mark instanceof MarkLat) || (dlg.mark.getCategory() != Cat.LAT_PREF_STBD))
    140136                                                dlg.mark = new MarkLat(dlg);
    141137                                        dlg.mark.setCategory(Cat.LAT_PREF_STBD);
     
    188184        private JRadioButton getPortButton() {
    189185                if (portButton == null) {
    190                         portButton = new JRadioButton(new ImageIcon(getClass().getResource(
    191                                         "/images/PortButton.png")));
     186                        portButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PortButton.png")));
    192187                        portButton.setBounds(new Rectangle(0, 0, 52, 32));
    193                         portButton.setBorder(BorderFactory.createLineBorder(Color.magenta,
    194                                         2));
     188                        portButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    195189                        portButton.setToolTipText(Messages.getString("PortTip"));
    196190                }
     
    200194        private JRadioButton getStbdButton() {
    201195                if (stbdButton == null) {
    202                         stbdButton = new JRadioButton(new ImageIcon(getClass().getResource(
    203                                         "/images/StbdButton.png")));
     196                        stbdButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/StbdButton.png")));
    204197                        stbdButton.setBounds(new Rectangle(0, 32, 52, 32));
    205                         stbdButton.setBorder(BorderFactory.createLineBorder(Color.magenta,
    206                                         2));
     198                        stbdButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    207199                        stbdButton.setToolTipText(Messages.getString("StbdTip"));
    208200                }
     
    212204        private JRadioButton getPrefPortButton() {
    213205                if (prefPortButton == null) {
    214                         prefPortButton = new JRadioButton(new ImageIcon(getClass()
    215                                         .getResource("/images/PrefPortButton.png")));
     206                        prefPortButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PrefPortButton.png")));
    216207                        prefPortButton.setBounds(new Rectangle(0, 64, 52, 32));
    217                         prefPortButton.setBorder(BorderFactory.createLineBorder(
    218                                         Color.magenta, 2));
     208                        prefPortButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    219209                        prefPortButton.setToolTipText(Messages.getString("PrefPortTip"));
    220210                }
     
    224214        private JRadioButton getPrefStbdButton() {
    225215                if (prefStbdButton == null) {
    226                         prefStbdButton = new JRadioButton(new ImageIcon(getClass()
    227                                         .getResource("/images/PrefStbdButton.png")));
     216                        prefStbdButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PrefStbdButton.png")));
    228217                        prefStbdButton.setBounds(new Rectangle(0, 96, 52, 32));
    229                         prefStbdButton.setBorder(BorderFactory.createLineBorder(
    230                                         Color.magenta, 2));
     218                        prefStbdButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    231219                        prefStbdButton.setToolTipText(Messages.getString("PrefStbdTip"));
    232220                }
     
    236224        private JRadioButton getSafeWaterButton() {
    237225                if (safeWaterButton == null) {
    238                         safeWaterButton = new JRadioButton(new ImageIcon(getClass()
    239                                         .getResource("/images/SafeWaterButton.png")));
     226                        safeWaterButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SafeWaterButton.png")));
    240227                        safeWaterButton.setBounds(new Rectangle(0, 128, 52, 32));
    241                         safeWaterButton.setBorder(BorderFactory.createLineBorder(
    242                                         Color.magenta, 2));
     228                        safeWaterButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    243229                        safeWaterButton.setToolTipText(Messages.getString("SafeWaterTip"));
    244230                }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelCol.java

    r24830 r24839  
    9191        private JRadioButton getOffButton() {
    9292                if (offButton == null) {
    93                         offButton = new JRadioButton(new ImageIcon(getClass()
    94                                         .getResource("/images/OffButton.png")));
     93                        offButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png")));
    9594                        offButton.setBounds(new Rectangle(0, 0, 34, 16));
    96                 offButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     95                        offButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    9796                        offButton.setToolTipText(tr("No colour"));
    9897                }
     
    102101        private JRadioButton getWhiteButton() {
    103102                if (whiteButton == null) {
    104                         whiteButton = new JRadioButton(new ImageIcon(getClass()
    105                                         .getResource("/images/WhiteButton.png")));
     103                        whiteButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/WhiteButton.png")));
    106104                        whiteButton.setBounds(new Rectangle(0, 16, 34, 16));
    107                 whiteButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     105                        whiteButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    108106                        whiteButton.setToolTipText(tr("White"));
    109107                }
     
    113111        private JRadioButton getRedButton() {
    114112                if (redButton == null) {
    115                         redButton = new JRadioButton(new ImageIcon(getClass().getResource(
    116                                         "/images/RedButton.png")));
     113                        redButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RedButton.png")));
    117114                        redButton.setBounds(new Rectangle(0, 32, 34, 16));
    118                 redButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     115                        redButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    119116                        redButton.setToolTipText(tr("Red"));
    120117                }
     
    124121        private JRadioButton getOrangeButton() {
    125122                if (orangeButton == null) {
    126                         orangeButton = new JRadioButton(new ImageIcon(getClass()
    127                                         .getResource("/images/OrangeButton.png")));
     123                        orangeButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OrangeButton.png")));
    128124                        orangeButton.setBounds(new Rectangle(0, 48, 34, 16));
    129                 orangeButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     125                        orangeButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    130126                        orangeButton.setToolTipText(tr("Orange"));
    131127                }
     
    135131        private JRadioButton getAmberButton() {
    136132                if (amberButton == null) {
    137                         amberButton = new JRadioButton(new ImageIcon(getClass()
    138                                         .getResource("/images/AmberButton.png")));
     133                        amberButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/AmberButton.png")));
    139134                        amberButton.setBounds(new Rectangle(0, 64, 34, 16));
    140                 amberButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     135                        amberButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    141136                        amberButton.setToolTipText(tr("Amber"));
    142137                }
     
    146141        private JRadioButton getYellowButton() {
    147142                if (yellowButton == null) {
    148                         yellowButton = new JRadioButton(new ImageIcon(getClass()
    149                                         .getResource("/images/YellowButton.png")));
     143                        yellowButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/YellowButton.png")));
    150144                        yellowButton.setBounds(new Rectangle(0, 80, 34, 16));
    151                 yellowButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     145                        yellowButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    152146                        yellowButton.setToolTipText(tr("Yellow"));
    153147                }
     
    157151        private JRadioButton getGreenButton() {
    158152                if (greenButton == null) {
    159                         greenButton = new JRadioButton(new ImageIcon(getClass()
    160                                         .getResource("/images/GreenButton.png")));
     153                        greenButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/GreenButton.png")));
    161154                        greenButton.setBounds(new Rectangle(0, 96, 34, 16));
    162                 greenButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     155                        greenButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    163156                        greenButton.setToolTipText(tr("Green"));
    164157                }
     
    168161        private JRadioButton getBlueButton() {
    169162                if (blueButton == null) {
    170                         blueButton = new JRadioButton(new ImageIcon(getClass().getResource(
    171                                         "/images/BlueButton.png")));
     163                        blueButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BlueButton.png")));
    172164                        blueButton.setBounds(new Rectangle(0, 112, 34, 16));
    173                 blueButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     165                        blueButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    174166                        blueButton.setToolTipText(tr("Blue"));
    175167                }
     
    179171        private JRadioButton getVioletButton() {
    180172                if (violetButton == null) {
    181                         violetButton = new JRadioButton(new ImageIcon(getClass()
    182                                         .getResource("/images/VioletButton.png")));
     173                        violetButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/VioletButton.png")));
    183174                        violetButton.setBounds(new Rectangle(0, 128, 34, 16));
    184                 violetButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     175                        violetButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    185176                        violetButton.setToolTipText(tr("Violet"));
    186177                }
     
    190181        private JRadioButton getBlackButton() {
    191182                if (blackButton == null) {
    192                         blackButton = new JRadioButton(new ImageIcon(getClass()
    193                                         .getResource("/images/BlackButton.png")));
     183                        blackButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BlackButton.png")));
    194184                        blackButton.setBounds(new Rectangle(0, 144, 34, 16));
    195                 blackButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     185                        blackButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    196186                        blackButton.setToolTipText(tr("Black"));
    197187                }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelFog.java

    r24830 r24839  
    3232
    3333        public void clearSelections() {
    34                
     34
    3535        }
    3636
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java

    r24830 r24839  
    110110                                        isolButton.setBorderPainted(false);
    111111                                }
    112                                 if (dlg.mark != null) dlg.mark.paintSign();
     112                                if (dlg.mark != null)
     113                                        dlg.mark.paintSign();
    113114                        }
    114115                };
     
    133134                        public void actionPerformed(java.awt.event.ActionEvent e) {
    134135                                if (pillarButton.isSelected()) {
    135                                 pillarButton.setBorderPainted(true);
    136                                 dlg.mark.setShape(Shp.PILLAR);
     136                                        pillarButton.setBorderPainted(true);
     137                                        dlg.mark.setShape(Shp.PILLAR);
    137138                                } else {
    138139                                        pillarButton.setBorderPainted(false);
    139140                                }
    140141                                if (sparButton.isSelected()) {
    141                                 sparButton.setBorderPainted(true);
    142                                 dlg.mark.setShape(Shp.SPAR);
     142                                        sparButton.setBorderPainted(true);
     143                                        dlg.mark.setShape(Shp.SPAR);
    143144                                } else {
    144145                                        sparButton.setBorderPainted(false);
    145146                                }
    146147                                if (floatButton.isSelected()) {
    147                                 floatButton.setBorderPainted(true);
    148                                 dlg.mark.setShape(Shp.FLOAT);
     148                                        floatButton.setBorderPainted(true);
     149                                        dlg.mark.setShape(Shp.FLOAT);
    149150                                } else {
    150151                                        floatButton.setBorderPainted(false);
    151152                                }
    152153                                if (beaconButton.isSelected()) {
    153                                 beaconButton.setBorderPainted(true);
    154                                 dlg.mark.setShape(Shp.BEACON);
     154                                        beaconButton.setBorderPainted(true);
     155                                        dlg.mark.setShape(Shp.BEACON);
    155156                                } else {
    156157                                        beaconButton.setBorderPainted(false);
    157158                                }
    158159                                if (towerButton.isSelected()) {
    159                                 towerButton.setBorderPainted(true);
    160                                 dlg.mark.setShape(Shp.TOWER);
     160                                        towerButton.setBorderPainted(true);
     161                                        dlg.mark.setShape(Shp.TOWER);
    161162                                } else {
    162163                                        towerButton.setBorderPainted(false);
     
    180181        private JRadioButton getNothButton() {
    181182                if (northButton == null) {
    182                         northButton = new JRadioButton(new ImageIcon(getClass()
    183                                         .getResource("/images/CardNButton.png")));
     183                        northButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardNButton.png")));
    184184                        northButton.setBounds(new Rectangle(0, 0, 52, 32));
    185                 northButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     185                        northButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    186186                        northButton.setToolTipText(Messages.getString("NorthTip"));
    187187                }
     
    191191        private JRadioButton getSouthButton() {
    192192                if (southButton == null) {
    193                         southButton = new JRadioButton(new ImageIcon(getClass()
    194                                         .getResource("/images/CardSButton.png")));
     193                        southButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardSButton.png")));
    195194                        southButton.setBounds(new Rectangle(0, 32, 52, 32));
    196                 southButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     195                        southButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    197196                        southButton.setToolTipText(Messages.getString("SouthTip"));
    198197                }
     
    202201        private JRadioButton getEastButton() {
    203202                if (eastButton == null) {
    204                         eastButton = new JRadioButton(new ImageIcon(getClass().getResource(
    205                                         "/images/CardEButton.png")));
     203                        eastButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardEButton.png")));
    206204                        eastButton.setBounds(new Rectangle(0, 64, 52, 32));
    207                 eastButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     205                        eastButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    208206                        eastButton.setToolTipText(Messages.getString("EastTip"));
    209207                }
     
    213211        private JRadioButton getWestButton() {
    214212                if (westButton == null) {
    215                         westButton = new JRadioButton(new ImageIcon(getClass().getResource(
    216                                         "/images/CardWButton.png")));
     213                        westButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardWButton.png")));
    217214                        westButton.setBounds(new Rectangle(0, 96, 52, 32));
    218                 westButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     215                        westButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    219216                        westButton.setToolTipText(Messages.getString("WestTip"));
    220217                }
     
    224221        private JRadioButton getIsolButton() {
    225222                if (isolButton == null) {
    226                         isolButton = new JRadioButton(new ImageIcon(getClass().getResource(
    227                                         "/images/IsolButton.png")));
     223                        isolButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/IsolButton.png")));
    228224                        isolButton.setBounds(new Rectangle(0, 128, 52, 32));
    229                 isolButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     225                        isolButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    230226                        isolButton.setToolTipText(Messages.getString("IsolTip"));
    231227                }
     
    235231        private JRadioButton getPillarButton() {
    236232                if (pillarButton == null) {
    237                         pillarButton = new JRadioButton(new ImageIcon(getClass()
    238                                         .getResource("/images/PillarButton.png")));
     233                        pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
    239234                        pillarButton.setBounds(new Rectangle(55, 0, 34, 32));
    240                 pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     235                        pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    241236                        pillarButton.setToolTipText(Messages.getString("PillarTip"));
    242237                }
     
    246241        private JRadioButton getSparButton() {
    247242                if (sparButton == null) {
    248                         sparButton = new JRadioButton(new ImageIcon(getClass().getResource(
    249                                         "/images/SparButton.png")));
     243                        sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
    250244                        sparButton.setBounds(new Rectangle(55, 32, 34, 32));
    251                 sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     245                        sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    252246                        sparButton.setToolTipText(Messages.getString("SparTip"));
    253247                }
     
    257251        private JRadioButton getFloatButton() {
    258252                if (floatButton == null) {
    259                         floatButton = new JRadioButton(new ImageIcon(getClass()
    260                                         .getResource("/images/FloatButton.png")));
     253                        floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
    261254                        floatButton.setBounds(new Rectangle(55, 64, 34, 32));
    262                 floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     255                        floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    263256                        floatButton.setToolTipText(Messages.getString("FloatTip"));
    264257                }
     
    268261        private JRadioButton getBeaconButton() {
    269262                if (beaconButton == null) {
    270                         beaconButton = new JRadioButton(new ImageIcon(getClass()
    271                                         .getResource("/images/BeaconButton.png")));
     263                        beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
    272264                        beaconButton.setBounds(new Rectangle(55, 96, 34, 32));
    273                 beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     265                        beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    274266                        beaconButton.setToolTipText(Messages.getString("BeaconTip"));
    275267                }
     
    279271        private JRadioButton getTowerButton() {
    280272                if (towerButton == null) {
    281                         towerButton = new JRadioButton(new ImageIcon(getClass()
    282                                         .getResource("/images/TowerButton.png")));
     273                        towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
    283274                        towerButton.setBounds(new Rectangle(55, 128, 34, 32));
    284                 towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     275                        towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    285276                        towerButton.setToolTipText(Messages.getString("TowerTip"));
    286277                }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLights.java

    r24830 r24839  
    5454                                vesselButton.setBorderPainted(vesselButton.isSelected());
    5555                                floatButton.setBorderPainted(floatButton.isSelected());
    56                                 if (dlg.mark != null) dlg.mark.paintSign();
     56                                if (dlg.mark != null)
     57                                        dlg.mark.paintSign();
    5758                        }
    5859                };
     
    6566
    6667        public void clearSelections() {
    67                
     68
    6869        }
    6970
    7071        private JRadioButton getHouseButton() {
    7172                if (houseButton == null) {
    72                         houseButton = new JRadioButton(new ImageIcon(getClass()
    73                                         .getResource("/images/LighthouseButton.png")));
     73                        houseButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LighthouseButton.png")));
    7474                        houseButton.setBounds(new Rectangle(0, 0, 34, 32));
    75                 houseButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     75                        houseButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    7676                        houseButton.setToolTipText(Messages.getString("LighthouseTip"));
    7777                }
     
    8181        private JRadioButton getMajorButton() {
    8282                if (majorButton == null) {
    83                         majorButton = new JRadioButton(new ImageIcon(getClass()
    84                                         .getResource("/images/LightMajorButton.png")));
     83                        majorButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightMajorButton.png")));
    8584                        majorButton.setBounds(new Rectangle(0, 32, 34, 32));
    86                 majorButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     85                        majorButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    8786                        majorButton.setToolTipText(Messages.getString("MajorLightTip"));
    8887                }
     
    9291        private JRadioButton getMinorButton() {
    9392                if (minorButton == null) {
    94                         minorButton = new JRadioButton(new ImageIcon(getClass()
    95                                         .getResource("/images/LightMinorButton.png")));
     93                        minorButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightMinorButton.png")));
    9694                        minorButton.setBounds(new Rectangle(0, 64, 34, 32));
    97                 minorButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     95                        minorButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    9896                        minorButton.setToolTipText(Messages.getString("MinorLightTip"));
    9997                }
     
    103101        private JRadioButton getVesselButton() {
    104102                if (vesselButton == null) {
    105                         vesselButton = new JRadioButton(new ImageIcon(getClass()
    106                                         .getResource("/images/LightVesselButton.png")));
     103                        vesselButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightVesselButton.png")));
    107104                        vesselButton.setBounds(new Rectangle(0, 96, 34, 32));
    108                 vesselButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     105                        vesselButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    109106                        vesselButton.setToolTipText(Messages.getString("LightVesselTip"));
    110107                }
     
    114111        private JRadioButton getFloatButton() {
    115112                if (floatButton == null) {
    116                         floatButton = new JRadioButton(new ImageIcon(getClass()
    117                                         .getResource("/images/LightFloatButton.png")));
     113                        floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightFloatButton.png")));
    118114                        floatButton.setBounds(new Rectangle(0, 128, 34, 32));
    119                 floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     115                        floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    120116                        floatButton.setToolTipText(Messages.getString("LightFloatTip"));
    121117                }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java

    r24830 r24839  
    3737
    3838        public void clearSelections() {
    39                
     39
    4040        }
    4141
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java

    r24835 r24839  
    1818import oseam.Messages;
    1919import oseam.dialogs.OSeaMAction;
     20import oseam.seamarks.MarkLat;
     21import oseam.seamarks.MarkSaw;
     22import oseam.seamarks.MarkCard;
     23import oseam.seamarks.MarkIsol;
    2024import oseam.seamarks.MarkSpec;
    2125import oseam.seamarks.MarkLight;
     26import oseam.seamarks.SeaMark.Cat;
    2227
    2328public class PanelMain extends JPanel {
     
    120125                alType = new ActionListener() {
    121126                        public void actionPerformed(java.awt.event.ActionEvent e) {
    122                                 if (dlg.mark == null) {
     127                                if (dlg.node == null) {
    123128                                        typeButtons.clearSelection();
    124                                         return;
    125129                                }
    126130                                if (chanButton.isSelected()) {
     131                                        if (!((dlg.mark instanceof MarkLat) || (dlg.mark instanceof MarkSaw))) {
     132                                                dlg.mark = null;
     133                                                clearIcons();
     134                                        }
    127135                                        chanButton.setBorderPainted(true);
    128136                                        panelChan.setVisible(true);
     
    133141                                }
    134142                                if (hazButton.isSelected()) {
     143                                        if (!((dlg.mark instanceof MarkCard) || (dlg.mark instanceof MarkIsol))) {
     144                                                dlg.mark = null;
     145                                                clearIcons();
     146                                        }
    135147                                        hazButton.setBorderPainted(true);
    136148                                        panelHaz.setVisible(true);
     
    141153                                }
    142154                                if (specButton.isSelected()) {
    143                                         if (!(dlg.mark instanceof MarkSpec))
     155                                        if (!(dlg.mark instanceof MarkSpec)) {
    144156                                                dlg.mark = new MarkSpec(dlg);
     157                                                clearIcons();
     158                                        }
    145159                                        specButton.setBorderPainted(true);
    146160                                        panelSpec.setVisible(true);
     
    151165                                }
    152166                                if (lightsButton.isSelected()) {
    153                                         if (!(dlg.mark instanceof MarkLight))
     167                                        if (!(dlg.mark instanceof MarkLight)) {
    154168                                                dlg.mark = new MarkLight(dlg);
     169                                                clearIcons();
     170                                        }
    155171                                        lightsButton.setBorderPainted(true);
    156172                                        panelLights.setVisible(true);
     
    235251                miscButtons.clearSelection();
    236252                alMisc.actionPerformed(null);
    237                 shapeIcon.setIcon(null);
    238                 lightIcon.setIcon(null);
    239                 topIcon.setIcon(null);
    240                 reflIcon.setIcon(null);
    241                 radarIcon.setIcon(null);
    242                 fogIcon.setIcon(null);
    243253                panelChan.clearSelections();
    244254                panelHaz.clearSelections();
     
    249259                panelRadar.clearSelections();
    250260                panelLit.clearSelections();
     261                clearIcons();
     262        }
     263
     264        public void clearIcons() {
     265                shapeIcon.setIcon(null);
     266                lightIcon.setIcon(null);
     267                topIcon.setIcon(null);
     268                reflIcon.setIcon(null);
     269                radarIcon.setIcon(null);
     270                fogIcon.setIcon(null);
    251271        }
    252272
    253273        private JRadioButton getChanButton() {
    254274                if (chanButton == null) {
    255                         chanButton = new JRadioButton(new ImageIcon(getClass().getResource(
    256                                         "/images/ChanButton.png")));
     275                        chanButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ChanButton.png")));
    257276                        chanButton.setBounds(new Rectangle(0, 0, 62, 40));
    258                         chanButton.setBorder(BorderFactory.createLineBorder(Color.magenta,
    259                                         2));
     277                        chanButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    260278                        chanButton.setToolTipText(Messages.getString("ChanTip"));
    261279                }
     
    265283        private JRadioButton getHazButton() {
    266284                if (hazButton == null) {
    267                         hazButton = new JRadioButton(new ImageIcon(getClass().getResource(
    268                                         "/images/HazButton.png")));
     285                        hazButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/HazButton.png")));
    269286                        hazButton.setBounds(new Rectangle(0, 40, 62, 40));
    270                         hazButton.setBorder(BorderFactory
    271                                         .createLineBorder(Color.magenta, 2));
     287                        hazButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    272288                        hazButton.setToolTipText(Messages.getString("HazTip"));
    273289                }
     
    277293        private JRadioButton getSpecButton() {
    278294                if (specButton == null) {
    279                         specButton = new JRadioButton(new ImageIcon(getClass().getResource(
    280                                         "/images/SpecButton.png")));
     295                        specButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SpecButton.png")));
    281296                        specButton.setBounds(new Rectangle(0, 80, 62, 40));
    282                         specButton.setBorder(BorderFactory.createLineBorder(Color.magenta,
    283                                         2));
     297                        specButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    284298                        specButton.setToolTipText(Messages.getString("SpecTip"));
    285299                }
     
    289303        private JRadioButton getLightsButton() {
    290304                if (lightsButton == null) {
    291                         lightsButton = new JRadioButton(new ImageIcon(getClass()
    292                                         .getResource("/images/LightsButton.png")));
     305                        lightsButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightsButton.png")));
    293306                        lightsButton.setBounds(new Rectangle(0, 120, 62, 40));
    294                         lightsButton.setBorder(BorderFactory.createLineBorder(
    295                                         Color.magenta, 2));
     307                        lightsButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    296308                        lightsButton.setToolTipText(Messages.getString("LightsTip"));
    297309                }
     
    301313        private JRadioButton getTopButton() {
    302314                if (topButton == null) {
    303                         topButton = new JRadioButton(new ImageIcon(getClass().getResource(
    304                                         "/images/TopButton.png")));
     315                        topButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TopButton.png")));
    305316                        topButton.setBounds(new Rectangle(0, 165, 34, 32));
    306                         topButton.setBorder(BorderFactory
    307                                         .createLineBorder(Color.magenta, 2));
     317                        topButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    308318                        topButton.setToolTipText(Messages.getString("TopmarksTip"));
    309319                }
     
    313323        private JRadioButton getFogButton() {
    314324                if (fogButton == null) {
    315                         fogButton = new JRadioButton(new ImageIcon(getClass().getResource(
    316                                         "/images/FogButton.png")));
     325                        fogButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogButton.png")));
    317326                        fogButton.setBounds(new Rectangle(0, 205, 34, 32));
    318                         fogButton.setBorder(BorderFactory
    319                                         .createLineBorder(Color.magenta, 2));
     327                        fogButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    320328                        fogButton.setToolTipText(Messages.getString("FogSignalsTip"));
    321329                }
     
    325333        private JRadioButton getRadarButton() {
    326334                if (radarButton == null) {
    327                         radarButton = new JRadioButton(new ImageIcon(getClass()
    328                                         .getResource("/images/RadarButton.png")));
     335                        radarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RadarButton.png")));
    329336                        radarButton.setBounds(new Rectangle(0, 245, 34, 32));
    330                         radarButton.setBorder(BorderFactory.createLineBorder(Color.magenta,
    331                                         2));
     337                        radarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    332338                        radarButton.setToolTipText(Messages.getString("RadarTip"));
    333339                }
     
    337343        private JRadioButton getLitButton() {
    338344                if (litButton == null) {
    339                         litButton = new JRadioButton(new ImageIcon(getClass().getResource(
    340                                         "/images/LitButton.png")));
     345                        litButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LitButton.png")));
    341346                        litButton.setBounds(new Rectangle(0, 285, 34, 32));
    342                         litButton.setBorder(BorderFactory
    343                                         .createLineBorder(Color.magenta, 2));
     347                        litButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    344348                        litButton.setToolTipText(Messages.getString("LitTip"));
    345349                }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java

    r24835 r24839  
    139139        private JRadioButton getRegionAButton() {
    140140                if (regionAButton == null) {
    141                         regionAButton = new JRadioButton(new ImageIcon(getClass()
    142                                         .getResource("/images/RegionAButton.png")));
     141                        regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png")));
    143142                        regionAButton.setBounds(new Rectangle(0, 2, 34, 30));
    144                 regionAButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     143                        regionAButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    145144                        regionAButton.setToolTipText(Messages.getString("RegionATip"));
    146145                }
     
    150149        private JRadioButton getRegionBButton() {
    151150                if (regionBButton == null) {
    152                         regionBButton = new JRadioButton(new ImageIcon(getClass()
    153                                         .getResource("/images/RegionBButton.png")));
     151                        regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png")));
    154152                        regionBButton.setBounds(new Rectangle(0, 32, 34, 30));
    155                 regionBButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     153                        regionBButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    156154                        regionBButton.setToolTipText(Messages.getString("RegionBTip"));
    157155                }
     
    161159        private JRadioButton getPillarButton() {
    162160                if (pillarButton == null) {
    163                         pillarButton = new JRadioButton(new ImageIcon(getClass()
    164                                         .getResource("/images/PillarButton.png")));
     161                        pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
    165162                        pillarButton.setBounds(new Rectangle(0, 64, 34, 32));
    166                 pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     163                        pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    167164                        pillarButton.setToolTipText(Messages.getString("PillarTip"));
    168165                }
     
    172169        private JRadioButton getSparButton() {
    173170                if (sparButton == null) {
    174                         sparButton = new JRadioButton(new ImageIcon(getClass().getResource(
    175                                         "/images/SparButton.png")));
     171                        sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
    176172                        sparButton.setBounds(new Rectangle(0, 96, 34, 32));
    177                 sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     173                        sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    178174                        sparButton.setToolTipText(Messages.getString("SparTip"));
    179175                }
     
    183179        private JRadioButton getCanButton() {
    184180                if (canButton == null) {
    185                         canButton = new JRadioButton(new ImageIcon(getClass().getResource(
    186                                         "/images/CanButton.png")));
     181                        canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png")));
    187182                        canButton.setBounds(new Rectangle(0, 128, 34, 32));
    188                 canButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     183                        canButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    189184                        canButton.setToolTipText(Messages.getString("CanTip"));
    190185                }
     
    194189        private JRadioButton getFloatButton() {
    195190                if (floatButton == null) {
    196                         floatButton = new JRadioButton(new ImageIcon(getClass()
    197                                         .getResource("/images/FloatButton.png")));
     191                        floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
    198192                        floatButton.setBounds(new Rectangle(35, 0, 34, 32));
    199                 floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     193                        floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    200194                        floatButton.setToolTipText(Messages.getString("FloatTip"));
    201195                }
     
    205199        private JRadioButton getBeaconButton() {
    206200                if (beaconButton == null) {
    207                         beaconButton = new JRadioButton(new ImageIcon(getClass()
    208                                         .getResource("/images/BeaconButton.png")));
     201                        beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
    209202                        beaconButton.setBounds(new Rectangle(35, 32, 34, 32));
    210                 beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     203                        beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    211204                        beaconButton.setToolTipText(Messages.getString("BeaconTip"));
    212205                }
     
    216209        private JRadioButton getTowerButton() {
    217210                if (towerButton == null) {
    218                         towerButton = new JRadioButton(new ImageIcon(getClass()
    219                                         .getResource("/images/TowerButton.png")));
     211                        towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
    220212                        towerButton.setBounds(new Rectangle(35, 64, 34, 32));
    221                 towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     213                        towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    222214                        towerButton.setToolTipText(Messages.getString("TowerTip"));
    223215                }
     
    227219        private JRadioButton getPerchButton() {
    228220                if (perchButton == null) {
    229                         perchButton = new JRadioButton(new ImageIcon(getClass()
    230                                         .getResource("/images/PerchPButton.png")));
     221                        perchButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PerchPButton.png")));
    231222                        perchButton.setBounds(new Rectangle(35, 96, 34, 32));
    232                 perchButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     223                        perchButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    233224                        perchButton.setToolTipText(Messages.getString("PerchTip"));
    234225                }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPrefPort.java

    r24835 r24839  
    128128        private JRadioButton getRegionAButton() {
    129129                if (regionAButton == null) {
    130                         regionAButton = new JRadioButton(new ImageIcon(getClass()
    131                                         .getResource("/images/RegionAButton.png")));
     130                        regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png")));
    132131                        regionAButton.setBounds(new Rectangle(0, 2, 34, 30));
    133                 regionAButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     132                        regionAButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    134133                        regionAButton.setToolTipText(Messages.getString("RegionATip"));
    135134                }
     
    139138        private JRadioButton getRegionBButton() {
    140139                if (regionBButton == null) {
    141                         regionBButton = new JRadioButton(new ImageIcon(getClass()
    142                                         .getResource("/images/RegionBButton.png")));
     140                        regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png")));
    143141                        regionBButton.setBounds(new Rectangle(0, 32, 34, 30));
    144                 regionBButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     142                        regionBButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    145143                        regionBButton.setToolTipText(Messages.getString("RegionBTip"));
    146144                }
     
    150148        private JRadioButton getPillarButton() {
    151149                if (pillarButton == null) {
    152                         pillarButton = new JRadioButton(new ImageIcon(getClass()
    153                                         .getResource("/images/PillarButton.png")));
     150                        pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
    154151                        pillarButton.setBounds(new Rectangle(0, 64, 34, 32));
    155                 pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     152                        pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    156153                        pillarButton.setToolTipText(Messages.getString("PillarTip"));
    157154                }
     
    161158        private JRadioButton getSparButton() {
    162159                if (sparButton == null) {
    163                         sparButton = new JRadioButton(new ImageIcon(getClass().getResource(
    164                                         "/images/SparButton.png")));
     160                        sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
    165161                        sparButton.setBounds(new Rectangle(0, 96, 34, 32));
    166                 sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     162                        sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    167163                        sparButton.setToolTipText(Messages.getString("SparTip"));
    168164                }
     
    172168        private JRadioButton getCanButton() {
    173169                if (canButton == null) {
    174                         canButton = new JRadioButton(new ImageIcon(getClass().getResource(
    175                                         "/images/CanButton.png")));
     170                        canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png")));
    176171                        canButton.setBounds(new Rectangle(0, 128, 34, 32));
    177                 canButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     172                        canButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    178173                        canButton.setToolTipText(Messages.getString("CanTip"));
    179174                }
     
    183178        private JRadioButton getFloatButton() {
    184179                if (floatButton == null) {
    185                         floatButton = new JRadioButton(new ImageIcon(getClass()
    186                                         .getResource("/images/FloatButton.png")));
     180                        floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
    187181                        floatButton.setBounds(new Rectangle(35, 0, 34, 32));
    188                 floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     182                        floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    189183                        floatButton.setToolTipText(Messages.getString("FloatTip"));
    190184                }
     
    194188        private JRadioButton getBeaconButton() {
    195189                if (beaconButton == null) {
    196                         beaconButton = new JRadioButton(new ImageIcon(getClass()
    197                                         .getResource("/images/BeaconButton.png")));
     190                        beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
    198191                        beaconButton.setBounds(new Rectangle(35, 32, 34, 32));
    199                 beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     192                        beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    200193                        beaconButton.setToolTipText(Messages.getString("BeaconTip"));
    201194                }
     
    205198        private JRadioButton getTowerButton() {
    206199                if (towerButton == null) {
    207                         towerButton = new JRadioButton(new ImageIcon(getClass()
    208                                         .getResource("/images/TowerButton.png")));
     200                        towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
    209201                        towerButton.setBounds(new Rectangle(35, 64, 34, 32));
    210                 towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     202                        towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    211203                        towerButton.setToolTipText(Messages.getString("TowerTip"));
    212204                }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPrefStbd.java

    r24835 r24839  
    128128        private JRadioButton getRegionAButton() {
    129129                if (regionAButton == null) {
    130                         regionAButton = new JRadioButton(new ImageIcon(getClass()
    131                                         .getResource("/images/RegionAButton.png")));
     130                        regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png")));
    132131                        regionAButton.setBounds(new Rectangle(0, 2, 34, 30));
    133                 regionAButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     132                        regionAButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    134133                        regionAButton.setToolTipText(Messages.getString("RegionATip"));
    135134                }
     
    139138        private JRadioButton getRegionBButton() {
    140139                if (regionBButton == null) {
    141                         regionBButton = new JRadioButton(new ImageIcon(getClass()
    142                                         .getResource("/images/RegionBButton.png")));
     140                        regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png")));
    143141                        regionBButton.setBounds(new Rectangle(0, 32, 34, 30));
    144                 regionBButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     142                        regionBButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    145143                        regionBButton.setToolTipText(Messages.getString("RegionBTip"));
    146144                }
     
    150148        private JRadioButton getPillarButton() {
    151149                if (pillarButton == null) {
    152                         pillarButton = new JRadioButton(new ImageIcon(getClass()
    153                                         .getResource("/images/PillarButton.png")));
     150                        pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
    154151                        pillarButton.setBounds(new Rectangle(0, 64, 34, 32));
    155                 pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     152                        pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    156153                        pillarButton.setToolTipText(Messages.getString("PillarTip"));
    157154                }
     
    161158        private JRadioButton getSparButton() {
    162159                if (sparButton == null) {
    163                         sparButton = new JRadioButton(new ImageIcon(getClass().getResource(
    164                                         "/images/SparButton.png")));
     160                        sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
    165161                        sparButton.setBounds(new Rectangle(0, 96, 34, 32));
    166                 sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     162                        sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    167163                        sparButton.setToolTipText(Messages.getString("SparTip"));
    168164                }
     
    172168        private JRadioButton getConeButton() {
    173169                if (coneButton == null) {
    174                         coneButton = new JRadioButton(new ImageIcon(getClass().getResource(
    175                                         "/images/ConeButton.png")));
     170                        coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png")));
    176171                        coneButton.setBounds(new Rectangle(0, 128, 34, 32));
    177                 coneButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     172                        coneButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    178173                        coneButton.setToolTipText(Messages.getString("ConeTip"));
    179174                }
     
    183178        private JRadioButton getFloatButton() {
    184179                if (floatButton == null) {
    185                         floatButton = new JRadioButton(new ImageIcon(getClass()
    186                                         .getResource("/images/FloatButton.png")));
     180                        floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
    187181                        floatButton.setBounds(new Rectangle(35, 0, 34, 32));
    188                 floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     182                        floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    189183                        floatButton.setToolTipText(Messages.getString("FloatTip"));
    190184                }
     
    194188        private JRadioButton getBeaconButton() {
    195189                if (beaconButton == null) {
    196                         beaconButton = new JRadioButton(new ImageIcon(getClass()
    197                                         .getResource("/images/BeaconButton.png")));
     190                        beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
    198191                        beaconButton.setBounds(new Rectangle(35, 32, 34, 32));
    199                 beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     192                        beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    200193                        beaconButton.setToolTipText(Messages.getString("BeaconTip"));
    201194                }
     
    205198        private JRadioButton getTowerButton() {
    206199                if (towerButton == null) {
    207                         towerButton = new JRadioButton(new ImageIcon(getClass()
    208                                         .getResource("/images/TowerButton.png")));
     200                        towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
    209201                        towerButton.setBounds(new Rectangle(35, 64, 34, 32));
    210                 towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     202                        towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    211203                        towerButton.setToolTipText(Messages.getString("TowerTip"));
    212204                }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelRadar.java

    r24830 r24839  
    3232
    3333        public void clearSelections() {
    34                
     34
    3535        }
    3636
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSafeWater.java

    r24835 r24839  
    100100        private JRadioButton getPillarButton() {
    101101                if (pillarButton == null) {
    102                         pillarButton = new JRadioButton(new ImageIcon(getClass()
    103                                         .getResource("/images/PillarButton.png")));
     102                        pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
    104103                        pillarButton.setBounds(new Rectangle(0, 0, 34, 32));
    105                 pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     104                        pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    106105                        pillarButton.setToolTipText(Messages.getString("PillarTip"));
    107106                }
     
    111110        private JRadioButton getSparButton() {
    112111                if (sparButton == null) {
    113                         sparButton = new JRadioButton(new ImageIcon(getClass().getResource(
    114                                         "/images/SparButton.png")));
     112                        sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
    115113                        sparButton.setBounds(new Rectangle(0, 32, 34, 32));
    116                 sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     114                        sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    117115                        sparButton.setToolTipText(Messages.getString("SparTip"));
    118116                }
     
    122120        private JRadioButton getSphereButton() {
    123121                if (sphereButton == null) {
    124                         sphereButton = new JRadioButton(new ImageIcon(getClass()
    125                                         .getResource("/images/SphereButton.png")));
     122                        sphereButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereButton.png")));
    126123                        sphereButton.setBounds(new Rectangle(0, 64, 34, 32));
    127                 sphereButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     124                        sphereButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    128125                        sphereButton.setToolTipText(Messages.getString("SphereTip"));
    129126                }
     
    133130        private JRadioButton getBarrelButton() {
    134131                if (barrelButton == null) {
    135                         barrelButton = new JRadioButton(new ImageIcon(getClass()
    136                                         .getResource("/images/BarrelButton.png")));
     132                        barrelButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BarrelButton.png")));
    137133                        barrelButton.setBounds(new Rectangle(0, 96, 34, 32));
    138                 barrelButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     134                        barrelButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    139135                        barrelButton.setToolTipText(Messages.getString("BarrelTip"));
    140136                }
     
    144140        private JRadioButton getFloatButton() {
    145141                if (floatButton == null) {
    146                         floatButton = new JRadioButton(new ImageIcon(getClass()
    147                                         .getResource("/images/FloatButton.png")));
     142                        floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
    148143                        floatButton.setBounds(new Rectangle(0, 128, 34, 32));
    149                 floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     144                        floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    150145                        floatButton.setToolTipText(Messages.getString("FloatTip"));
    151146                }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSpec.java

    r24830 r24839  
    8181                                beaconButton.setBorderPainted(beaconButton.isSelected());
    8282                                towerButton.setBorderPainted(towerButton.isSelected());
    83                                 if (dlg.mark != null) dlg.mark.paintSign();
     83                                if (dlg.mark != null)
     84                                        dlg.mark.paintSign();
    8485                        }
    8586                };
     
    9899
    99100        public void clearSelections() {
    100                
     101
    101102        }
    102103
    103104        private JRadioButton getPillarButton() {
    104105                if (pillarButton == null) {
    105                         pillarButton = new JRadioButton(new ImageIcon(getClass()
    106                                         .getResource("/images/PillarButton.png")));
     106                        pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
    107107                        pillarButton.setBounds(new Rectangle(55, 0, 34, 32));
    108                 pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     108                        pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    109109                        pillarButton.setToolTipText(Messages.getString("PillarTip"));
    110110                }
     
    114114        private JRadioButton getSparButton() {
    115115                if (sparButton == null) {
    116                         sparButton = new JRadioButton(new ImageIcon(getClass().getResource(
    117                                         "/images/SparButton.png")));
     116                        sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
    118117                        sparButton.setBounds(new Rectangle(55, 32, 34, 32));
    119                 sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     118                        sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    120119                        sparButton.setToolTipText(Messages.getString("SparTip"));
    121120                }
     
    125124        private JRadioButton getCanButton() {
    126125                if (canButton == null) {
    127                         canButton = new JRadioButton(new ImageIcon(getClass().getResource(
    128                                         "/images/CanButton.png")));
     126                        canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png")));
    129127                        canButton.setBounds(new Rectangle(55, 64, 34, 32));
    130                 canButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     128                        canButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    131129                        canButton.setToolTipText(Messages.getString("CanTip"));
    132130                }
     
    136134        private JRadioButton getConeButton() {
    137135                if (coneButton == null) {
    138                         coneButton = new JRadioButton(new ImageIcon(getClass().getResource(
    139                                         "/images/ConeButton.png")));
     136                        coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png")));
    140137                        coneButton.setBounds(new Rectangle(55, 96, 34, 32));
    141                 coneButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     138                        coneButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    142139                        coneButton.setToolTipText(Messages.getString("ConeTip"));
    143140                }
     
    147144        private JRadioButton getSphereButton() {
    148145                if (sphereButton == null) {
    149                         sphereButton = new JRadioButton(new ImageIcon(getClass()
    150                                         .getResource("/images/SphereButton.png")));
     146                        sphereButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereButton.png")));
    151147                        sphereButton.setBounds(new Rectangle(55, 128, 34, 32));
    152                 sphereButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     148                        sphereButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    153149                        sphereButton.setToolTipText(Messages.getString("SphereTip"));
    154150                }
     
    158154        private JRadioButton getBarrelButton() {
    159155                if (barrelButton == null) {
    160                         barrelButton = new JRadioButton(new ImageIcon(getClass()
    161                                         .getResource("/images/BarrelButton.png")));
     156                        barrelButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BarrelButton.png")));
    162157                        barrelButton.setBounds(new Rectangle(90, 0, 34, 32));
    163                 barrelButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     158                        barrelButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    164159                        barrelButton.setToolTipText(Messages.getString("BarrelTip"));
    165160                }
     
    169164        private JRadioButton getSuperButton() {
    170165                if (superButton == null) {
    171                         superButton = new JRadioButton(new ImageIcon(getClass()
    172                                         .getResource("/images/SuperButton.png")));
     166                        superButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SuperButton.png")));
    173167                        superButton.setBounds(new Rectangle(90, 32, 34, 32));
    174                 superButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     168                        superButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    175169                        superButton.setToolTipText(Messages.getString("SuperTip"));
    176170                }
     
    180174        private JRadioButton getFloatButton() {
    181175                if (floatButton == null) {
    182                         floatButton = new JRadioButton(new ImageIcon(getClass()
    183                                         .getResource("/images/FloatButton.png")));
     176                        floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
    184177                        floatButton.setBounds(new Rectangle(90, 64, 34, 32));
    185                 floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     178                        floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    186179                        floatButton.setToolTipText(Messages.getString("FloatTip"));
    187180                }
     
    191184        private JRadioButton getBeaconButton() {
    192185                if (beaconButton == null) {
    193                         beaconButton = new JRadioButton(new ImageIcon(getClass()
    194                                         .getResource("/images/BeaconButton.png")));
     186                        beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
    195187                        beaconButton.setBounds(new Rectangle(90, 96, 34, 32));
    196                 beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     188                        beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    197189                        beaconButton.setToolTipText(Messages.getString("BeaconTip"));
    198190                }
     
    202194        private JRadioButton getTowerButton() {
    203195                if (towerButton == null) {
    204                         towerButton = new JRadioButton(new ImageIcon(getClass()
    205                                         .getResource("/images/TowerButton.png")));
     196                        towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
    206197                        towerButton.setBounds(new Rectangle(90, 128, 34, 32));
    207                 towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     198                        towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    208199                        towerButton.setToolTipText(Messages.getString("TowerTip"));
    209200                }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java

    r24835 r24839  
    138138        private JRadioButton getRegionAButton() {
    139139                if (regionAButton == null) {
    140                         regionAButton = new JRadioButton(new ImageIcon(getClass()
    141                                         .getResource("/images/RegionAButton.png")));
     140                        regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png")));
    142141                        regionAButton.setBounds(new Rectangle(0, 2, 34, 30));
    143                 regionAButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     142                        regionAButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    144143                        regionAButton.setToolTipText(Messages.getString("RegionATip"));
    145144                }
     
    149148        private JRadioButton getRegionBButton() {
    150149                if (regionBButton == null) {
    151                         regionBButton = new JRadioButton(new ImageIcon(getClass()
    152                                         .getResource("/images/RegionBButton.png")));
     150                        regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png")));
    153151                        regionBButton.setBounds(new Rectangle(0, 32, 34, 30));
    154                 regionBButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     152                        regionBButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    155153                        regionBButton.setToolTipText(Messages.getString("RegionBTip"));
    156154                }
     
    160158        private JRadioButton getPillarButton() {
    161159                if (pillarButton == null) {
    162                         pillarButton = new JRadioButton(new ImageIcon(getClass()
    163                                         .getResource("/images/PillarButton.png")));
     160                        pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
    164161                        pillarButton.setBounds(new Rectangle(0, 64, 34, 32));
    165                 pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     162                        pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    166163                        pillarButton.setToolTipText(Messages.getString("PillarTip"));
    167164                }
     
    171168        private JRadioButton getSparButton() {
    172169                if (sparButton == null) {
    173                         sparButton = new JRadioButton(new ImageIcon(getClass().getResource(
    174                                         "/images/SparButton.png")));
     170                        sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
    175171                        sparButton.setBounds(new Rectangle(0, 96, 34, 32));
    176                 sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     172                        sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    177173                        sparButton.setToolTipText(Messages.getString("SparTip"));
    178174                }
     
    182178        private JRadioButton getConeButton() {
    183179                if (coneButton == null) {
    184                         coneButton = new JRadioButton(new ImageIcon(getClass().getResource(
    185                                         "/images/ConeButton.png")));
     180                        coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png")));
    186181                        coneButton.setBounds(new Rectangle(0, 128, 34, 32));
    187                 coneButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     182                        coneButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    188183                        coneButton.setToolTipText(Messages.getString("ConeTip"));
    189184                }
     
    193188        private JRadioButton getFloatButton() {
    194189                if (floatButton == null) {
    195                         floatButton = new JRadioButton(new ImageIcon(getClass()
    196                                         .getResource("/images/FloatButton.png")));
     190                        floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
    197191                        floatButton.setBounds(new Rectangle(35, 0, 34, 32));
    198                 floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     192                        floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    199193                        floatButton.setToolTipText(Messages.getString("FloatTip"));
    200194                }
     
    204198        private JRadioButton getBeaconButton() {
    205199                if (beaconButton == null) {
    206                         beaconButton = new JRadioButton(new ImageIcon(getClass()
    207                                         .getResource("/images/BeaconButton.png")));
     200                        beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
    208201                        beaconButton.setBounds(new Rectangle(35, 32, 34, 32));
    209                 beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     202                        beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    210203                        beaconButton.setToolTipText(Messages.getString("BeaconTip"));
    211204                }
     
    215208        private JRadioButton getTowerButton() {
    216209                if (towerButton == null) {
    217                         towerButton = new JRadioButton(new ImageIcon(getClass()
    218                                         .getResource("/images/TowerButton.png")));
     210                        towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
    219211                        towerButton.setBounds(new Rectangle(35, 64, 34, 32));
    220                 towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     212                        towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    221213                        towerButton.setToolTipText(Messages.getString("TowerTip"));
    222214                }
     
    226218        private JRadioButton getPerchButton() {
    227219                if (perchButton == null) {
    228                         perchButton = new JRadioButton(new ImageIcon(getClass()
    229                                         .getResource("/images/PerchSButton.png")));
     220                        perchButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PerchSButton.png")));
    230221                        perchButton.setBounds(new Rectangle(35, 96, 34, 32));
    231                 perchButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     222                        perchButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    232223                        perchButton.setToolTipText(Messages.getString("PerchTip"));
    233224                }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelTop.java

    r24830 r24839  
    132132        private JRadioButton getNoTopButton() {
    133133                if (noTopButton == null) {
    134                         noTopButton = new JRadioButton(new ImageIcon(getClass()
    135                                         .getResource("/images/NoTopButton.png")));
     134                        noTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/NoTopButton.png")));
    136135                        noTopButton.setBounds(new Rectangle(40, 5, 27, 27));
    137                 noTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     136                        noTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    138137                        noTopButton.setToolTipText(Messages.getString("NoTopTip"));
    139138                }
     
    143142        private JRadioButton getCanTopButton() {
    144143                if (canTopButton == null) {
    145                         canTopButton = new JRadioButton(new ImageIcon(getClass()
    146                                         .getResource("/images/CanTopButton.png")));
     144                        canTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanTopButton.png")));
    147145                        canTopButton.setBounds(new Rectangle(70, 5, 27, 27));
    148                 canTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     146                        canTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    149147                        canTopButton.setToolTipText(Messages.getString("CanTopTip"));
    150148                }
     
    154152        private JRadioButton getConeTopButton() {
    155153                if (coneTopButton == null) {
    156                         coneTopButton = new JRadioButton(new ImageIcon(getClass()
    157                                         .getResource("/images/ConeTopButton.png")));
     154                        coneTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeTopButton.png")));
    158155                        coneTopButton.setBounds(new Rectangle(100, 5, 27, 27));
    159156                        coneTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     
    165162        private JRadioButton getSphereTopButton() {
    166163                if (sphereTopButton == null) {
    167                         sphereTopButton = new JRadioButton(new ImageIcon(getClass()
    168                                         .getResource("/images/SphereTopButton.png")));
     164                        sphereTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereTopButton.png")));
    169165                        sphereTopButton.setBounds(new Rectangle(130, 5, 27, 27));
    170166                        sphereTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     
    176172        private JRadioButton getXTopButton() {
    177173                if (XTopButton == null) {
    178                         XTopButton = new JRadioButton(new ImageIcon(getClass()
    179                                         .getResource("/images/XTopButton.png")));
     174                        XTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/XTopButton.png")));
    180175                        XTopButton.setBounds(new Rectangle(160, 5, 27, 27));
    181176                        XTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     
    187182        private JRadioButton getNorthTopButton() {
    188183                if (northTopButton == null) {
    189                         northTopButton = new JRadioButton(new ImageIcon(getClass()
    190                                         .getResource("/images/NorthTopButton.png")));
     184                        northTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/NorthTopButton.png")));
    191185                        northTopButton.setBounds(new Rectangle(40, 35, 27, 27));
    192                 northTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     186                        northTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    193187                        northTopButton.setToolTipText(Messages.getString("NorthTopTip"));
    194188                }
     
    198192        private JRadioButton getSouthTopButton() {
    199193                if (southTopButton == null) {
    200                         southTopButton = new JRadioButton(new ImageIcon(getClass()
    201                                         .getResource("/images/SouthTopButton.png")));
     194                        southTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SouthTopButton.png")));
    202195                        southTopButton.setBounds(new Rectangle(70, 35, 27, 27));
    203                 southTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     196                        southTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    204197                        southTopButton.setToolTipText(Messages.getString("SouthTopTip"));
    205198                }
     
    209202        private JRadioButton getEastTopButton() {
    210203                if (eastTopButton == null) {
    211                         eastTopButton = new JRadioButton(new ImageIcon(getClass()
    212                                         .getResource("/images/EastTopButton.png")));
     204                        eastTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/EastTopButton.png")));
    213205                        eastTopButton.setBounds(new Rectangle(100, 35, 27, 27));
    214206                        eastTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     
    220212        private JRadioButton getWestTopButton() {
    221213                if (westTopButton == null) {
    222                         westTopButton = new JRadioButton(new ImageIcon(getClass()
    223                                         .getResource("/images/WestTopButton.png")));
     214                        westTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/WestTopButton.png")));
    224215                        westTopButton.setBounds(new Rectangle(130, 35, 27, 27));
    225216                        westTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     
    231222        private JRadioButton getSpheres2TopButton() {
    232223                if (spheres2TopButton == null) {
    233                         spheres2TopButton = new JRadioButton(new ImageIcon(getClass()
    234                                         .getResource("/images/Spheres2TopButton.png")));
     224                        spheres2TopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/Spheres2TopButton.png")));
    235225                        spheres2TopButton.setBounds(new Rectangle(160, 35, 27, 27));
    236226                        spheres2TopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     
    242232        private JRadioButton getBoardDayButton() {
    243233                if (boardDayButton == null) {
    244                         boardDayButton = new JRadioButton(new ImageIcon(getClass()
    245                                         .getResource("/images/BoardDayButton.png")));
     234                        boardDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BoardDayButton.png")));
    246235                        boardDayButton.setBounds(new Rectangle(40, 65, 27, 27));
    247236                        boardDayButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     
    253242        private JRadioButton getDiamondDayButton() {
    254243                if (diamondDayButton == null) {
    255                         diamondDayButton = new JRadioButton(new ImageIcon(getClass()
    256                                         .getResource("/images/DiamondDayButton.png")));
     244                        diamondDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/DiamondDayButton.png")));
    257245                        diamondDayButton.setBounds(new Rectangle(70, 65, 27, 27));
    258246                        diamondDayButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     
    264252        private JRadioButton getTriangleDayButton() {
    265253                if (triangleDayButton == null) {
    266                         triangleDayButton = new JRadioButton(new ImageIcon(getClass()
    267                                         .getResource("/images/TriangleDayButton.png")));
     254                        triangleDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TriangleDayButton.png")));
    268255                        triangleDayButton.setBounds(new Rectangle(100, 65, 27, 27));
    269256                        triangleDayButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     
    275262        private JRadioButton getTriangleInvDayButton() {
    276263                if (triangleInvDayButton == null) {
    277                         triangleInvDayButton = new JRadioButton(new ImageIcon(getClass()
    278                                         .getResource("/images/TriangleInvDayButton.png")));
     264                        triangleInvDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TriangleInvDayButton.png")));
    279265                        triangleInvDayButton.setBounds(new Rectangle(130, 65, 27, 27));
    280266                        triangleInvDayButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     
    286272        private JRadioButton getSquareDayButton() {
    287273                if (squareDayButton == null) {
    288                         squareDayButton = new JRadioButton(new ImageIcon(getClass()
    289                                         .getResource("/images/SquareDayButton.png")));
     274                        squareDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SquareDayButton.png")));
    290275                        squareDayButton.setBounds(new Rectangle(160, 65, 27, 27));
    291276                        squareDayButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     
    297282        private JRadioButton getMooringTopButton() {
    298283                if (mooringTopButton == null) {
    299                         mooringTopButton = new JRadioButton(new ImageIcon(getClass()
    300                                         .getResource("/images/MooringTopButton.png")));
     284                        mooringTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/MooringTopButton.png")));
    301285                        mooringTopButton.setBounds(new Rectangle(40, 95, 27, 27));
    302286                        mooringTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkCard.java

    r24830 r24839  
    1515                super(dia);
    1616        }
    17        
     17
    1818        public void parseMark() {
    1919                String str;
     
    8181                        }
    8282                } else if (keys.containsKey("seamark:beacon_cardinal:shape")) {
    83                                 str = keys.get("seamark:beacon_cardinal:shape");
    84                                 if (str.equals("tower")) {
    85                                         dlg.panelMain.panelHaz.towerButton.doClick();
    86                                 } else {
    87                                         dlg.panelMain.panelHaz.beaconButton.doClick();
    88                                 }
    89                 } else if (keys.containsKey("seamark:type")
    90                                 && (keys.get("seamark:type").equals("light_float"))) {
     83                        str = keys.get("seamark:beacon_cardinal:shape");
     84                        if (str.equals("tower")) {
     85                                dlg.panelMain.panelHaz.towerButton.doClick();
     86                        } else {
     87                                dlg.panelMain.panelHaz.beaconButton.doClick();
     88                        }
     89                } else if (keys.containsKey("seamark:type") && (keys.get("seamark:type").equals("light_float"))) {
    9190                        dlg.panelMain.panelHaz.floatButton.doClick();
    9291                }
     
    106105
    107106        public void paintSign() {
    108                 /*
    109                 if (dlg.paintlock) return; super.paintSign();
    110                  */
    111                 if ((getCategory() != Cat.UNKNOWN) && (getShape() != Shp.UNKNOWN)) {
    112                         String image = "/images/Cardinal";
    113                         switch (getShape()) {
    114                         case PILLAR:
    115                                 image += "_Pillar";
    116                                 break;
    117                         case SPAR:
    118                                 image += "_Spar";
    119                                 break;
    120                         case BEACON:
    121                                 image += "_Beacon";
    122                                 break;
    123                         case TOWER:
    124                                 image += "_Tower";
    125                                 break;
    126                         case FLOAT:
    127                                 image += "_Float";
    128                                 break;
    129                         default:
    130                                 return;
    131                         }
    132 
    133                         switch (getCategory()) {
    134                         case CARD_NORTH:
    135                                 image += "_North";
    136                                 break;
    137                         case CARD_EAST:
    138                                 image += "_East";
    139                                 break;
    140                         case CARD_SOUTH:
    141                                 image += "_South";
    142                                 break;
    143                         case CARD_WEST:
    144                                 image += "_West";
    145                                 break;
    146                         default:
    147                                 return;
    148                         }
    149 
    150                         if (!image.equals("/images/Cardinal")) {
    151                                 image += ".png";
    152                                 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass()
    153                                                 .getResource(image)));
    154                         } else
    155                                 dlg.panelMain.shapeIcon.setIcon(null);
    156                 }
     107                String image = "/images/Cardinal";
     108                switch (getShape()) {
     109                case PILLAR:
     110                        image += "_Pillar";
     111                        break;
     112                case SPAR:
     113                        image += "_Spar";
     114                        break;
     115                case BEACON:
     116                        image += "_Beacon";
     117                        break;
     118                case TOWER:
     119                        image += "_Tower";
     120                        break;
     121                case FLOAT:
     122                        image += "_Float";
     123                        break;
     124                default:
     125                        dlg.panelMain.shapeIcon.setIcon(null);
     126                        return;
     127                }
     128
     129                switch (getCategory()) {
     130                case CARD_NORTH:
     131                        image += "_North";
     132                        break;
     133                case CARD_EAST:
     134                        image += "_East";
     135                        break;
     136                case CARD_SOUTH:
     137                        image += "_South";
     138                        break;
     139                case CARD_WEST:
     140                        image += "_West";
     141                        break;
     142                default:
     143                        dlg.panelMain.shapeIcon.setIcon(null);
     144                        return;
     145                }
     146
     147                image += ".png";
     148                dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(image)));
     149                super.paintSign();
    157150        }
    158151
     
    166159                case PILLAR:
    167160                        super.saveSign("buoy_cardinal");
    168                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    169                                         "seamark:buoy_cardinal:shape", "pillar"));
     161                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:shape", "pillar"));
    170162                        break;
    171163                case SPAR:
    172164                        super.saveSign("buoy_cardinal");
    173                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    174                                         "seamark:buoy_cardinal:shape", "spar"));
     165                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:shape", "spar"));
    175166                        break;
    176167                case BEACON:
     
    179170                case TOWER:
    180171                        super.saveSign("beacon_cardinal");
    181                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    182                                         "seamark:beacon_cardinal:shape", "tower"));
     172                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:shape", "tower"));
    183173                        break;
    184174                case FLOAT:
     
    193183                        switch (getCategory()) {
    194184                        case CARD_NORTH:
    195                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    196                                                 "seamark:buoy_cardinal:category", "north"));
    197                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    198                                                 "seamark:buoy_cardinal:colour", "black;yellow"));
     185                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:category", "north"));
     186                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:colour", "black;yellow"));
    199187                                shape = "2 cones up";
    200188                                break;
    201189
    202190                        case CARD_EAST:
    203                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    204                                                 "seamark:buoy_cardinal:category", "east"));
    205                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    206                                                 "seamark:buoy_cardinal:colour", "black;yellow;black"));
     191                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:category", "east"));
     192                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:colour", "black;yellow;black"));
    207193                                shape = "2 cones base together";
    208194                                break;
    209195
    210196                        case CARD_SOUTH:
    211                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    212                                                 "seamark:buoy_cardinal:category", "south"));
    213                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    214                                                 "seamark:buoy_cardinal:colour", "yellow;black"));
     197                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:category", "south"));
     198                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:colour", "yellow;black"));
    215199                                shape = "2 cones down";
    216200                                break;
    217201
    218202                        case CARD_WEST:
    219                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    220                                                 "seamark:buoy_cardinal:category", "west"));
    221                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    222                                                 "seamark:buoy_cardinal:colour", "yellow;black;yellow"));
     203                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:category", "west"));
     204                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:colour", "yellow;black;yellow"));
    223205                                shape = "2 cones point together";
    224206                                break;
    225207                        }
    226                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    227                                         "seamark:buoy_cardinal:colour_pattern",
    228                                         "horizontal stripes"));
    229                         break;
    230                        
     208                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:colour_pattern", "horizontal stripes"));
     209                        break;
     210
    231211                case BEACON:
    232212                case TOWER:
    233213                        switch (getCategory()) {
    234214                        case CARD_NORTH:
    235                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    236                                                 "seamark:beacon_cardinal:category", "north"));
    237                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    238                                                 "seamark:beacon_cardinal:colour", "black;yellow"));
     215                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:category", "north"));
     216                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:colour", "black;yellow"));
    239217                                shape = "2 cones up";
    240218                                break;
    241219
    242220                        case CARD_EAST:
    243                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    244                                                 "seamark:beacon_cardinal:category", "east"));
    245                                 Main.main.undoRedo
    246                                                 .add(new ChangePropertyCommand(dlg.node,
    247                                                                 "seamark:beacon_cardinal:colour",
    248                                                                 "black;yellow;black"));
     221                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:category", "east"));
     222                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:colour", "black;yellow;black"));
    249223                                shape = "2 cones base together";
    250224                                break;
    251225
    252226                        case CARD_SOUTH:
    253                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    254                                                 "seamark:beacon_cardinal:category", "south"));
    255                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    256                                                 "seamark:beacon_cardinal:colour", "yellow;black"));
     227                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:category", "south"));
     228                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:colour", "yellow;black"));
    257229                                shape = "2 cones down";
    258230                                break;
    259231
    260232                        case CARD_WEST:
    261                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    262                                                 "seamark:beacon_cardinal:category", "west"));
    263                                 Main.main.undoRedo
    264                                                 .add(new ChangePropertyCommand(dlg.node,
    265                                                                 "seamark:beacon_cardinal:colour",
    266                                                                 "yellow;black;yellow"));
     233                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:category", "west"));
     234                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:colour", "yellow;black;yellow"));
    267235                                shape = "2 cones point together";
    268236                                break;
    269237                        }
    270                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    271                                         "seamark:beacon_cardinal:colour_pattern",
    272                                         "horizontal stripes"));
    273                         break;
    274                        
     238                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:colour_pattern", "horizontal stripes"));
     239                        break;
     240
    275241                case FLOAT:
    276242                        switch (getCategory()) {
    277243                        case CARD_NORTH:
    278                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    279                                                 "seamark:light_float:colour", "black;yellow"));
     244                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "black;yellow"));
    280245                                shape = "2 cones up";
    281246                                break;
    282247
    283248                        case CARD_EAST:
    284                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    285                                                 "seamark:light_float:colour", "black;yellow;black"));
     249                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "black;yellow;black"));
    286250                                shape = "2 cones base together";
    287251                                break;
    288252
    289253                        case CARD_SOUTH:
    290                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    291                                                 "seamark:light_float:colour", "yellow;black"));
     254                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "yellow;black"));
    292255                                shape = "2 cones down";
    293256                                break;
    294257
    295258                        case CARD_WEST:
    296                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    297                                                 "seamark:light_float:colour", "yellow;black;yellow"));
     259                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "yellow;black;yellow"));
    298260                                shape = "2 cones point together";
    299261                                break;
    300262                        }
    301                         Main.main.undoRedo
    302                                         .add(new ChangePropertyCommand(dlg.node,
    303                                                         "seamark:light_float:colour_pattern",
    304                                                         "horizontal stripes"));
     263                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour_pattern", "horizontal stripes"));
    305264                        break;
    306265                }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkIsol.java

    r24830 r24839  
    1515                super(dia);
    1616        }
    17        
     17
    1818        public void parseMark() {
    1919
     
    5050                        }
    5151                } else if (keys.containsKey("seamark:beacon_isolated_danger:shape")) {
    52                                 str = keys.get("seamark:beacon_isolated_danger:shape");
    53                                 if (str.equals("tower")) {
    54                                         dlg.panelMain.panelHaz.towerButton.doClick();
    55                                 } else {
    56                                         dlg.panelMain.panelHaz.beaconButton.doClick();
    57                                 }
    58                 } else if (keys.containsKey("seamark:type")
    59                                 && (keys.get("seamark:type").equals("light_float"))) {
     52                        str = keys.get("seamark:beacon_isolated_danger:shape");
     53                        if (str.equals("tower")) {
     54                                dlg.panelMain.panelHaz.towerButton.doClick();
     55                        } else {
     56                                dlg.panelMain.panelHaz.beaconButton.doClick();
     57                        }
     58                } else if (keys.containsKey("seamark:type") && (keys.get("seamark:type").equals("light_float"))) {
    6059                        dlg.panelMain.panelHaz.floatButton.doClick();
    6160                }
     
    6463                parseFogRadar(keys);
    6564
    66 //              dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());
    67 //              dlg.tfM01Name.setText(getName());
    68 //              dlg.cM01TopMark.setSelected(hasTopMark());
     65                // dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());
     66                // dlg.tfM01Name.setText(getName());
     67                // dlg.cM01TopMark.setSelected(hasTopMark());
    6968        }
    7069
     
    7473
    7574        public void paintSign() {
    76 /*              if (dlg.paintlock)
    77                         return;
    78 
    79                 super.paintSign();
    80 */
     75                /*
     76                 * if (dlg.paintlock) return;
     77                 *
     78                 * super.paintSign();
     79                 */
    8180                if ((getCategory() != Cat.UNKNOWN) && (getShape() != Shp.UNKNOWN)) {
    8281
     
    104103                        if (!image.equals("/images/Cardinal")) {
    105104                                image += ".png";
    106                                 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass()
    107                                                 .getResource(image)));
     105                                dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(image)));
    108106                        } else
    109107                                dlg.panelMain.shapeIcon.setIcon(null);
     
    120118                case PILLAR:
    121119                        super.saveSign("buoy_isolated_danger");
    122                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    123                                         "seamark:buoy_isolated_danger:shape", "pillar"));
     120                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_isolated_danger:shape", "pillar"));
    124121                        break;
    125122                case SPAR:
    126123                        super.saveSign("buoy_isolated_danger");
    127                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    128                                         "seamark:buoy_isolated_danger:shape", "spar"));
     124                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_isolated_danger:shape", "spar"));
    129125                        break;
    130126                case BEACON:
     
    133129                case TOWER:
    134130                        super.saveSign("beacon_isolated_danger");
    135                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    136                                         "seamark:beacon_isolated_danger:shape", "tower"));
     131                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_isolated_danger:shape", "tower"));
    137132                        break;
    138133                case FLOAT:
     
    145140                case PILLAR:
    146141                case SPAR:
    147                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    148                                         "seamark:buoy_isolated_danger:colour_pattern", "horizontal stripes"));
    149                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    150                                         "seamark:buoy_isolated_danger:colour", "black;red;black"));
     142                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_isolated_danger:colour_pattern",
     143                                        "horizontal stripes"));
     144                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_isolated_danger:colour", "black;red;black"));
    151145                        break;
    152146                case BEACON:
    153147                case TOWER:
    154                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    155                                         "seamark:beacon_isolated_danger:colour_pattern",
     148                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_isolated_danger:colour_pattern",
    156149                                        "horizontal stripes"));
    157                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    158                                         "seamark:beacon_isolated_danger:colour", "black;red;black"));
     150                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_isolated_danger:colour", "black;red;black"));
    159151                        break;
    160152                case FLOAT:
    161                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    162                                         "seamark:light_float:colour_pattern", "horizontal stripes"));
    163                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    164                                         "seamark:light_float:colour", "black;red;black"));
     153                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour_pattern", "horizontal stripes"));
     154                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "black;red;black"));
    165155                        break;
    166156                }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLat.java

    r24835 r24839  
    1414                super(dia);
    1515        }
    16        
     16
    1717        public void parseMark() {
    1818
     
    5656                        if (keys.containsKey("seamark:topmark:shape")) {
    5757                                top = keys.get("seamark:topmark:shape");
    58 //                              setTopMark(true);
     58                                // setTopMark(true);
    5959                        }
    6060                        if (keys.containsKey("seamark:topmark:colour")) {
    61                                 if (col.isEmpty()) col = keys.get("seamark:topmark:colour");
    62 //                              setTopMark(true);
     61                                if (col.isEmpty())
     62                                        col = keys.get("seamark:topmark:colour");
     63                                // setTopMark(true);
    6364                        }
    6465                }
    65                
     66
    6667                if (col.isEmpty()) {
    6768                        if (keys.containsKey("seamark:light:colour"))
     
    7071
    7172                /*
    72                 if (cat.isEmpty()) {
    73                         if (col.equals("red")) {
    74                                 setColour(RED);
    75                                 if (top.equals("cylinder")) {
    76                                         setBuoyIndex(PORT_HAND);
    77                                         setRegion(IALA_A);
    78                                 } else if (top.equals("cone, point up")) {
    79                                         setBuoyIndex(STARBOARD_HAND);
    80                                         setRegion(IALA_B);
    81                                 } else {
    82                                         if (getRegion() == IALA_A)
    83                                                 setBuoyIndex(PORT_HAND);
    84                                         else
    85                                                 setBuoyIndex(STARBOARD_HAND);
    86                                 }
    87                         } else if (col.equals("green")) {
    88                                 setColour(GREEN);
    89                                 if (top.equals("cone, point up")) {
    90                                         setBuoyIndex(STARBOARD_HAND);
    91                                         setRegion(IALA_A);
    92                                 } else if (top.equals("cylinder")) {
    93                                         setBuoyIndex(PORT_HAND);
    94                                         setRegion(IALA_B);
    95                                 } else {
    96                                         if (getRegion() == IALA_A)
    97                                                 setBuoyIndex(STARBOARD_HAND);
    98                                         else
    99                                                 setBuoyIndex(PORT_HAND);
    100                                 }
    101                         } else if (col.equals("red;green;red")) {
    102                                 setColour(RED_GREEN_RED);
    103                                 if (top.equals("cylinder")) {
    104                                         setBuoyIndex(PREF_PORT_HAND);
    105                                         setRegion(IALA_A);
    106                                 } else if (top.equals("cone, point up")) {
    107                                         setBuoyIndex(PREF_STARBOARD_HAND);
    108                                         setRegion(IALA_B);
    109                                 } else {
    110                                         if (getRegion() == IALA_A)
    111                                                 setBuoyIndex(PREF_PORT_HAND);
    112                                         else
    113                                                 setBuoyIndex(PREF_STARBOARD_HAND);
    114                                 }
    115                         } else if (col.equals("green;red;green")) {
    116                                 setColour(GREEN_RED_GREEN);
    117                                 if (top.equals("cone, point up")) {
    118                                         setBuoyIndex(PREF_STARBOARD_HAND);
    119                                         setRegion(IALA_A);
    120                                 } else if (top.equals("cylinder")) {
    121                                         setBuoyIndex(PREF_PORT_HAND);
    122                                         setRegion(IALA_B);
    123                                 } else {
    124                                         if (getRegion() == IALA_A)
    125                                                 setBuoyIndex(PREF_STARBOARD_HAND);
    126                                         else
    127                                                 setBuoyIndex(PREF_PORT_HAND);
    128                                 }
    129                         }
    130                 } else if (cat.equals("port")) {
    131 
    132                         setBuoyIndex(PORT_HAND);
    133 
    134                         if (col.equals("red")) {
    135                                 setRegion(IALA_A);
    136                                 setColour(RED);
    137                         } else if (col.equals("green")) {
    138                                 setRegion(IALA_B);
    139                                 setColour(GREEN);
    140                         } else {
    141                                 if (getRegion() == IALA_A)
    142                                         setColour(RED);
    143                                 else
    144                                         setColour(GREEN);
    145                         }
    146                 } else if (cat.equals("starboard")) {
    147 
    148                         setBuoyIndex(STARBOARD_HAND);
    149 
    150                         if (col.equals("green")) {
    151                                 setRegion(IALA_A);
    152                                 setColour(GREEN);
    153                         } else if (col.equals("red")) {
    154                                 setRegion(IALA_B);
    155                                 setColour(RED);
    156                         } else {
    157                                 if (getRegion() == IALA_A)
    158                                         setColour(GREEN);
    159                                 else
    160                                         setColour(RED);
    161                         }
    162                 } else if (cat.equals("preferred_channel_port")) {
    163 
    164                         setBuoyIndex(PREF_PORT_HAND);
    165 
    166                         if (col.equals("red;green;red")) {
    167                                 setRegion(IALA_A);
    168                                 setColour(RED_GREEN_RED);
    169                         } else if (col.equals("green;red;green")) {
    170                                 setRegion(IALA_B);
    171                                 setColour(GREEN_RED_GREEN);
    172                         } else {
    173                                 if (getRegion() == IALA_A)
    174                                         setColour(RED_GREEN_RED);
    175                                 else
    176                                         setColour(GREEN_RED_GREEN);
    177                         }
    178 
    179                 } else if (cat.equals("preferred_channel_starboard")) {
    180 
    181                         setBuoyIndex(PREF_STARBOARD_HAND);
    182 
    183                         if (col.equals("green;red;green")) {
    184                                 setRegion(IALA_A);
    185                                 setColour(GREEN_RED_GREEN);
    186                         } else if (col.equals("red;green;red")) {
    187                                 setRegion(IALA_B);
    188                                 setColour(RED_GREEN_RED);
    189                         } else {
    190                                 if (getRegion() == IALA_A)
    191                                         setColour(GREEN_RED_GREEN);
    192                                 else
    193                                         setColour(RED_GREEN_RED);
    194                         }
    195                 }
    196 
    197                 if (keys.containsKey("seamark:buoy_lateral:shape")) {
    198                         str = keys.get("seamark:buoy_lateral:shape");
    199 
    200                         switch (getBuoyIndex()) {
    201                         case PORT_HAND:
    202                                 if (str.equals("can"))
    203                                         setStyleIndex(CAN);
    204                                 else if (str.equals("pillar"))
    205                                         setStyleIndex(PILLAR);
    206                                 else if (str.equals("spar"))
    207                                         setStyleIndex(SPAR);
    208                                 break;
    209 
    210                         case PREF_PORT_HAND:
    211                                 if (str.equals("can"))
    212                                         setStyleIndex(CAN);
    213                                 else if (str.equals("pillar"))
    214                                         setStyleIndex(PILLAR);
    215                                 else if (str.equals("spar"))
    216                                         setStyleIndex(SPAR);
    217                                 break;
    218 
    219                         case STARBOARD_HAND:
    220                                 if (str.equals("conical"))
    221                                         setStyleIndex(CONE);
    222                                 else if (str.equals("pillar"))
    223                                         setStyleIndex(PILLAR);
    224                                 else if (str.equals("spar"))
    225                                         setStyleIndex(SPAR);
    226                                 break;
    227 
    228                         case PREF_STARBOARD_HAND:
    229                                 if (str.equals("conical"))
    230                                         setStyleIndex(CONE);
    231                                 else if (str.equals("pillar"))
    232                                         setStyleIndex(PILLAR);
    233                                 else if (str.equals("spar"))
    234                                         setStyleIndex(SPAR);
    235                                 break;
    236                         }
    237                 } else if (keys.containsKey("seamark:beacon_lateral:shape")) {
    238                         str = keys.get("seamark:beacon_lateral:shape");
    239                         if (str.equals("tower"))
    240                                 setStyleIndex(TOWER);
    241                         else if (str.equals("perch"))
    242                                 setStyleIndex(PERCH);
    243                         else
    244                                 setStyleIndex(BEACON);
    245                 } else if (keys.containsKey("seamark:type")
    246                                 && (keys.get("seamark:type").equals("beacon_lateral"))) {
    247                         setStyleIndex(BEACON);
    248                 } else if (keys.containsKey("seamark:type")
    249                                 && (keys.get("seamark:type").equals("light_float"))) {
    250                         setStyleIndex(FLOAT);
    251                 }
    252 
    253                 parseLights(keys);
    254                 parseFogRadar(keys);
    255                 setLightColour();
    256 
    257 */      }
     73                 * if (cat.isEmpty()) { if (col.equals("red")) { setColour(RED); if
     74                 * (top.equals("cylinder")) { setBuoyIndex(PORT_HAND); setRegion(IALA_A); }
     75                 * else if (top.equals("cone, point up")) { setBuoyIndex(STARBOARD_HAND);
     76                 * setRegion(IALA_B); } else { if (getRegion() == IALA_A)
     77                 * setBuoyIndex(PORT_HAND); else setBuoyIndex(STARBOARD_HAND); } } else if
     78                 * (col.equals("green")) { setColour(GREEN); if
     79                 * (top.equals("cone, point up")) { setBuoyIndex(STARBOARD_HAND);
     80                 * setRegion(IALA_A); } else if (top.equals("cylinder")) {
     81                 * setBuoyIndex(PORT_HAND); setRegion(IALA_B); } else { if (getRegion() ==
     82                 * IALA_A) setBuoyIndex(STARBOARD_HAND); else setBuoyIndex(PORT_HAND); } }
     83                 * else if (col.equals("red;green;red")) { setColour(RED_GREEN_RED); if
     84                 * (top.equals("cylinder")) { setBuoyIndex(PREF_PORT_HAND);
     85                 * setRegion(IALA_A); } else if (top.equals("cone, point up")) {
     86                 * setBuoyIndex(PREF_STARBOARD_HAND); setRegion(IALA_B); } else { if
     87                 * (getRegion() == IALA_A) setBuoyIndex(PREF_PORT_HAND); else
     88                 * setBuoyIndex(PREF_STARBOARD_HAND); } } else if
     89                 * (col.equals("green;red;green")) { setColour(GREEN_RED_GREEN); if
     90                 * (top.equals("cone, point up")) { setBuoyIndex(PREF_STARBOARD_HAND);
     91                 * setRegion(IALA_A); } else if (top.equals("cylinder")) {
     92                 * setBuoyIndex(PREF_PORT_HAND); setRegion(IALA_B); } else { if (getRegion()
     93                 * == IALA_A) setBuoyIndex(PREF_STARBOARD_HAND); else
     94                 * setBuoyIndex(PREF_PORT_HAND); } } } else if (cat.equals("port")) {
     95                 *
     96                 * setBuoyIndex(PORT_HAND);
     97                 *
     98                 * if (col.equals("red")) { setRegion(IALA_A); setColour(RED); } else if
     99                 * (col.equals("green")) { setRegion(IALA_B); setColour(GREEN); } else { if
     100                 * (getRegion() == IALA_A) setColour(RED); else setColour(GREEN); } } else
     101                 * if (cat.equals("starboard")) {
     102                 *
     103                 * setBuoyIndex(STARBOARD_HAND);
     104                 *
     105                 * if (col.equals("green")) { setRegion(IALA_A); setColour(GREEN); } else if
     106                 * (col.equals("red")) { setRegion(IALA_B); setColour(RED); } else { if
     107                 * (getRegion() == IALA_A) setColour(GREEN); else setColour(RED); } } else
     108                 * if (cat.equals("preferred_channel_port")) {
     109                 *
     110                 * setBuoyIndex(PREF_PORT_HAND);
     111                 *
     112                 * if (col.equals("red;green;red")) { setRegion(IALA_A);
     113                 * setColour(RED_GREEN_RED); } else if (col.equals("green;red;green")) {
     114                 * setRegion(IALA_B); setColour(GREEN_RED_GREEN); } else { if (getRegion()
     115                 * == IALA_A) setColour(RED_GREEN_RED); else setColour(GREEN_RED_GREEN); }
     116                 *
     117                 * } else if (cat.equals("preferred_channel_starboard")) {
     118                 *
     119                 * setBuoyIndex(PREF_STARBOARD_HAND);
     120                 *
     121                 * if (col.equals("green;red;green")) { setRegion(IALA_A);
     122                 * setColour(GREEN_RED_GREEN); } else if (col.equals("red;green;red")) {
     123                 * setRegion(IALA_B); setColour(RED_GREEN_RED); } else { if (getRegion() ==
     124                 * IALA_A) setColour(GREEN_RED_GREEN); else setColour(RED_GREEN_RED); } }
     125                 *
     126                 * if (keys.containsKey("seamark:buoy_lateral:shape")) { str =
     127                 * keys.get("seamark:buoy_lateral:shape");
     128                 *
     129                 * switch (getBuoyIndex()) { case PORT_HAND: if (str.equals("can"))
     130                 * setStyleIndex(CAN); else if (str.equals("pillar")) setStyleIndex(PILLAR);
     131                 * else if (str.equals("spar")) setStyleIndex(SPAR); break;
     132                 *
     133                 * case PREF_PORT_HAND: if (str.equals("can")) setStyleIndex(CAN); else if
     134                 * (str.equals("pillar")) setStyleIndex(PILLAR); else if
     135                 * (str.equals("spar")) setStyleIndex(SPAR); break;
     136                 *
     137                 * case STARBOARD_HAND: if (str.equals("conical")) setStyleIndex(CONE); else
     138                 * if (str.equals("pillar")) setStyleIndex(PILLAR); else if
     139                 * (str.equals("spar")) setStyleIndex(SPAR); break;
     140                 *
     141                 * case PREF_STARBOARD_HAND: if (str.equals("conical")) setStyleIndex(CONE);
     142                 * else if (str.equals("pillar")) setStyleIndex(PILLAR); else if
     143                 * (str.equals("spar")) setStyleIndex(SPAR); break; } } else if
     144                 * (keys.containsKey("seamark:beacon_lateral:shape")) { str =
     145                 * keys.get("seamark:beacon_lateral:shape"); if (str.equals("tower"))
     146                 * setStyleIndex(TOWER); else if (str.equals("perch")) setStyleIndex(PERCH);
     147                 * else setStyleIndex(BEACON); } else if (keys.containsKey("seamark:type")
     148                 * && (keys.get("seamark:type").equals("beacon_lateral"))) {
     149                 * setStyleIndex(BEACON); } else if (keys.containsKey("seamark:type") &&
     150                 * (keys.get("seamark:type").equals("light_float"))) { setStyleIndex(FLOAT);
     151                 * }
     152                 *
     153                 * parseLights(keys); parseFogRadar(keys); setLightColour();
     154                 */}
    258155
    259156        public void setLightColour() {
     
    272169
    273170        public void paintSign() {
    274 /*              if (dlg.paintlock)
    275                         return;
    276                 super.paintSign();
    277 */
     171                /*
     172                 * if (dlg.paintlock) return; super.paintSign();
     173                 */
    278174                boolean region = getRegion();
    279175                Shp style = getShape();
     
    488384
    489385                        image += ".png";
    490                         dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass()
    491                                         .getResource(image)));
     386                        dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(image)));
    492387
    493388                        if (hasTopMark()) {
     
    571466                                }
    572467                                if (!image.isEmpty())
    573                                         dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass()
    574                                                         .getResource(image)));
     468                                        dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(image)));
    575469                        }
    576470                } else
     
    594488                        case CAN:
    595489                                super.saveSign("buoy_lateral");
    596                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    597                                                 "seamark:buoy_lateral:shape", "can"));
     490                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "can"));
    598491                                break;
    599492                        case PILLAR:
    600493                                super.saveSign("buoy_lateral");
    601                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    602                                                 "seamark:buoy_lateral:shape", "pillar"));
     494                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "pillar"));
    603495                                break;
    604496                        case SPAR:
    605497                                super.saveSign("buoy_lateral");
    606                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    607                                                 "seamark:buoy_lateral:shape", "spar"));
     498                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "spar"));
    608499                                break;
    609500                        case BEACON:
     
    612503                        case TOWER:
    613504                                super.saveSign("beacon_lateral");
    614                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    615                                                 "seamark:beacon_lateral:shape", "tower"));
     505                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "tower"));
    616506                                break;
    617507                        case FLOAT:
     
    620510                        case PERCH:
    621511                                super.saveSign("beacon_lateral");
    622                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    623                                                 "seamark:beacon_lateral:shape", "perch"));
     512                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "perch"));
    624513                                break;
    625514                        default:
     
    629518                        case PILLAR:
    630519                        case SPAR:
    631                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    632                                                 "seamark:buoy_lateral:category", "port"));
    633                                 if (getRegion() == IALA_A) {
    634                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    635                                                         "seamark:buoy_lateral:colour", "red"));
    636                                         colour = "red";
    637                                 } else {
    638                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    639                                                         "seamark:buoy_lateral:colour", "green"));
     520                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:category", "port"));
     521                                if (getRegion() == IALA_A) {
     522                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "red"));
     523                                        colour = "red";
     524                                } else {
     525                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "green"));
    640526                                        colour = "green";
    641527                                }
    642528                                break;
    643529                        case PERCH:
    644                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    645                                                 "seamark:beacon_lateral:category", "port"));
     530                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:category", "port"));
    646531                                break;
    647532                        case BEACON:
    648533                        case TOWER:
    649                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    650                                                 "seamark:beacon_lateral:category", "port"));
    651                                 if (getRegion() == IALA_A) {
    652                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    653                                                         "seamark:beacon_lateral:colour", "red"));
    654                                         colour = "red";
    655                                 } else {
    656                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    657                                                         "seamark:beacon_lateral:colour", "green"));
     534                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:category", "port"));
     535                                if (getRegion() == IALA_A) {
     536                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "red"));
     537                                        colour = "red";
     538                                } else {
     539                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "green"));
    658540                                        colour = "green";
    659541                                }
     
    661543                        case FLOAT:
    662544                                if (getRegion() == IALA_A) {
    663                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    664                                                         "seamark:light_float:colour", "red"));
    665                                         colour = "red";
    666                                 } else {
    667                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    668                                                         "seamark:light_float:colour", "green"));
     545                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "red"));
     546                                        colour = "red";
     547                                } else {
     548                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "green"));
    669549                                        colour = "green";
    670550                                }
     
    678558                        case CAN:
    679559                                super.saveSign("buoy_lateral");
    680                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    681                                                 "seamark:buoy_lateral:shape", "can"));
     560                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "can"));
    682561                                break;
    683562                        case PILLAR:
    684563                                super.saveSign("buoy_lateral");
    685                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    686                                                 "seamark:buoy_lateral:shape", "pillar"));
     564                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "pillar"));
    687565                                break;
    688566                        case SPAR:
    689567                                super.saveSign("buoy_lateral");
    690                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    691                                                 "seamark:buoy_lateral:shape", "spar"));
     568                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "spar"));
    692569                                break;
    693570                        case BEACON:
     
    696573                        case TOWER:
    697574                                super.saveSign("beacon_lateral");
    698                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    699                                                 "seamark:beacon_lateral:shape", "tower"));
     575                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "tower"));
    700576                                break;
    701577                        case FLOAT:
     
    708584                        case PILLAR:
    709585                        case SPAR:
    710                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    711                                                 "seamark:buoy_lateral:category", "preferred_channel_port"));
    712                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    713                                                 "seamark:buoy_lateral:colour_pattern", "horizontal stripes"));
    714                                 if (getRegion() == IALA_A) {
    715                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    716                                                         "seamark:buoy_lateral:colour", "red;green;red"));
    717                                         colour = "red";
    718                                 } else {
    719                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    720                                                         "seamark:buoy_lateral:colour", "green;red;green"));
     586                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:category", "preferred_channel_port"));
     587                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour_pattern", "horizontal stripes"));
     588                                if (getRegion() == IALA_A) {
     589                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "red;green;red"));
     590                                        colour = "red";
     591                                } else {
     592                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "green;red;green"));
    721593                                        colour = "green";
    722594                                }
     
    724596                        case BEACON:
    725597                        case TOWER:
    726                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    727                                                 "seamark:beacon_lateral:category", "preferred_channel_port"));
    728                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    729                                                 "seamark:beacon_lateral:colour_pattern", "horizontal stripes"));
    730                                 if (getRegion() == IALA_A) {
    731                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    732                                                         "seamark:beacon_lateral:colour", "red;green;red"));
    733                                         colour = "red";
    734                                 } else {
    735                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    736                                                         "seamark:beacon_lateral:colour", "green;red;green"));
     598                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:category", "preferred_channel_port"));
     599                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour_pattern", "horizontal stripes"));
     600                                if (getRegion() == IALA_A) {
     601                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "red;green;red"));
     602                                        colour = "red";
     603                                } else {
     604                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "green;red;green"));
    737605                                        colour = "green";
    738606                                }
    739607                                break;
    740608                        case FLOAT:
    741                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    742                                                 "seamark:light_float:colour_pattern", "horizontal stripes"));
    743                                 if (getRegion() == IALA_A) {
    744                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    745                                                         "seamark:light_float:colour", "red;green;red"));
    746                                         colour = "red";
    747                                 } else {
    748                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    749                                                         "seamark:light_float:colour", "green;red;green"));
     609                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour_pattern", "horizontal stripes"));
     610                                if (getRegion() == IALA_A) {
     611                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "red;green;red"));
     612                                        colour = "red";
     613                                } else {
     614                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "green;red;green"));
    750615                                        colour = "green";
    751616                                }
     
    759624                        case CONE:
    760625                                super.saveSign("buoy_lateral");
    761                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    762                                                 "seamark:buoy_lateral:shape", "conical"));
     626                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "conical"));
    763627                                break;
    764628                        case PILLAR:
    765629                                super.saveSign("buoy_lateral");
    766                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    767                                                 "seamark:buoy_lateral:shape", "pillar"));
     630                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "pillar"));
    768631                                break;
    769632                        case SPAR:
    770633                                super.saveSign("buoy_lateral");
    771                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    772                                                 "seamark:buoy_lateral:shape", "spar"));
     634                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "spar"));
    773635                                break;
    774636                        case BEACON:
    775637                                super.saveSign("beacon_lateral");
    776                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    777                                                 "seamark:beacon_lateral:shape", "stake"));
     638                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "stake"));
    778639                                break;
    779640                        case TOWER:
    780641                                super.saveSign("beacon_lateral");
    781                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    782                                                 "seamark:beacon_lateral:shape", "tower"));
     642                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "tower"));
    783643                                break;
    784644                        case FLOAT:
     
    787647                        case PERCH:
    788648                                super.saveSign("beacon_lateral");
    789                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    790                                                 "seamark:beacon_lateral:shape", "perch"));
     649                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "perch"));
    791650                                break;
    792651                        default:
     
    796655                        case PILLAR:
    797656                        case SPAR:
    798                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    799                                                 "seamark:buoy_lateral:category", "starboard"));
    800                                 if (getRegion() == IALA_A) {
    801                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    802                                                         "seamark:buoy_lateral:colour", "green"));
    803                                         colour = "green";
    804                                 } else {
    805                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    806                                                         "seamark:buoy_lateral:colour", "red"));
     657                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:category", "starboard"));
     658                                if (getRegion() == IALA_A) {
     659                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "green"));
     660                                        colour = "green";
     661                                } else {
     662                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "red"));
    807663                                        colour = "red";
    808664                                }
     
    810666                        case BEACON:
    811667                        case TOWER:
    812                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    813                                                 "seamark:beacon_lateral:category", "starboard"));
    814                                 if (getRegion() == IALA_A) {
    815                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    816                                                         "seamark:beacon_lateral:colour", "green"));
    817                                         colour = "green";
    818                                 } else {
    819                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    820                                                         "seamark:beacon_lateral:colour", "red"));
     668                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:category", "starboard"));
     669                                if (getRegion() == IALA_A) {
     670                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "green"));
     671                                        colour = "green";
     672                                } else {
     673                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "red"));
    821674                                        colour = "red";
    822675                                }
     
    824677                        case FLOAT:
    825678                                if (getRegion() == IALA_A) {
    826                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    827                                                         "seamark:light_float:colour", "green"));
    828                                         colour = "green";
    829                                 } else {
    830                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    831                                                         "seamark:light_float:colour", "red"));
     679                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "green"));
     680                                        colour = "green";
     681                                } else {
     682                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "red"));
    832683                                        colour = "red";
    833684                                }
    834685                                break;
    835686                        case PERCH:
    836                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    837                                                 "seamark:beacon_lateral:category", "starboard"));
     687                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:category", "starboard"));
    838688                                break;
    839689                        }
     
    845695                        case CONE:
    846696                                super.saveSign("buoy_lateral");
    847                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    848                                                 "seamark:buoy_lateral:shape", "conical"));
     697                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "conical"));
    849698                                break;
    850699                        case PILLAR:
    851700                                super.saveSign("buoy_lateral");
    852                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    853                                                 "seamark:buoy_lateral:shape", "pillar"));
     701                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "pillar"));
    854702                                break;
    855703                        case SPAR:
    856704                                super.saveSign("buoy_lateral");
    857                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    858                                                 "seamark:buoy_lateral:shape", "spar"));
     705                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "spar"));
    859706                                break;
    860707                        case BEACON:
    861708                                super.saveSign("beacon_lateral");
    862                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    863                                                 "seamark:beacon_lateral:shape", "stake"));
     709                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "stake"));
    864710                                break;
    865711                        case TOWER:
    866712                                super.saveSign("beacon_lateral");
    867                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    868                                                 "seamark:beacon_lateral:shape", "tower"));
     713                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "tower"));
    869714                                break;
    870715                        case FLOAT:
     
    877722                        case PILLAR:
    878723                        case SPAR:
    879                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    880                                                 "seamark:buoy_lateral:category", "preferred_channel_starboard"));
    881                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    882                                                 "seamark:buoy_lateral:colour_pattern", "horizontal stripes"));
    883                                 if (getRegion() == IALA_A) {
    884                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    885                                                         "seamark:buoy_lateral:colour", "green;red;green"));
    886                                         colour = "green";
    887                                 } else {
    888                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    889                                                         "seamark:buoy_lateral:colour", "red;green;red"));
     724                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:category", "preferred_channel_starboard"));
     725                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour_pattern", "horizontal stripes"));
     726                                if (getRegion() == IALA_A) {
     727                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "green;red;green"));
     728                                        colour = "green";
     729                                } else {
     730                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:colour", "red;green;red"));
    890731                                        colour = "red";
    891732                                }
     
    893734                        case BEACON:
    894735                        case TOWER:
    895                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    896                                                 "seamark:beacon_lateral:category", "preferred_channel_starboard"));
    897                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    898                                                 "seamark:beacon_lateral:colour_pattern", "horizontal stripes"));
    899                                 if (getRegion() == IALA_A) {
    900                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    901                                                         "seamark:beacon_lateral:colour", "green;red;green"));
    902                                         colour = "green";
    903                                 } else {
    904                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    905                                                         "seamark:beacon_lateral:colour", "red;green;red"));
     736                                Main.main.undoRedo
     737                                                .add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:category", "preferred_channel_starboard"));
     738                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour_pattern", "horizontal stripes"));
     739                                if (getRegion() == IALA_A) {
     740                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "green;red;green"));
     741                                        colour = "green";
     742                                } else {
     743                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:colour", "red;green;red"));
    906744                                        colour = "red";
    907745                                }
    908746                                break;
    909747                        case FLOAT:
    910                                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    911                                                 "seamark:light_float:colour_pattern", "horizontal stripes"));
    912                                 if (getRegion() == IALA_A) {
    913                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    914                                                         "seamark:light_float:colour", "green;red;green"));
    915                                         colour = "green";
    916                                 } else {
    917                                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    918                                                         "seamark:light_float:colour", "red;green;red"));
     748                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour_pattern", "horizontal stripes"));
     749                                if (getRegion() == IALA_A) {
     750                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "green;red;green"));
     751                                        colour = "green";
     752                                } else {
     753                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "red;green;red"));
    919754                                        colour = "red";
    920755                                }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLight.java

    r24830 r24839  
    1212                super(dia);
    1313        }
    14        
     14
    1515        public void parseMark() {
    1616
     
    3939
    4040                /*
    41                 if (keys.containsKey("seamark:type")) {
    42                         String type = keys.get("seamark:type");
    43                         if (type.equals("landmark"))
    44                                 setBuoyIndex(LIGHT_HOUSE);
    45                         else if (type.equals("light_major"))
    46                                 setBuoyIndex(LIGHT_MAJOR);
    47                         else if (type.equals("light_minor"))
    48                                 setBuoyIndex(LIGHT_MINOR);
    49                         else if (type.equals("light_vessel"))
    50                                 setBuoyIndex(LIGHT_VESSEL);
    51                 }
    52 
    53                 parseLights(keys);
    54                 parseFogRadar(keys);
    55                 setTopMark(false);
    56                 setFired(true);
    57 
    58                 dlg.cbM01CatOfMark.setSelectedIndex(getBuoyIndex());
    59                 dlg.tfM01Name.setText(getName());
    60                 dlg.cM01Fired.setEnabled(false);
    61                 dlg.cM01Fired.setSelected(true);
    62 */      }
     41                 * if (keys.containsKey("seamark:type")) { String type =
     42                 * keys.get("seamark:type"); if (type.equals("landmark"))
     43                 * setBuoyIndex(LIGHT_HOUSE); else if (type.equals("light_major"))
     44                 * setBuoyIndex(LIGHT_MAJOR); else if (type.equals("light_minor"))
     45                 * setBuoyIndex(LIGHT_MINOR); else if (type.equals("light_vessel"))
     46                 * setBuoyIndex(LIGHT_VESSEL); }
     47                 *
     48                 * parseLights(keys); parseFogRadar(keys); setTopMark(false);
     49                 * setFired(true);
     50                 *
     51                 * dlg.cbM01CatOfMark.setSelectedIndex(getBuoyIndex());
     52                 * dlg.tfM01Name.setText(getName()); dlg.cM01Fired.setEnabled(false);
     53                 * dlg.cM01Fired.setSelected(true);
     54                 */}
    6355
    6456        public void paintSign() {
    65 /*              if (dlg.paintlock)
    66                         return;
    67                 super.paintSign();
    68 */
     57                /*
     58                 * if (dlg.paintlock) return; super.paintSign();
     59                 */
    6960                if (getCategory() != Cat.UNKNOWN) {
    7061
    7162                        switch (getCategory()) {
    7263                        case LIGHT_HOUSE:
    73                                 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(
    74                                                 "/images/Light_House.png")));
     64                                dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_House.png")));
    7565                                break;
    7666
    7767                        case LIGHT_MAJOR:
    78                                 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(
    79                                                 "/images/Light_Major.png")));
     68                                dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Major.png")));
    8069                                break;
    8170
    8271                        case LIGHT_MINOR:
    83                                 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(
    84                                                 "/images/Light_Minor.png")));
     72                                dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Minor.png")));
    8573                                break;
    8674
    8775                        case LIGHT_VESSEL:
    88                                 dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(
    89                                                 "/images/Major_Float.png")));
     76                                dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource("/images/Major_Float.png")));
    9077                                break;
    9178
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSaw.java

    r24835 r24839  
    4242                /*
    4343                 *
    44                  * setBuoyIndex(SAFE_WATER);
    45                  *  setColour(SeaMark.RED_WHITE);
     44                 * setBuoyIndex(SAFE_WATER); setColour(SeaMark.RED_WHITE);
    4645                 * setLightColour("W");
    4746                 * setRegion(Main.pref.get("tomsplugin.IALA").equals("B"));
    4847                 *
    49                  * if (keys.containsKey("seamark:buoy_safe_water:shape")) {
    50                  *  str = keys.get("seamark:buoy_safe_water:shape");
     48                 * if (keys.containsKey("seamark:buoy_safe_water:shape")) { str =
     49                 * keys.get("seamark:buoy_safe_water:shape");
    5150                 *
    52                  * if (str.equals("pillar")) setStyleIndex(SAFE_PILLAR);
    53                  *  else if
    54                  * (str.equals("spar")) setStyleIndex(SAFE_SPAR);
    55                  *  else if (str.equals("sphere")) setStyleIndex(SAFE_SPHERE);
    56                  *   } else if ((keys.containsKey("seamark:type")) &&
     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")) &&
    5755                 * (keys.get("seamark:type").equals("light_float"))) {
    58                  * setStyleIndex(SAFE_FLOAT);
    59                  *  } else if ((keys.containsKey("seamark:type")) &&
    60                  * (keys.get("seamark:type").equals("beacon_safe_water"))) {
     56                 * setStyleIndex(SAFE_FLOAT); } else if ((keys.containsKey("seamark:type"))
     57                 * && (keys.get("seamark:type").equals("beacon_safe_water"))) {
    6158                 * setStyleIndex(SAFE_BEACON); }
    6259                 *
     
    6764                 * keys.containsKey("seamark:topmark:colour")) { setTopMark(true); }
    6865                 *
    69                  * refreshLights();
    70                  *  parseLights(keys);
    71                  *   parseFogRadar(keys);
     66                 * refreshLights(); parseLights(keys); parseFogRadar(keys);
    7267                 *
    7368                 * dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());
     
    112107                if (!image.equals("/images/Safe_Water")) {
    113108                        image += ".png";
    114                         dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass()
    115                                         .getResource(image)));
     109                        dlg.panelMain.shapeIcon.setIcon(new ImageIcon(getClass().getResource(image)));
    116110                        if (hasTopMark()) {
    117111                                image = "";
     
    132126                                }
    133127                                if (!image.isEmpty())
    134                                         dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass()
    135                                                         .getResource(image)));
     128                                        dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(image)));
    136129                        } else
    137130                                dlg.panelMain.topIcon.setIcon(null);
     
    150143                case PILLAR:
    151144                        super.saveSign("buoy_safe_water");
    152                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    153                                         "seamark:buoy_safe_water:shape", "pillar"));
     145                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_safe_water:shape", "pillar"));
    154146                        break;
    155147                case SPAR:
    156148                        super.saveSign("buoy_safe_water");
    157                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    158                                         "seamark:buoy_safe_water:shape", "spar"));
     149                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_safe_water:shape", "spar"));
    159150                        break;
    160151                case SPHERE:
    161152                        super.saveSign("buoy_safe_water");
    162                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    163                                         "seamark:buoy_safe_water:shape", "sphere"));
     153                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_safe_water:shape", "sphere"));
    164154                        break;
    165155                case BEACON:
     
    176166                case SPAR:
    177167                case SPHERE:
    178                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    179                                         "seamark:buoy_safe_water:colour_pattern",
    180                                         "vertical stripes"));
    181                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    182                                         "seamark:buoy_safe_water:colour", "red;white"));
     168                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_safe_water:colour_pattern", "vertical stripes"));
     169                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_safe_water:colour", "red;white"));
    183170                        break;
    184171                case BEACON:
    185                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    186                                         "seamark:beacon_safe_water:colour_pattern",
    187                                         "vertical stripes"));
    188                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    189                                         "seamark:beacon_safe_water:colour", "red;white"));
     172                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_safe_water:colour_pattern", "vertical stripes"));
     173                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_safe_water:colour", "red;white"));
    190174                        break;
    191175                case FLOAT:
    192                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    193                                         "seamark:light_float:colour_pattern", "vertical stripes"));
    194                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    195                                         "seamark:light_float:colour", "red;white"));
     176                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour_pattern", "vertical stripes"));
     177                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "red;white"));
    196178                        break;
    197179                default:
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSpec.java

    r24830 r24839  
    1515                super(dia);
    1616        }
    17        
     17
    1818        public void parseMark() {
    1919
     
    3838                        setName(keys.get("seamark:light_float:name"));
    3939
    40 /*
    41                 dlg.cM01TopMark.setEnabled(true);
    42 
    43                 setBuoyIndex(SPECIAL_PURPOSE);
    44                 setColour(SeaMark.YELLOW);
    45                 setLightColour("W");
    46                 setRegion(Main.pref.get("tomsplugin.IALA").equals("B"));
    47 
    48                 if (keys.containsKey("seamark:buoy_special_purpose:shape")) {
    49                         str = keys.get("seamark:buoy_special_purpose:shape");
    50 
    51                         if (str.equals("pillar"))
    52                                 setStyleIndex(PILLAR);
    53                         else if (str.equals("can"))
    54                                 setStyleIndex(CAN);
    55                         else if (str.equals("conical"))
    56                                 setStyleIndex(CONE);
    57                         else if (str.equals("spar"))
    58                                 setStyleIndex(SPAR);
    59                         else if (str.equals("sphere"))
    60                                 setStyleIndex(SPHERE);
    61                         else if (str.equals("barrel"))
    62                                 setStyleIndex(BARREL);
    63                 }
    64 
    65                 if (keys.containsKey("seamark:beacon_special_purpose:shape")) {
    66                         str = keys.get("seamark:beacon_special_purpose:shape");
    67                         if (str.equals("tower"))
    68                                 setStyleIndex(TOWER);
    69                         else
    70                                 setStyleIndex(BEACON);
    71                 }
    72 
    73                 if (keys.containsKey("seamark:light_float:colour")) {
    74                         setStyleIndex(FLOAT);
    75                 }
    76 
    77                 if ((keys.containsKey("seamark:type") && keys.get("seamark:type").equals(
    78                                 "beacon_special_purpose"))
    79                                 || keys.containsKey("seamark:beacon_special_purpose:colour")
    80                                 || keys.containsKey("seamark:beacon_special_purpose:shape")) {
    81                         if (keys.containsKey("seamark:beacon_special_purpose:shape")
    82                                         && keys.get("seamark:beacon_special_purpose:shape").equals("tower"))
    83                                 setStyleIndex(TOWER);
    84                         else
    85                                 setStyleIndex(BEACON);
    86                 } else if (keys.containsKey("seamark:light_float:colour")
    87                                 && keys.get("seamark:light_float:colour").equals("yellow"))
    88                         setStyleIndex(FLOAT);
    89 
    90                 if (getStyleIndex() >= dlg.cbM01StyleOfMark.getItemCount())
    91                         setStyleIndex(0);
    92 
    93                 keys = node.getKeys();
    94                 if (keys.containsKey("seamark:topmark:shape")) {
    95                         str = keys.get("seamark:topmark:shape");
    96                         setTopMark(true);
    97                         if (str.equals("x-shape")) {
    98                                 if (keys.containsKey("seamark:topmark:colour")) {
    99                                         if (keys.get("seamark:topmark:colour").equals("red"))
    100                                                 setTopMarkIndex(TOP_RED_X);
    101                                         else
    102                                                 setTopMarkIndex(TOP_YELLOW_X);
    103                                 }
    104                         } else if (str.equals("cone, point up")) {
    105                                         setTopMarkIndex(TOP_YELLOW_CONE);
    106                         } else if (str.equals("cylinder")) {
    107                                 setTopMarkIndex(TOP_YELLOW_CAN);
    108                         }
    109                 }
    110 
    111                 parseLights(keys);
    112                 parseFogRadar(keys);
    113 
    114                 dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());
    115                 dlg.tfM01Name.setText(getName());
    116                 dlg.cM01TopMark.setSelected(hasTopMark());
    117 */      }
     40                /*
     41                 * dlg.cM01TopMark.setEnabled(true);
     42                 *
     43                 * setBuoyIndex(SPECIAL_PURPOSE); setColour(SeaMark.YELLOW);
     44                 * setLightColour("W");
     45                 * setRegion(Main.pref.get("tomsplugin.IALA").equals("B"));
     46                 *
     47                 * if (keys.containsKey("seamark:buoy_special_purpose:shape")) { str =
     48                 * keys.get("seamark:buoy_special_purpose:shape");
     49                 *
     50                 * if (str.equals("pillar")) setStyleIndex(PILLAR); else if
     51                 * (str.equals("can")) setStyleIndex(CAN); else if (str.equals("conical"))
     52                 * setStyleIndex(CONE); else if (str.equals("spar")) setStyleIndex(SPAR);
     53                 * else if (str.equals("sphere")) setStyleIndex(SPHERE); else if
     54                 * (str.equals("barrel")) setStyleIndex(BARREL); }
     55                 *
     56                 * if (keys.containsKey("seamark:beacon_special_purpose:shape")) { str =
     57                 * keys.get("seamark:beacon_special_purpose:shape"); if
     58                 * (str.equals("tower")) setStyleIndex(TOWER); else setStyleIndex(BEACON); }
     59                 *
     60                 * if (keys.containsKey("seamark:light_float:colour")) {
     61                 * setStyleIndex(FLOAT); }
     62                 *
     63                 * if ((keys.containsKey("seamark:type") && keys.get("seamark:type").equals(
     64                 * "beacon_special_purpose")) ||
     65                 * keys.containsKey("seamark:beacon_special_purpose:colour") ||
     66                 * keys.containsKey("seamark:beacon_special_purpose:shape")) { if
     67                 * (keys.containsKey("seamark:beacon_special_purpose:shape") &&
     68                 * keys.get("seamark:beacon_special_purpose:shape").equals("tower"))
     69                 * setStyleIndex(TOWER); else setStyleIndex(BEACON); } else if
     70                 * (keys.containsKey("seamark:light_float:colour") &&
     71                 * keys.get("seamark:light_float:colour").equals("yellow"))
     72                 * setStyleIndex(FLOAT);
     73                 *
     74                 * if (getStyleIndex() >= dlg.cbM01StyleOfMark.getItemCount())
     75                 * setStyleIndex(0);
     76                 *
     77                 * keys = node.getKeys(); if (keys.containsKey("seamark:topmark:shape")) {
     78                 * str = keys.get("seamark:topmark:shape"); setTopMark(true); if
     79                 * (str.equals("x-shape")) { if (keys.containsKey("seamark:topmark:colour"))
     80                 * { if (keys.get("seamark:topmark:colour").equals("red"))
     81                 * setTopMarkIndex(TOP_RED_X); else setTopMarkIndex(TOP_YELLOW_X); } } else
     82                 * if (str.equals("cone, point up")) { setTopMarkIndex(TOP_YELLOW_CONE); }
     83                 * else if (str.equals("cylinder")) { setTopMarkIndex(TOP_YELLOW_CAN); } }
     84                 *
     85                 * parseLights(keys); parseFogRadar(keys);
     86                 *
     87                 * dlg.cbM01StyleOfMark.setSelectedIndex(getStyleIndex());
     88                 * dlg.tfM01Name.setText(getName());
     89                 * dlg.cM01TopMark.setSelected(hasTopMark());
     90                 */}
    11891
    11992        public void setLightColour() {
     
    12295
    12396        public void paintSign() {
    124 /*              if (dlg.paintlock)
    125                         return;
    126                 super.paintSign();
    127 */
     97                /*
     98                 * if (dlg.paintlock) return; super.paintSign();
     99                 */
    128100                if ((getCategory() != Cat.UNKNOWN) && (getShape() != Shp.UNKNOWN)) {
    129101
     
    163135                        if (!image.equals("/images/Special_Purpose")) {
    164136                                image += ".png";
    165                                 dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass()
    166                                                 .getResource(image)));
    167 /*                              if (hasTopMark()) {
    168                                         image = "";
    169                                         switch (getShape()) {
    170                                         case PILLAR:
    171                                         case SPAR:
    172                                                 switch (getTopMarkIndex()) {
    173                                                 case TOP_YELLOW_X:
    174                                                         image = "/images/Top_X_Yellow_Buoy.png";
    175                                                         break;
    176                                                 case TOP_RED_X:
    177                                                         image = "/images/Top_X_Red_Buoy.png";
    178                                                         break;
    179                                                 case TOP_YELLOW_CAN:
    180                                                         image = "/images/Top_Can_Yellow_Buoy.png";
    181                                                         break;
    182                                                 case TOP_YELLOW_CONE:
    183                                                         image = "/images/Top_Cone_Yellow_Buoy.png";
    184                                                         break;
    185                                                 }
    186                                                 break;
    187                                         case CAN:
    188                                         case CONE:
    189                                         case SPHERE:
    190                                         case BARREL:
    191                                                 switch (getTopMarkIndex()) {
    192                                                 case TOP_YELLOW_X:
    193                                                         image = "/images/Top_X_Yellow_Buoy_Small.png";
    194                                                         break;
    195                                                 case TOP_RED_X:
    196                                                         image = "/images/Top_X_Red_Buoy_Small.png";
    197                                                         break;
    198                                                 case TOP_YELLOW_CAN:
    199                                                         image = "/images/Top_Can_Yellow_Buoy_Small.png";
    200                                                         break;
    201                                                 case TOP_YELLOW_CONE:
    202                                                         image = "/images/Top_Cone_Yellow_Buoy_Small.png";
    203                                                         break;
    204                                                 }
    205                                                 break;
    206                                         case BEACON:
    207                                         case TOWER:
    208                                                 switch (getTopMarkIndex()) {
    209                                                 case TOP_YELLOW_X:
    210                                                         image = "/images/Top_X_Yellow_Beacon.png";
    211                                                         break;
    212                                                 case TOP_RED_X:
    213                                                         image = "/images/Top_X_Red_Beacon.png";
    214                                                         break;
    215                                                 case TOP_YELLOW_CAN:
    216                                                         image = "/images/Top_Can_Yellow_Beacon.png";
    217                                                         break;
    218                                                 case TOP_YELLOW_CONE:
    219                                                         image = "/images/Top_Cone_Yellow_Beacon.png";
    220                                                         break;
    221                                                 }
    222                                                 break;
    223                                         case FLOAT:
    224                                                 switch (getTopMarkIndex()) {
    225                                                 case TOP_YELLOW_X:
    226                                                         image = "/images/Top_X_Yellow_Float.png";
    227                                                         break;
    228                                                 case TOP_RED_X:
    229                                                         image = "/images/Top_X_Red_Float.png";
    230                                                         break;
    231                                                 case TOP_YELLOW_CAN:
    232                                                         image = "/images/Top_Can_Yellow_Float.png";
    233                                                         break;
    234                                                 case TOP_YELLOW_CONE:
    235                                                         image = "/images/Top_Cone_Yellow_Float.png";
    236                                                         break;
    237                                                 }
    238                                                 break;
    239                                         }
    240                                         if (!image.isEmpty())
    241                                                 dlg.lM06Icon.setIcon(new ImageIcon(getClass().getResource(image)));
    242                                 }
    243 */                      } else
     137                                dlg.panelMain.topIcon.setIcon(new ImageIcon(getClass().getResource(image)));
     138                                /*
     139                                 * if (hasTopMark()) { image = ""; switch (getShape()) { case PILLAR:
     140                                 * case SPAR: switch (getTopMarkIndex()) { case TOP_YELLOW_X: image =
     141                                 * "/images/Top_X_Yellow_Buoy.png"; break; case TOP_RED_X: image =
     142                                 * "/images/Top_X_Red_Buoy.png"; break; case TOP_YELLOW_CAN: image =
     143                                 * "/images/Top_Can_Yellow_Buoy.png"; break; case TOP_YELLOW_CONE: image
     144                                 * = "/images/Top_Cone_Yellow_Buoy.png"; break; } break; case CAN: case
     145                                 * CONE: case SPHERE: case BARREL: switch (getTopMarkIndex()) { case
     146                                 * TOP_YELLOW_X: image = "/images/Top_X_Yellow_Buoy_Small.png"; break;
     147                                 * case TOP_RED_X: image = "/images/Top_X_Red_Buoy_Small.png"; break;
     148                                 * case TOP_YELLOW_CAN: image = "/images/Top_Can_Yellow_Buoy_Small.png";
     149                                 * break; case TOP_YELLOW_CONE: image =
     150                                 * "/images/Top_Cone_Yellow_Buoy_Small.png"; break; } break; case
     151                                 * BEACON: case TOWER: switch (getTopMarkIndex()) { case TOP_YELLOW_X:
     152                                 * image = "/images/Top_X_Yellow_Beacon.png"; break; case TOP_RED_X:
     153                                 * image = "/images/Top_X_Red_Beacon.png"; break; case TOP_YELLOW_CAN:
     154                                 * image = "/images/Top_Can_Yellow_Beacon.png"; break; case
     155                                 * TOP_YELLOW_CONE: image = "/images/Top_Cone_Yellow_Beacon.png"; break;
     156                                 * } break; case FLOAT: switch (getTopMarkIndex()) { case TOP_YELLOW_X:
     157                                 * image = "/images/Top_X_Yellow_Float.png"; break; case TOP_RED_X:
     158                                 * image = "/images/Top_X_Red_Float.png"; break; case TOP_YELLOW_CAN:
     159                                 * image = "/images/Top_Can_Yellow_Float.png"; break; case
     160                                 * TOP_YELLOW_CONE: image = "/images/Top_Cone_Yellow_Float.png"; break;
     161                                 * } break; } if (!image.isEmpty()) dlg.lM06Icon.setIcon(new
     162                                 * ImageIcon(getClass().getResource(image))); }
     163                                 */} else
    244164                                dlg.panelMain.shapeIcon.setIcon(null);
    245165                }
     
    254174                case PILLAR:
    255175                        super.saveSign("buoy_special_purpose");
    256                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    257                                         "seamark:buoy_special_purpose:shape", "pillar"));
    258                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    259                                         "seamark:buoy_special_purpose:colour", "yellow"));
     176                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "pillar"));
     177                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow"));
    260178                        break;
    261179                case SPAR:
    262180                        super.saveSign("buoy_special_purpose");
    263                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    264                                         "seamark:buoy_special_purpose:shape", "spar"));
    265                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    266                                         "seamark:buoy_special_purpose:colour", "yellow"));
     181                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "spar"));
     182                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow"));
    267183                        break;
    268184                case CAN:
    269185                        super.saveSign("buoy_special_purpose");
    270                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    271                                         "seamark:buoy_special_purpose:shape", "can"));
    272                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    273                                         "seamark:buoy_special_purpose:colour", "yellow"));
     186                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "can"));
     187                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow"));
    274188                        break;
    275189                case CONE:
    276190                        super.saveSign("buoy_special_purpose");
    277                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    278                                         "seamark:buoy_special_purpose:shape", "conical"));
    279                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    280                                         "seamark:buoy_special_purpose:colour", "yellow"));
     191                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "conical"));
     192                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow"));
    281193                        break;
    282194                case SPHERE:
    283195                        super.saveSign("buoy_special_purpose");
    284                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    285                                         "seamark:buoy_special_purpose:shape", "sphere"));
    286                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    287                                         "seamark:buoy_special_purpose:colour", "yellow"));
     196                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "sphere"));
     197                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow"));
    288198                        break;
    289199                case BARREL:
    290200                        super.saveSign("buoy_special_purpose");
    291                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    292                                         "seamark:buoy_special_purpose:shape", "barrel"));
    293                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    294                                         "seamark:buoy_special_purpose:colour", "yellow"));
     201                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "barrel"));
     202                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow"));
    295203                        break;
    296204                case FLOAT:
    297205                        super.saveSign("light_float");
    298                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    299                                         "seamark:light_float:colour", "yellow"));
     206                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "yellow"));
    300207                        break;
    301208                case BEACON:
    302209                        super.saveSign("beacon_special_purpose");
    303                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    304                                         "seamark:beacon_special_purpose:colour", "yellow"));
     210                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_special_purpose:colour", "yellow"));
    305211                        break;
    306212                case TOWER:
    307213                        super.saveSign("beacon_special_purpose");
    308                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    309                                         "seamark:beacon_special_purpose:shape", "tower"));
    310                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    311                                         "seamark:beacon_special_purpose:colour", "yellow"));
     214                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_special_purpose:shape", "tower"));
     215                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_special_purpose:colour", "yellow"));
    312216                        break;
    313217                default:
    314218                }
    315 /*              switch (getTopMarkIndex()) {
    316                 case TOP_YELLOW_X:
    317                         saveTopMarkData("x-shape", "yellow");
    318                         break;
    319                 case TOP_RED_X:
    320                         saveTopMarkData("x-shape", "red");
    321                         break;
    322                 case TOP_YELLOW_CAN:
    323                         saveTopMarkData("cylinder", "yellow");
    324                         break;
    325                 case TOP_YELLOW_CONE:
    326                         saveTopMarkData("cone, point up", "yellow");
    327                         break;
    328                 }
    329 */              saveLightData();
     219                /*
     220                 * switch (getTopMarkIndex()) { case TOP_YELLOW_X:
     221                 * saveTopMarkData("x-shape", "yellow"); break; case TOP_RED_X:
     222                 * saveTopMarkData("x-shape", "red"); break; case TOP_YELLOW_CAN:
     223                 * saveTopMarkData("cylinder", "yellow"); break; case TOP_YELLOW_CONE:
     224                 * saveTopMarkData("cone, point up", "yellow"); break; }
     225                 */saveLightData();
    330226                saveRadarFogData();
    331227        }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java

    r24835 r24839  
    66import java.util.regex.Pattern;
    77
     8import javax.swing.ImageIcon;
     9
    810import org.openstreetmap.josm.Main;
    911import org.openstreetmap.josm.command.ChangePropertyCommand;
     
    1820
    1921        public enum Cat {
    20                 UNKNOWN, LAT_PORT, LAT_STBD, LAT_PREF_PORT, LAT_PREF_STBD,
    21                 CARD_NORTH, CARD_EAST, CARD_SOUTH, CARD_WEST,
    22                 LIGHT_HOUSE, LIGHT_MAJOR, LIGHT_MINOR, LIGHT_VESSEL, LIGHT_FLOAT
     22                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
    2323        }
    2424
     
    2828
    2929        public enum Col {
    30                 UNKNOWN, WHITE, RED, ORANGE, AMBER, YELLOW, GREEN, BLUE, VIOLET, BLACK,
    31                 RED_GREEN_RED, GREEN_RED_GREEN, RED_WHITE, BLACK_YELLOW, BLACK_YELLOW_BLACK, YELLOW_BLACK, YELLOW_BLACK_YELLOW, BLACK_RED_BLACK
     30                UNKNOWN, WHITE, RED, ORANGE, AMBER, YELLOW, GREEN, BLUE, VIOLET, BLACK, RED_GREEN_RED, GREEN_RED_GREEN, RED_WHITE, BLACK_YELLOW, BLACK_YELLOW_BLACK, YELLOW_BLACK, YELLOW_BLACK_YELLOW, BLACK_RED_BLACK
    3231        }
    3332
     
    379378
    380379                        if (matcher.find()) {
    381 //                              setErrMsg(null);
     380                                // setErrMsg(null);
    382381                        } else {
    383 //                              setErrMsg("Must be a number");
     382                                // setErrMsg("Must be a number");
    384383                                lightPeriod = "";
    385 //                              dlg.tfM01RepeatTime.requestFocus();
     384                                // dlg.tfM01RepeatTime.requestFocus();
    386385                        }
    387386                }
     
    448447                        }
    449448                }
    450                 setSectorIndex(0);
    451 //              dlg.cbM01Sector.setSelectedIndex(0);
    452 //              dlg.cM01Fired.setSelected(isFired());
    453 //              dlg.rbM01Fired1.setSelected(!isSectored());
    454 //              dlg.rbM01FiredN.setSelected(isSectored());
    455 //              dlg.cbM01Kennung.setSelectedItem(getLightChar());
    456 //              dlg.tfM01Height.setText(getHeight());
    457 //              dlg.tfM01Range.setText(getRange());
    458 //              dlg.tfM01Group.setText(getLightGroup());
    459 //              dlg.tfM01RepeatTime.setText(getLightPeriod());
    460 //              dlg.cbM01Colour.setSelectedItem(getLightColour());
    461449        }
    462450
     
    466454                setRadar(false);
    467455                setRacon(false);
    468                 if (k.containsKey("seamark:fog_signal")
    469                                 || k.containsKey("seamark:fog_signal:category")
    470                                 || k.containsKey("seamark:fog_signal:group")
    471                                 || k.containsKey("seamark:fog_signal:period")) {
     456                if (k.containsKey("seamark:fog_signal") || k.containsKey("seamark:fog_signal:category")
     457                                || k.containsKey("seamark:fog_signal:group") || k.containsKey("seamark:fog_signal:period")) {
    472458                        setFog(true);
    473459                        if (k.containsKey("seamark:fog_signal:category")) {
     
    495481                                setFogPeriod(k.get("seamark:fog_signal:period"));
    496482                }
    497 //              dlg.cM01Fog.setSelected(hasFog());
    498 //              dlg.cbM01Fog.setSelectedIndex(getFogSound());
    499 //              dlg.tfM01FogGroup.setText(getFogGroup());
    500 //              dlg.tfM01FogPeriod.setText(getFogPeriod());
    501 
    502                 if (k.containsKey("seamark:radar_transponder")
    503                                 || k.containsKey("seamark:radar_transponder:category")
     483
     484                if (k.containsKey("seamark:radar_transponder") || k.containsKey("seamark:radar_transponder:category")
    504485                                || k.containsKey("seamark:radar_transponder:group")) {
    505486                        setRacon(true);
     
    519500                } else if (k.containsKey("seamark:radar_reflector"))
    520501                        setRadar(true);
    521 //              dlg.cM01Radar.setSelected(hasRadar());
    522 //              dlg.cM01Racon.setSelected(hasRacon());
    523 //              dlg.cbM01Racon.setSelectedIndex(getRaType());
    524 //              dlg.tfM01Racon.setText(getRaconGroup());
    525         }
    526 
    527         public abstract void paintSign();
     502        }
     503
     504        public void paintSign() {
     505                /*
     506                 * dlg.lM01NameMark.setText(getName());
     507                 *
     508                 * dlg.bM01Save.setEnabled(true);
     509                 *
     510                 * dlg.cM01TopMark.setSelected(hasTopMark());
     511                 * dlg.cM01Fired.setSelected(isFired());
     512                 *
     513                 * dlg.tfM01RepeatTime.setText(getLightPeriod());
     514                 *
     515                 * dlg.tfM01Name.setText(getName()); dlg.tfM01Name.setEnabled(true);
     516                 *
     517                 * if (hasRadar()) { dlg.lM03Icon.setIcon(new
     518                 * ImageIcon(getClass().getResource( "/images/Radar_Reflector_355.png"))); }
     519                 *
     520                 * else if (hasRacon()) { dlg.lM04Icon.setIcon(new
     521                 * ImageIcon(getClass().getResource( "/images/Radar_Station.png"))); if
     522                 * (getRaType() != 0) { String c = (String)
     523                 * dlg.cbM01Racon.getSelectedItem(); if ((getRaType() == RATYPE_RACON) &&
     524                 * !getRaconGroup().isEmpty()) c += ("(" + getRaconGroup() + ")");
     525                 * dlg.lM01RadarMark.setText(c); } dlg.cbM01Racon.setVisible(true); if
     526                 * (getRaType() == RATYPE_RACON) { dlg.lM01Racon.setVisible(true);
     527                 * dlg.tfM01Racon.setVisible(true); dlg.tfM01Racon.setEnabled(true); } else
     528                 * { dlg.lM01Racon.setVisible(false); dlg.tfM01Racon.setVisible(false); } }
     529                 * else { dlg.cbM01Racon.setVisible(false); dlg.lM01Racon.setVisible(false);
     530                 * dlg.tfM01Racon.setVisible(false); }
     531                 *
     532                 * if (hasFog()) { dlg.lM05Icon.setIcon(new
     533                 * ImageIcon(getClass().getResource( "/images/Fog_Signal.png"))); if
     534                 * (getFogSound() != 0) { String c = (String)
     535                 * dlg.cbM01Fog.getSelectedItem(); if (!getFogGroup().isEmpty()) c += ("(" +
     536                 * getFogGroup() + ")"); if (!getFogPeriod().isEmpty()) c += (" " +
     537                 * getFogPeriod() + "s"); dlg.lM01FogMark.setText(c); }
     538                 * dlg.cbM01Fog.setVisible(true); if (getFogSound() == 0) {
     539                 * dlg.lM01FogGroup.setVisible(false); dlg.tfM01FogGroup.setVisible(false);
     540                 * dlg.lM01FogPeriod.setVisible(false);
     541                 * dlg.tfM01FogPeriod.setVisible(false); } else {
     542                 * dlg.lM01FogGroup.setVisible(true); dlg.tfM01FogGroup.setVisible(true);
     543                 * dlg.lM01FogPeriod.setVisible(true); dlg.tfM01FogPeriod.setVisible(true);
     544                 * } } else { dlg.cbM01Fog.setVisible(false);
     545                 * dlg.lM01FogGroup.setVisible(false); dlg.tfM01FogGroup.setVisible(false);
     546                 * dlg.lM01FogPeriod.setVisible(false);
     547                 * dlg.tfM01FogPeriod.setVisible(false); }
     548                 *
     549                 * if (isFired()) { String lp, c; String tmp = null; int i1;
     550                 *
     551                 * String col = getLightColour(); if (col.equals("W")) {
     552                 * dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource(
     553                 * "/images/Light_White_120.png")));
     554                 * dlg.cbM01Colour.setSelectedIndex(WHITE_LIGHT); } else if
     555                 * (col.equals("R")) { dlg.lM02Icon.setIcon(new
     556                 * ImageIcon(getClass().getResource( "/images/Light_Red_120.png")));
     557                 * dlg.cbM01Colour.setSelectedIndex(RED_LIGHT); } else if (col.equals("G"))
     558                 * { dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource(
     559                 * "/images/Light_Green_120.png")));
     560                 * dlg.cbM01Colour.setSelectedIndex(GREEN_LIGHT); } else {
     561                 * dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource(
     562                 * "/images/Light_Magenta_120.png")));
     563                 * dlg.cbM01Colour.setSelectedIndex(UNKNOWN_COLOUR); }
     564                 *
     565                 * c = getLightChar(); dlg.cbM01Kennung.setSelectedItem(c); if
     566                 * (c.contains("+")) { i1 = c.indexOf("+"); tmp = c.substring(i1,
     567                 * c.length()); c = c.substring(0, i1); if (!getLightGroup().isEmpty()) { c
     568                 * = c + "(" + getLightGroup() + ")"; } if (tmp != null) c = c + tmp;
     569                 * dlg.cbM01Kennung.setSelectedItem(c); } else if
     570                 * (!getLightGroup().isEmpty()) c = c + "(" + getLightGroup() + ")"; if
     571                 * (dlg.cbM01Kennung.getSelectedIndex() == 0)
     572                 * dlg.cbM01Kennung.setSelectedItem(c); c = c + " " + getLightColour(); lp =
     573                 * getLightPeriod(); if (!lp.isEmpty()) c = c + " " + lp + "s";
     574                 * dlg.lM01FireMark.setText(c); dlg.cM01Fired.setVisible(true);
     575                 * dlg.lM01Kennung.setVisible(true); dlg.cbM01Kennung.setVisible(true); if
     576                 * (((String) dlg.cbM01Kennung.getSelectedItem()).contains("(")) {
     577                 * dlg.tfM01Group.setVisible(false); dlg.lM01Group.setVisible(false); } else
     578                 * { dlg.lM01Group.setVisible(true); dlg.tfM01Group.setVisible(true); }
     579                 * dlg.tfM01Group.setText(getLightGroup());
     580                 * dlg.lM01RepeatTime.setVisible(true);
     581                 * dlg.tfM01RepeatTime.setVisible(true); if (isSectored()) {
     582                 * dlg.rbM01Fired1.setSelected(false); dlg.rbM01FiredN.setSelected(true); if
     583                 * ((getSectorIndex() != 0) && (!LightChar[0].isEmpty()))
     584                 * dlg.cbM01Kennung.setEnabled(false); else
     585                 * dlg.cbM01Kennung.setEnabled(true);
     586                 * dlg.cbM01Kennung.setSelectedItem(getLightChar()); if ((getSectorIndex()
     587                 * != 0) && (!LightGroup[0].isEmpty())) dlg.tfM01Group.setEnabled(false);
     588                 * else dlg.tfM01Group.setEnabled(true);
     589                 * dlg.tfM01Group.setText(getLightGroup()); if ((getSectorIndex() != 0) &&
     590                 * (!LightPeriod[0].isEmpty())) dlg.tfM01RepeatTime.setEnabled(false); else
     591                 * dlg.tfM01RepeatTime.setEnabled(true);
     592                 * dlg.tfM01RepeatTime.setText(getLightPeriod()); if ((getSectorIndex() !=
     593                 * 0) && (!Height[0].isEmpty())) dlg.tfM01Height.setEnabled(false); else
     594                 * dlg.tfM01Height.setEnabled(true); dlg.tfM01Height.setText(getHeight());
     595                 * if ((getSectorIndex() != 0) && (!Range[0].isEmpty()))
     596                 * dlg.tfM01Range.setEnabled(false); else dlg.tfM01Range.setEnabled(true);
     597                 * dlg.tfM01Range.setText(getRange()); dlg.lM01Sector.setVisible(true);
     598                 * dlg.cbM01Sector.setVisible(true); } else { } } else { } } else {
     599                 */}
    528600
    529601        public void saveSign(String type) {
    530                 delSeaMarkKeys(dlg.node);
    531 
    532                 String str = dlg.panelMain.nameBox.getText();
    533                 if (!str.isEmpty())
    534                         Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
    535                                         "seamark:name", str));
    536                 Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type",
    537                                 type));
    538         }
    539 
    540         protected void saveLightData() {
    541 /*              String colour;
    542                 if (dlg.cM01Fired.isSelected()) {
    543                         if (!(colour = LightColour[0]).isEmpty())
    544                                 if (colour.equals("R")) {
    545                                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    546                                                         "seamark:light:colour", "red"));
    547                                 } else if (colour.equals("G")) {
    548                                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    549                                                         "seamark:light:colour", "green"));
    550                                 } else if (colour.equals("W")) {
    551                                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    552                                                         "seamark:light:colour", "white"));
    553                                 }
    554 
    555                         if (!LightPeriod[0].isEmpty())
    556                                 Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    557                                                 "seamark:light:period", LightPeriod[0]));
    558 
    559                         if (!LightChar[0].isEmpty())
    560                                 Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    561                                                 "seamark:light:character", LightChar[0]));
    562 
    563                         if (!LightGroup[0].isEmpty())
    564                                 Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    565                                                 "seamark:light:group", LightGroup[0]));
    566 
    567                         if (!Height[0].isEmpty())
    568                                 Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    569                                                 "seamark:light:height", Height[0]));
    570 
    571                         if (!Range[0].isEmpty())
    572                                 Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    573                                                 "seamark:light:range", Range[0]));
    574 
    575                         for (int i = 1; i < 10; i++) {
    576                                 if ((colour = LightColour[i]) != null)
    577                                         if (colour.equals("R")) {
    578                                                 Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    579                                                                 "seamark:light:" + i + ":colour", "red"));
    580                                                 if ((Bearing1[i] != null) && (Bearing2[i] != null)
    581                                                                 && (Radius[i] != null))
    582                                                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    583                                                                         "seamark:light:" + i, "red:" + Bearing1[i] + ":"
    584                                                                                         + Bearing2[i] + ":" + Radius[i]));
    585                                         } else if (colour.equals("G")) {
    586                                                 Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    587                                                                 "seamark:light:" + i + ":colour", "green"));
    588                                                 if ((Bearing1[i] != null) && (Bearing2[i] != null)
    589                                                                 && (Radius[i] != null))
    590                                                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    591                                                                         "seamark:light:" + i, "green:" + Bearing1[i] + ":"
    592                                                                                         + Bearing2[i] + ":" + Radius[i]));
    593                                         } else if (colour.equals("W")) {
    594                                                 Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    595                                                                 "seamark:light:" + i + ":colour", "white"));
    596                                                 if ((Bearing1[i] != null) && (Bearing2[i] != null)
    597                                                                 && (Radius[i] != null))
    598                                                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    599                                                                         "seamark:light:" + i, "white:" + Bearing1[i] + ":"
    600                                                                                         + Bearing2[i] + ":" + Radius[i]));
    601                                         }
    602 
    603                                 if (LightPeriod[i] != null)
    604                                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    605                                                         "seamark:light:" + i + ":period", LightPeriod[i]));
    606 
    607                                 if (LightChar[i] != null)
    608                                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    609                                                         "seamark:light:" + i + ":character", LightChar[i]));
    610 
    611                                 if (LightGroup[i] != null)
    612                                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    613                                                         "seamark:light:" + i + ":group", LightGroup[i]));
    614 
    615                                 if (Height[i] != null)
    616                                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    617                                                         "seamark:light:" + i + ":height", Height[i]));
    618 
    619                                 if (Range[i] != null)
    620                                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    621                                                         "seamark:light:" + i + ":range", Range[i]));
    622 
    623                                 if (Bearing1[i] != null)
    624                                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    625                                                         "seamark:light:" + i + ":sector_start", Bearing1[i]));
    626 
    627                                 if (Bearing2[i] != null)
    628                                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    629                                                         "seamark:light:" + i + ":sector_end", Bearing2[i]));
    630                         }
    631                 }
    632 */      }
    633 
    634         protected void saveTopMarkData(String shape, String colour) {
    635 /*              if (hasTopMark()) {
    636                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    637                                         "seamark:topmark:shape", shape));
    638                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    639                                         "seamark:topmark:colour", colour));
    640                 }
    641 */      }
    642 
    643         protected void saveRadarFogData() {
    644 /*              if (hasRadar()) {
    645                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    646                                         "seamark:radar_reflector", "yes"));
    647                 }
    648                 if (hasRacon()) {
    649                         switch (RaType) {
    650                         case RATYPE_RACON:
    651                                 Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    652                                                 "seamark:radar_transponder:category", "racon"));
    653                                 if (!getRaconGroup().isEmpty())
    654                                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    655                                                         "seamark:radar_transponder:group", getRaconGroup()));
    656                                 break;
    657                         case RATYPE_RAMARK:
    658                                 Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    659                                                 "seamark:radar_transponder:category", "ramark"));
    660                                 break;
    661                         case RATYPE_LEADING:
    662                                 Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    663                                                 "seamark:radar_transponder:category", "leading"));
    664                                 break;
    665                         default:
    666                                 Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    667                                                 "seamark:radar_transponder", "yes"));
    668                         }
    669                 }
    670                 if (hasFog()) {
    671                         if (getFogSound() == 0) {
    672                                 Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    673                                                 "seamark:fog_signal", "yes"));
    674                         } else {
    675                                 switch (getFogSound()) {
    676                                 case FOG_HORN:
    677                                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    678                                                         "seamark:fog_signal:category", "horn"));
    679                                         break;
    680                                 case FOG_SIREN:
    681                                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    682                                                         "seamark:fog_signal:category", "siren"));
    683                                         break;
    684                                 case FOG_DIA:
    685                                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    686                                                         "seamark:fog_signal:category", "diaphone"));
    687                                         break;
    688                                 case FOG_BELL:
    689                                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    690                                                         "seamark:fog_signal:category", "bell"));
    691                                         break;
    692                                 case FOG_WHIS:
    693                                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    694                                                         "seamark:fog_signal:category", "whistle"));
    695                                         break;
    696                                 case FOG_GONG:
    697                                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    698                                                         "seamark:fog_signal:category", "gong"));
    699                                         break;
    700                                 case FOG_EXPLOS:
    701                                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    702                                                         "seamark:fog_signal:category", "explosive"));
    703                                         break;
    704                                 }
    705                                 if (!getFogGroup().isEmpty())
    706                                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    707                                                         "seamark:fog_signal:group", getFogGroup()));
    708                                 if (!getFogPeriod().isEmpty())
    709                                         Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    710                                                         "seamark:fog_signal:period", getFogPeriod()));
    711                         }
    712                 }
    713 */      }
    714 
    715         protected void delSeaMarkKeys(Node node) {
    716                 Iterator<String> it = node.getKeys().keySet().iterator();
     602                Iterator<String> it = dlg.node.getKeys().keySet().iterator();
    717603                String str;
    718604
    719605                while (it.hasNext()) {
    720606                        str = it.next();
    721 
    722                         if (str.contains("seamark") == true)
    723                                 if (str.compareTo("seamark") != 0) {
    724                                         Main.main.undoRedo.add(new ChangePropertyCommand(node, str,
    725                                                         null));
     607                        if (str.contains("seamark"))
     608                                if (!str.equals("seamark")) {
     609                                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, str, null));
    726610                                }
    727611                }
    728         }
     612                str = dlg.panelMain.nameBox.getText();
     613                if (!str.isEmpty())
     614                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:name", str));
     615                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", type));
     616        }
     617
     618        protected void saveLightData() {
     619                /*
     620                 * String colour; if (dlg.cM01Fired.isSelected()) { if (!(colour =
     621                 * LightColour[0]).isEmpty()) if (colour.equals("R")) {
     622                 * Main.main.undoRedo.add(new ChangePropertyCommand(Node,
     623                 * "seamark:light:colour", "red")); } else if (colour.equals("G")) {
     624                 * Main.main.undoRedo.add(new ChangePropertyCommand(Node,
     625                 * "seamark:light:colour", "green")); } else if (colour.equals("W")) {
     626                 * Main.main.undoRedo.add(new ChangePropertyCommand(Node,
     627                 * "seamark:light:colour", "white")); }
     628                 *
     629                 * if (!LightPeriod[0].isEmpty()) Main.main.undoRedo.add(new
     630                 * ChangePropertyCommand(Node, "seamark:light:period", LightPeriod[0]));
     631                 *
     632                 * if (!LightChar[0].isEmpty()) Main.main.undoRedo.add(new
     633                 * ChangePropertyCommand(Node, "seamark:light:character", LightChar[0]));
     634                 *
     635                 * if (!LightGroup[0].isEmpty()) Main.main.undoRedo.add(new
     636                 * ChangePropertyCommand(Node, "seamark:light:group", LightGroup[0]));
     637                 *
     638                 * if (!Height[0].isEmpty()) Main.main.undoRedo.add(new
     639                 * ChangePropertyCommand(Node, "seamark:light:height", Height[0]));
     640                 *
     641                 * if (!Range[0].isEmpty()) Main.main.undoRedo.add(new
     642                 * ChangePropertyCommand(Node, "seamark:light:range", Range[0]));
     643                 *
     644                 * for (int i = 1; i < 10; i++) { if ((colour = LightColour[i]) != null) if
     645                 * (colour.equals("R")) { Main.main.undoRedo.add(new
     646                 * ChangePropertyCommand(Node, "seamark:light:" + i + ":colour", "red")); if
     647                 * ((Bearing1[i] != null) && (Bearing2[i] != null) && (Radius[i] != null))
     648                 * Main.main.undoRedo.add(new ChangePropertyCommand(Node, "seamark:light:" +
     649                 * i, "red:" + Bearing1[i] + ":" + Bearing2[i] + ":" + Radius[i])); } else
     650                 * if (colour.equals("G")) { Main.main.undoRedo.add(new
     651                 * ChangePropertyCommand(Node, "seamark:light:" + i + ":colour", "green"));
     652                 * if ((Bearing1[i] != null) && (Bearing2[i] != null) && (Radius[i] !=
     653                 * null)) Main.main.undoRedo.add(new ChangePropertyCommand(Node,
     654                 * "seamark:light:" + i, "green:" + Bearing1[i] + ":" + Bearing2[i] + ":" +
     655                 * Radius[i])); } else if (colour.equals("W")) { Main.main.undoRedo.add(new
     656                 * ChangePropertyCommand(Node, "seamark:light:" + i + ":colour", "white"));
     657                 * if ((Bearing1[i] != null) && (Bearing2[i] != null) && (Radius[i] !=
     658                 * null)) Main.main.undoRedo.add(new ChangePropertyCommand(Node,
     659                 * "seamark:light:" + i, "white:" + Bearing1[i] + ":" + Bearing2[i] + ":" +
     660                 * Radius[i])); }
     661                 *
     662                 * if (LightPeriod[i] != null) Main.main.undoRedo.add(new
     663                 * ChangePropertyCommand(Node, "seamark:light:" + i + ":period",
     664                 * LightPeriod[i]));
     665                 *
     666                 * if (LightChar[i] != null) Main.main.undoRedo.add(new
     667                 * ChangePropertyCommand(Node, "seamark:light:" + i + ":character",
     668                 * LightChar[i]));
     669                 *
     670                 * if (LightGroup[i] != null) Main.main.undoRedo.add(new
     671                 * ChangePropertyCommand(Node, "seamark:light:" + i + ":group",
     672                 * LightGroup[i]));
     673                 *
     674                 * if (Height[i] != null) Main.main.undoRedo.add(new
     675                 * ChangePropertyCommand(Node, "seamark:light:" + i + ":height",
     676                 * Height[i]));
     677                 *
     678                 * if (Range[i] != null) Main.main.undoRedo.add(new
     679                 * ChangePropertyCommand(Node, "seamark:light:" + i + ":range", Range[i]));
     680                 *
     681                 * if (Bearing1[i] != null) Main.main.undoRedo.add(new
     682                 * ChangePropertyCommand(Node, "seamark:light:" + i + ":sector_start",
     683                 * Bearing1[i]));
     684                 *
     685                 * if (Bearing2[i] != null) Main.main.undoRedo.add(new
     686                 * ChangePropertyCommand(Node, "seamark:light:" + i + ":sector_end",
     687                 * Bearing2[i])); } }
     688                 */}
     689
     690        protected void saveTopMarkData(String shape, String colour) {
     691                /*
     692                 * if (hasTopMark()) { Main.main.undoRedo.add(new
     693                 * ChangePropertyCommand(Node, "seamark:topmark:shape", shape));
     694                 * Main.main.undoRedo.add(new ChangePropertyCommand(Node,
     695                 * "seamark:topmark:colour", colour)); }
     696                 */}
     697
     698        protected void saveRadarFogData() {
     699                /*
     700                 * if (hasRadar()) { Main.main.undoRedo.add(new ChangePropertyCommand(Node,
     701                 * "seamark:radar_reflector", "yes")); } if (hasRacon()) { switch (RaType) {
     702                 * case RATYPE_RACON: Main.main.undoRedo.add(new ChangePropertyCommand(Node,
     703                 * "seamark:radar_transponder:category", "racon")); if
     704                 * (!getRaconGroup().isEmpty()) Main.main.undoRedo.add(new
     705                 * ChangePropertyCommand(Node, "seamark:radar_transponder:group",
     706                 * getRaconGroup())); break; case RATYPE_RAMARK: Main.main.undoRedo.add(new
     707                 * ChangePropertyCommand(Node, "seamark:radar_transponder:category",
     708                 * "ramark")); break; case RATYPE_LEADING: Main.main.undoRedo.add(new
     709                 * ChangePropertyCommand(Node, "seamark:radar_transponder:category",
     710                 * "leading")); break; default: Main.main.undoRedo.add(new
     711                 * ChangePropertyCommand(Node, "seamark:radar_transponder", "yes")); } } if
     712                 * (hasFog()) { if (getFogSound() == 0) { Main.main.undoRedo.add(new
     713                 * ChangePropertyCommand(Node, "seamark:fog_signal", "yes")); } else {
     714                 * switch (getFogSound()) { case FOG_HORN: Main.main.undoRedo.add(new
     715                 * ChangePropertyCommand(Node, "seamark:fog_signal:category", "horn"));
     716                 * break; case FOG_SIREN: Main.main.undoRedo.add(new
     717                 * ChangePropertyCommand(Node, "seamark:fog_signal:category", "siren"));
     718                 * break; case FOG_DIA: Main.main.undoRedo.add(new
     719                 * ChangePropertyCommand(Node, "seamark:fog_signal:category", "diaphone"));
     720                 * break; case FOG_BELL: Main.main.undoRedo.add(new
     721                 * ChangePropertyCommand(Node, "seamark:fog_signal:category", "bell"));
     722                 * break; case FOG_WHIS: Main.main.undoRedo.add(new
     723                 * ChangePropertyCommand(Node, "seamark:fog_signal:category", "whistle"));
     724                 * break; case FOG_GONG: Main.main.undoRedo.add(new
     725                 * ChangePropertyCommand(Node, "seamark:fog_signal:category", "gong"));
     726                 * break; case FOG_EXPLOS: Main.main.undoRedo.add(new
     727                 * ChangePropertyCommand(Node, "seamark:fog_signal:category", "explosive"));
     728                 * break; } if (!getFogGroup().isEmpty()) Main.main.undoRedo.add(new
     729                 * ChangePropertyCommand(Node, "seamark:fog_signal:group", getFogGroup()));
     730                 * if (!getFogPeriod().isEmpty()) Main.main.undoRedo.add(new
     731                 * ChangePropertyCommand(Node, "seamark:fog_signal:period",
     732                 * getFogPeriod())); } }
     733                 */}
    729734
    730735}
Note: See TracChangeset for help on using the changeset viewer.