Changeset 24870 in osm for applications


Ignore:
Timestamp:
2010-12-24T21:56:55+01:00 (14 years ago)
Author:
malcolmh
Message:

save

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

Legend:

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

    r24839 r24870  
    3030        private boolean region;
    3131        private ButtonGroup catButtons = null;
    32         public JRadioButton portButton = null;
    33         public JRadioButton stbdButton = null;
    34         public JRadioButton prefPortButton = null;
    35         public JRadioButton prefStbdButton = null;
    36         public JRadioButton safeWaterButton = null;
     32        public JRadioButton portButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PortButton.png")));
     33        public JRadioButton stbdButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/StbdButton.png")));
     34        public JRadioButton prefPortButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PrefPortButton.png")));
     35        public JRadioButton prefStbdButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PrefStbdButton.png")));
     36        public JRadioButton safeWaterButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SafeWaterButton.png")));
    3737        private ActionListener alCat = null;
    3838        public PanelPort panelPort = null;
     
    6565                this.add(panelPrefStbd, null);
    6666                this.add(panelSafeWater, null);
    67                 this.add(getPortButton(), null);
    68                 this.add(getStbdButton(), null);
    69                 this.add(getPrefPortButton(), null);
    70                 this.add(getPrefStbdButton(), null);
    71                 this.add(getSafeWaterButton(), null);
     67                this.add(getButton(portButton, 0, 0, 52, 32, "PortTip"), null);
     68                this.add(getButton(stbdButton, 0, 32, 52, 32, "StbdTip"), null);
     69                this.add(getButton(prefPortButton, 0, 64, 52, 32, "PrefPortTip"), null);
     70                this.add(getButton(prefStbdButton, 0, 96, 52, 32, "PrefStbdTip"), null);
     71                this.add(getButton(safeWaterButton, 0, 128, 52, 32, "SafeWaterTip"), null);
    7272                catButtons = new ButtonGroup();
    7373                catButtons.add(portButton);
     
    182182        }
    183183
    184         private JRadioButton getPortButton() {
    185                 if (portButton == null) {
    186                         portButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PortButton.png")));
    187                         portButton.setBounds(new Rectangle(0, 0, 52, 32));
    188                         portButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    189                         portButton.setToolTipText(Messages.getString("PortTip"));
    190                 }
    191                 return portButton;
    192         }
    193 
    194         private JRadioButton getStbdButton() {
    195                 if (stbdButton == null) {
    196                         stbdButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/StbdButton.png")));
    197                         stbdButton.setBounds(new Rectangle(0, 32, 52, 32));
    198                         stbdButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    199                         stbdButton.setToolTipText(Messages.getString("StbdTip"));
    200                 }
    201                 return stbdButton;
    202         }
    203 
    204         private JRadioButton getPrefPortButton() {
    205                 if (prefPortButton == null) {
    206                         prefPortButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PrefPortButton.png")));
    207                         prefPortButton.setBounds(new Rectangle(0, 64, 52, 32));
    208                         prefPortButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    209                         prefPortButton.setToolTipText(Messages.getString("PrefPortTip"));
    210                 }
    211                 return prefPortButton;
    212         }
    213 
    214         private JRadioButton getPrefStbdButton() {
    215                 if (prefStbdButton == null) {
    216                         prefStbdButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PrefStbdButton.png")));
    217                         prefStbdButton.setBounds(new Rectangle(0, 96, 52, 32));
    218                         prefStbdButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    219                         prefStbdButton.setToolTipText(Messages.getString("PrefStbdTip"));
    220                 }
    221                 return prefStbdButton;
    222         }
    223 
    224         private JRadioButton getSafeWaterButton() {
    225                 if (safeWaterButton == null) {
    226                         safeWaterButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SafeWaterButton.png")));
    227                         safeWaterButton.setBounds(new Rectangle(0, 128, 52, 32));
    228                         safeWaterButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    229                         safeWaterButton.setToolTipText(Messages.getString("SafeWaterTip"));
    230                 }
    231                 return safeWaterButton;
     184        private JRadioButton getButton(JRadioButton button, int x, int y, int w, int h, String tip) {
     185                button.setBounds(new Rectangle(x, y, w, h));
     186                button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     187                button.setToolTipText(Messages.getString(tip));
     188                return button;
    232189        }
    233190
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelCol.java

    r24839 r24870  
    33import static org.openstreetmap.josm.tools.I18n.tr;
    44
     5import java.awt.Color;
     6import java.awt.Rectangle;
     7import java.awt.event.ActionListener;
     8
    59import javax.swing.BorderFactory;
    610import javax.swing.JPanel;
    7 
    8 import java.awt.Color;
    9 import java.awt.Rectangle;
    10 
    1111import javax.swing.ButtonGroup;
    1212import javax.swing.ImageIcon;
    1313import javax.swing.JRadioButton;
    1414
    15 import oseam.Messages;
     15
     16import java.util.EnumMap;
     17import java.util.Iterator;
     18
    1619import oseam.dialogs.OSeaMAction;
    17 
    18 import java.awt.event.ActionListener;
     20import oseam.seamarks.SeaMark.Col;
    1921
    2022public class PanelCol extends JPanel {
     
    2224        private OSeaMAction dlg;
    2325        private ButtonGroup colourButtons = null;
    24         public JRadioButton offButton = null;
    25         public JRadioButton whiteButton = null;
    26         public JRadioButton redButton = null;
    27         public JRadioButton orangeButton = null;
    28         public JRadioButton amberButton = null;
    29         public JRadioButton yellowButton = null;
    30         public JRadioButton greenButton = null;
    31         public JRadioButton blueButton = null;
    32         public JRadioButton violetButton = null;
    33         public JRadioButton blackButton = null;
     26        public JRadioButton offButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png")));
     27        public JRadioButton whiteButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/WhiteButton.png")));
     28        public JRadioButton redButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RedButton.png")));
     29        public JRadioButton orangeButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OrangeButton.png")));
     30        public JRadioButton amberButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/AmberButton.png")));
     31        public JRadioButton yellowButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/YellowButton.png")));
     32        public JRadioButton greenButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/GreenButton.png")));
     33        public JRadioButton blueButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BlueButton.png")));
     34        public JRadioButton violetButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/VioletButton.png")));
     35        public JRadioButton blackButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BlackButton.png")));
    3436        private ActionListener alColour = null;
     37        private EnumMap<Col, JRadioButton> colours = new EnumMap<Col, JRadioButton>(Col.class);
    3538
    3639        public PanelCol(OSeaMAction dia) {
    3740                dlg = dia;
    3841                this.setLayout(null);
    39                 this.add(getOffButton(), null);
    40                 this.add(getWhiteButton(), null);
    41                 this.add(getRedButton(), null);
    42                 this.add(getOrangeButton(), null);
    43                 this.add(getAmberButton(), null);
    44                 this.add(getYellowButton(), null);
    45                 this.add(getGreenButton(), null);
    46                 this.add(getBlueButton(), null);
    47                 this.add(getVioletButton(), null);
    48                 this.add(getBlackButton(), null);
     42                this.add(getButton(offButton, 0, 0, 34, 16, "No colour", Col.UNKNOWN), null);
     43                this.add(getButton(whiteButton, 0, 16, 34, 16, "White", Col.WHITE), null);
     44                this.add(getButton(redButton, 0, 32, 34, 16, "Red", Col.RED), null);
     45                this.add(getButton(orangeButton, 0, 48, 34, 16, "Orange", Col.ORANGE), null);
     46                this.add(getButton(amberButton, 0, 64, 34, 16, "Amber", Col.AMBER), null);
     47                this.add(getButton(yellowButton, 0, 80, 34, 16, "Yellow", Col.YELLOW), null);
     48                this.add(getButton(greenButton, 0, 96, 34, 16, "Green", Col.GREEN), null);
     49                this.add(getButton(blueButton, 0, 112, 34, 16, "Blue", Col.BLUE), null);
     50                this.add(getButton(violetButton, 0, 128, 34, 16, "Violet", Col.VIOLET), null);
     51                this.add(getButton(blackButton, 0, 144, 34, 16, "Black", Col.BLACK), null);
    4952                colourButtons = new ButtonGroup();
     53                colourButtons.add(offButton);
    5054                colourButtons.add(whiteButton);
    51                 colourButtons.add(offButton);
    5255                colourButtons.add(redButton);
    5356                colourButtons.add(orangeButton);
     
    6063                alColour = new ActionListener() {
    6164                        public void actionPerformed(java.awt.event.ActionEvent e) {
    62                                 offButton.setBorderPainted(offButton.isSelected());
     65                                Iterator<Col> it = colours.keySet().iterator();
     66                                while (it.hasNext()) {
     67                                        Col col = it.next();
     68                                        JRadioButton button = colours.get(col);
     69                                        if (button.isSelected()) {
     70                                                switch (col) {
     71                                                case UNKNOWN: {
     72                                                        break;
     73                                                }
     74                                                }
     75                                                button.setBorderPainted(true);
     76                                        } else button.setBorderPainted(false);
     77                                }
     78/*                              offButton.setBorderPainted(offButton.isSelected());
    6379                                whiteButton.setBorderPainted(whiteButton.isSelected());
    6480                                redButton.setBorderPainted(redButton.isSelected());
     
    7086                                violetButton.setBorderPainted(violetButton.isSelected());
    7187                                blackButton.setBorderPainted(blackButton.isSelected());
    72                         }
     88*/                      }
    7389                };
    7490                offButton.addActionListener(alColour);
     
    89105        }
    90106
    91         private JRadioButton getOffButton() {
    92                 if (offButton == null) {
    93                         offButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OffButton.png")));
    94                         offButton.setBounds(new Rectangle(0, 0, 34, 16));
    95                         offButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    96                         offButton.setToolTipText(tr("No colour"));
    97                 }
    98                 return offButton;
    99         }
    100 
    101         private JRadioButton getWhiteButton() {
    102                 if (whiteButton == null) {
    103                         whiteButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/WhiteButton.png")));
    104                         whiteButton.setBounds(new Rectangle(0, 16, 34, 16));
    105                         whiteButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    106                         whiteButton.setToolTipText(tr("White"));
    107                 }
    108                 return whiteButton;
    109         }
    110 
    111         private JRadioButton getRedButton() {
    112                 if (redButton == null) {
    113                         redButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RedButton.png")));
    114                         redButton.setBounds(new Rectangle(0, 32, 34, 16));
    115                         redButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    116                         redButton.setToolTipText(tr("Red"));
    117                 }
    118                 return redButton;
    119         }
    120 
    121         private JRadioButton getOrangeButton() {
    122                 if (orangeButton == null) {
    123                         orangeButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/OrangeButton.png")));
    124                         orangeButton.setBounds(new Rectangle(0, 48, 34, 16));
    125                         orangeButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    126                         orangeButton.setToolTipText(tr("Orange"));
    127                 }
    128                 return orangeButton;
    129         }
    130 
    131         private JRadioButton getAmberButton() {
    132                 if (amberButton == null) {
    133                         amberButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/AmberButton.png")));
    134                         amberButton.setBounds(new Rectangle(0, 64, 34, 16));
    135                         amberButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    136                         amberButton.setToolTipText(tr("Amber"));
    137                 }
    138                 return amberButton;
    139         }
    140 
    141         private JRadioButton getYellowButton() {
    142                 if (yellowButton == null) {
    143                         yellowButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/YellowButton.png")));
    144                         yellowButton.setBounds(new Rectangle(0, 80, 34, 16));
    145                         yellowButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    146                         yellowButton.setToolTipText(tr("Yellow"));
    147                 }
    148                 return yellowButton;
    149         }
    150 
    151         private JRadioButton getGreenButton() {
    152                 if (greenButton == null) {
    153                         greenButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/GreenButton.png")));
    154                         greenButton.setBounds(new Rectangle(0, 96, 34, 16));
    155                         greenButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    156                         greenButton.setToolTipText(tr("Green"));
    157                 }
    158                 return greenButton;
    159         }
    160 
    161         private JRadioButton getBlueButton() {
    162                 if (blueButton == null) {
    163                         blueButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BlueButton.png")));
    164                         blueButton.setBounds(new Rectangle(0, 112, 34, 16));
    165                         blueButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    166                         blueButton.setToolTipText(tr("Blue"));
    167                 }
    168                 return blueButton;
    169         }
    170 
    171         private JRadioButton getVioletButton() {
    172                 if (violetButton == null) {
    173                         violetButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/VioletButton.png")));
    174                         violetButton.setBounds(new Rectangle(0, 128, 34, 16));
    175                         violetButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    176                         violetButton.setToolTipText(tr("Violet"));
    177                 }
    178                 return violetButton;
    179         }
    180 
    181         private JRadioButton getBlackButton() {
    182                 if (blackButton == null) {
    183                         blackButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BlackButton.png")));
    184                         blackButton.setBounds(new Rectangle(0, 144, 34, 16));
    185                         blackButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    186                         blackButton.setToolTipText(tr("Black"));
    187                 }
    188                 return blackButton;
     107        private JRadioButton getButton(JRadioButton button, int x, int y, int w, int h, String tip, Col col) {
     108                button.setBounds(new Rectangle(x, y, w, h));
     109                button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     110                button.setToolTipText(tr(tip));
     111                colours.put(col, button);
     112                return button;
    189113        }
    190114
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelHaz.java

    r24848 r24870  
    2525        private OSeaMAction dlg;
    2626        private ButtonGroup catButtons = null;
    27         public JRadioButton northButton = null;
    28         public JRadioButton southButton = null;
    29         public JRadioButton eastButton = null;
    30         public JRadioButton westButton = null;
    31         public JRadioButton isolButton = null;
     27        public JRadioButton northButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardNButton.png")));
     28        public JRadioButton southButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardSButton.png")));
     29        public JRadioButton eastButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardEButton.png")));
     30        public JRadioButton westButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardWButton.png")));
     31        public JRadioButton isolButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/IsolButton.png")));
    3232        private ActionListener alCat = null;
    3333
    3434        private ButtonGroup shapeButtons = null;
    35         public JRadioButton pillarButton = null;
    36         public JRadioButton sparButton = null;
    37         public JRadioButton floatButton = null;
    38         public JRadioButton beaconButton = null;
    39         public JRadioButton towerButton = null;
     35        public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
     36        public JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
     37        public JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
     38        public JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
     39        public JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
    4040        private ActionListener alShape = null;
    4141
     
    4343                dlg = dia;
    4444                this.setLayout(null);
    45                 this.add(getNothButton(), null);
    46                 this.add(getSouthButton(), null);
    47                 this.add(getEastButton(), null);
    48                 this.add(getWestButton(), null);
    49                 this.add(getIsolButton(), null);
     45                this.add(getButton(northButton, 0, 0, 52, 32, "NorthTip"), null);
     46                this.add(getButton(southButton, 0, 32, 52, 32, "SouthTip"), null);
     47                this.add(getButton(eastButton, 0, 64, 52, 32, "EastTip"), null);
     48                this.add(getButton(westButton, 0, 96, 52, 32, "WestTip"), null);
     49                this.add(getButton(isolButton, 0, 128, 52, 32, "IsolTip"), null);
    5050                catButtons = new ButtonGroup();
    5151                catButtons.add(northButton);
     
    130130                isolButton.addActionListener(alCat);
    131131
    132                 this.add(getPillarButton(), null);
    133                 this.add(getSparButton(), null);
    134                 this.add(getFloatButton(), null);
    135                 this.add(getBeaconButton(), null);
    136                 this.add(getTowerButton(), null);
     132                this.add(getButton(pillarButton, 55, 0, 34, 32, "PillarTip"), null);
     133                this.add(getButton(sparButton, 55, 32, 34, 32, "SparTip"), null);
     134                this.add(getButton(floatButton, 55, 64, 34, 32, "FloatTip"), null);
     135                this.add(getButton(beaconButton, 55, 96, 34, 32, "BeaconTip"), null);
     136                this.add(getButton(towerButton, 55, 128, 34, 32, "TowerTip"), null);
    137137                shapeButtons = new ButtonGroup();
    138138                shapeButtons.add(pillarButton);
     
    191191        }
    192192
    193         private JRadioButton getNothButton() {
    194                 if (northButton == null) {
    195                         northButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardNButton.png")));
    196                         northButton.setBounds(new Rectangle(0, 0, 52, 32));
    197                         northButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    198                         northButton.setToolTipText(Messages.getString("NorthTip"));
    199                 }
    200                 return northButton;
     193        private JRadioButton getButton(JRadioButton button, int x, int y, int w, int h, String tip) {
     194                button.setBounds(new Rectangle(x, y, w, h));
     195                button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     196                button.setToolTipText(Messages.getString(tip));
     197                return button;
    201198        }
    202199
    203         private JRadioButton getSouthButton() {
    204                 if (southButton == null) {
    205                         southButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardSButton.png")));
    206                         southButton.setBounds(new Rectangle(0, 32, 52, 32));
    207                         southButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    208                         southButton.setToolTipText(Messages.getString("SouthTip"));
    209                 }
    210                 return southButton;
    211         }
    212 
    213         private JRadioButton getEastButton() {
    214                 if (eastButton == null) {
    215                         eastButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardEButton.png")));
    216                         eastButton.setBounds(new Rectangle(0, 64, 52, 32));
    217                         eastButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    218                         eastButton.setToolTipText(Messages.getString("EastTip"));
    219                 }
    220                 return eastButton;
    221         }
    222 
    223         private JRadioButton getWestButton() {
    224                 if (westButton == null) {
    225                         westButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CardWButton.png")));
    226                         westButton.setBounds(new Rectangle(0, 96, 52, 32));
    227                         westButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    228                         westButton.setToolTipText(Messages.getString("WestTip"));
    229                 }
    230                 return westButton;
    231         }
    232 
    233         private JRadioButton getIsolButton() {
    234                 if (isolButton == null) {
    235                         isolButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/IsolButton.png")));
    236                         isolButton.setBounds(new Rectangle(0, 128, 52, 32));
    237                         isolButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    238                         isolButton.setToolTipText(Messages.getString("IsolTip"));
    239                 }
    240                 return isolButton;
    241         }
    242 
    243         private JRadioButton getPillarButton() {
    244                 if (pillarButton == null) {
    245                         pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
    246                         pillarButton.setBounds(new Rectangle(55, 0, 34, 32));
    247                         pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    248                         pillarButton.setToolTipText(Messages.getString("PillarTip"));
    249                 }
    250                 return pillarButton;
    251         }
    252 
    253         private JRadioButton getSparButton() {
    254                 if (sparButton == null) {
    255                         sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
    256                         sparButton.setBounds(new Rectangle(55, 32, 34, 32));
    257                         sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    258                         sparButton.setToolTipText(Messages.getString("SparTip"));
    259                 }
    260                 return sparButton;
    261         }
    262 
    263         private JRadioButton getFloatButton() {
    264                 if (floatButton == null) {
    265                         floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
    266                         floatButton.setBounds(new Rectangle(55, 64, 34, 32));
    267                         floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    268                         floatButton.setToolTipText(Messages.getString("FloatTip"));
    269                 }
    270                 return floatButton;
    271         }
    272 
    273         private JRadioButton getBeaconButton() {
    274                 if (beaconButton == null) {
    275                         beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
    276                         beaconButton.setBounds(new Rectangle(55, 96, 34, 32));
    277                         beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    278                         beaconButton.setToolTipText(Messages.getString("BeaconTip"));
    279                 }
    280                 return beaconButton;
    281         }
    282 
    283         private JRadioButton getTowerButton() {
    284                 if (towerButton == null) {
    285                         towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
    286                         towerButton.setBounds(new Rectangle(55, 128, 34, 32));
    287                         towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    288                         towerButton.setToolTipText(Messages.getString("TowerTip"));
    289                 }
    290                 return towerButton;
    291         }
    292 
    293200}
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLights.java

    r24848 r24870  
    11package oseam.panels;
     2
     3import java.awt.Color;
     4import java.awt.Rectangle;
     5import java.awt.event.ActionListener;
    26
    37import javax.swing.BorderFactory;
    48import javax.swing.JPanel;
    5 
    6 import java.awt.Color;
    7 import java.awt.Dimension;
    8 import java.awt.Rectangle;
    9 import java.awt.Font;
    10 
    119import javax.swing.ButtonGroup;
    1210import javax.swing.ImageIcon;
    13 import javax.swing.JLabel;
    14 import javax.swing.JTextField;
    15 import javax.swing.JComboBox;
    16 import javax.swing.JCheckBox;
    1711import javax.swing.JRadioButton;
     12
     13import java.util.EnumMap;
     14import java.util.Iterator;
    1815
    1916import oseam.Messages;
     
    2118import oseam.seamarks.SeaMark.Cat;
    2219
    23 import java.awt.Cursor;
    24 import java.awt.event.ActionListener;
    25 
    2620public class PanelLights extends JPanel {
    2721
    2822        private OSeaMAction dlg;
    29         private ButtonGroup catButtons = null;
    30         private JRadioButton houseButton = null;
    31         private JRadioButton majorButton = null;
    32         private JRadioButton minorButton = null;
    33         private JRadioButton vesselButton = null;
    34         private JRadioButton floatButton = null;
     23        private ButtonGroup catButtons = new ButtonGroup();
     24        private JRadioButton houseButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LighthouseButton.png")));
     25        private JRadioButton majorButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightMajorButton.png")));
     26        private JRadioButton minorButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightMinorButton.png")));
     27        private JRadioButton vesselButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightVesselButton.png")));
     28        private JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightFloatButton.png")));
     29        private EnumMap<Cat, JRadioButton> categories = new EnumMap<Cat, JRadioButton>(Cat.class);
     30        private ActionListener alCat = new ActionListener() {
     31                public void actionPerformed(java.awt.event.ActionEvent e) {
     32                        Iterator<Cat> it = categories.keySet().iterator();
     33                        while (it.hasNext()) {
     34                                Cat cat = it.next();
     35                                JRadioButton button = categories.get(cat);
     36                                if (button.isSelected()) {
     37                                        dlg.mark.setCategory(cat);
     38                                        button.setBorderPainted(true);
     39                                } else
     40                                        button.setBorderPainted(false);
     41                        }
     42                        if (dlg.mark != null)
     43                                dlg.mark.paintSign();
     44                }
     45        };
    3546
    3647        public PanelLights(OSeaMAction dia) {
    3748                dlg = dia;
    3849                this.setLayout(null);
    39                 this.add(getHouseButton(), null);
    40                 this.add(getMajorButton(), null);
    41                 this.add(getMinorButton(), null);
    42                 this.add(getVesselButton(), null);
    43                 this.add(getFloatButton(), null);
    44                 catButtons = new ButtonGroup();
    45                 catButtons.add(houseButton);
    46                 catButtons.add(majorButton);
    47                 catButtons.add(minorButton);
    48                 catButtons.add(vesselButton);
    49                 catButtons.add(floatButton);
    50                 ActionListener alCat = new ActionListener() {
    51                         public void actionPerformed(java.awt.event.ActionEvent e) {
    52                                 if (houseButton.isSelected()) {
    53                                         dlg.mark.setCategory(Cat.LIGHT_HOUSE);
    54                                         houseButton.setBorderPainted(true);
    55                                 } else {
    56                                         houseButton.setBorderPainted(false);
    57                                 }
    58                                 if (majorButton.isSelected()) {
    59                                         dlg.mark.setCategory(Cat.LIGHT_MAJOR);
    60                                         majorButton.setBorderPainted(true);
    61                                 } else {
    62                                         majorButton.setBorderPainted(false);
    63                                 }
    64                                 if (minorButton.isSelected()) {
    65                                         dlg.mark.setCategory(Cat.LIGHT_MINOR);
    66                                         minorButton.setBorderPainted(true);
    67                                 } else {
    68                                         minorButton.setBorderPainted(false);
    69                                 }
    70                                 if (vesselButton.isSelected()) {
    71                                         dlg.mark.setCategory(Cat.LIGHT_VESSEL);
    72                                         vesselButton.setBorderPainted(true);
    73                                 } else {
    74                                         vesselButton.setBorderPainted(false);
    75                                 }
    76                                 if (floatButton.isSelected()) {
    77                                         dlg.mark.setCategory(Cat.LIGHT_FLOAT);
    78                                         floatButton.setBorderPainted(true);
    79                                 } else {
    80                                         floatButton.setBorderPainted(false);
    81                                 }
    82                                 if (dlg.mark != null)
    83                                         dlg.mark.paintSign();
    84                         }
    85                 };
    86                 houseButton.addActionListener(alCat);
    87                 majorButton.addActionListener(alCat);
    88                 minorButton.addActionListener(alCat);
    89                 vesselButton.addActionListener(alCat);
    90                 floatButton.addActionListener(alCat);
     50                this.add(getCatButton(houseButton, 0, 0, 34, 32, "LighthouseTip", Cat.LIGHT_HOUSE), null);
     51                this.add(getCatButton(majorButton, 0, 32, 34, 32, "MajorLightTip", Cat.LIGHT_MAJOR), null);
     52                this.add(getCatButton(minorButton, 0, 64, 34, 32, "MinorLightTip", Cat.LIGHT_MINOR), null);
     53                this.add(getCatButton(vesselButton, 0, 96, 34, 32, "LightVesselTip", Cat.LIGHT_VESSEL), null);
     54                this.add(getCatButton(floatButton, 0, 128, 34, 32, "LightFloatTip", Cat.LIGHT_FLOAT), null);
    9155        }
    9256
     
    9559        }
    9660
    97         private JRadioButton getHouseButton() {
    98                 if (houseButton == null) {
    99                         houseButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LighthouseButton.png")));
    100                         houseButton.setBounds(new Rectangle(0, 0, 34, 32));
    101                         houseButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    102                         houseButton.setToolTipText(Messages.getString("LighthouseTip"));
    103                 }
    104                 return houseButton;
    105         }
    106 
    107         private JRadioButton getMajorButton() {
    108                 if (majorButton == null) {
    109                         majorButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightMajorButton.png")));
    110                         majorButton.setBounds(new Rectangle(0, 32, 34, 32));
    111                         majorButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    112                         majorButton.setToolTipText(Messages.getString("MajorLightTip"));
    113                 }
    114                 return majorButton;
    115         }
    116 
    117         private JRadioButton getMinorButton() {
    118                 if (minorButton == null) {
    119                         minorButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightMinorButton.png")));
    120                         minorButton.setBounds(new Rectangle(0, 64, 34, 32));
    121                         minorButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    122                         minorButton.setToolTipText(Messages.getString("MinorLightTip"));
    123                 }
    124                 return minorButton;
    125         }
    126 
    127         private JRadioButton getVesselButton() {
    128                 if (vesselButton == null) {
    129                         vesselButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightVesselButton.png")));
    130                         vesselButton.setBounds(new Rectangle(0, 96, 34, 32));
    131                         vesselButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    132                         vesselButton.setToolTipText(Messages.getString("LightVesselTip"));
    133                 }
    134                 return vesselButton;
    135         }
    136 
    137         private JRadioButton getFloatButton() {
    138                 if (floatButton == null) {
    139                         floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightFloatButton.png")));
    140                         floatButton.setBounds(new Rectangle(0, 128, 34, 32));
    141                         floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    142                         floatButton.setToolTipText(Messages.getString("LightFloatTip"));
    143                 }
    144                 return floatButton;
     61        private JRadioButton getCatButton(JRadioButton button, int x, int y, int w, int h, String tip, Cat cat) {
     62                button.setBounds(new Rectangle(x, y, w, h));
     63                button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     64                button.setToolTipText(Messages.getString(tip));
     65                button.addActionListener(alCat);
     66                categories.put(cat, button);
     67                catButtons.add(button);
     68                return button;
    14569        }
    14670
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java

    r24839 r24870  
    2424import oseam.seamarks.MarkSpec;
    2525import oseam.seamarks.MarkLight;
    26 import oseam.seamarks.SeaMark.Cat;
    2726
    2827public class PanelMain extends JPanel {
     
    3938        private JButton saveButton = null;
    4039        public ButtonGroup typeButtons = null;
    41         public JRadioButton chanButton = null;
    42         public JRadioButton hazButton = null;
    43         public JRadioButton specButton = null;
    44         public JRadioButton lightsButton = null;
     40        public JRadioButton chanButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ChanButton.png")));
     41        public JRadioButton hazButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/HazButton.png")));
     42        public JRadioButton specButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SpecButton.png")));
     43        public JRadioButton lightsButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightsButton.png")));
    4544        private ActionListener alType = null;
    4645        private ButtonGroup miscButtons = null;
    47         public JRadioButton topButton = null;
    48         public JRadioButton fogButton = null;
    49         public JRadioButton radarButton = null;
    50         public JRadioButton litButton = null;
     46        public JRadioButton topButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TopButton.png")));
     47        public JRadioButton fogButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogButton.png")));
     48        public JRadioButton radarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RadarButton.png")));
     49        public JRadioButton litButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LitButton.png")));
    5150        private ActionListener alMisc = null;
    5251        public PanelChan panelChan = null;
     
    106105                this.add(fogIcon, null);
    107106
    108                 this.add(getChanButton(), null);
    109                 this.add(getHazButton(), null);
    110                 this.add(getSpecButton(), null);
    111                 this.add(getLightsButton(), null);
     107                this.add(getButton(chanButton, 0, 0, 62, 40, "ChanTip"), null);
     108                this.add(getButton(hazButton, 0, 40, 62, 40, "HazTip"), null);
     109                this.add(getButton(specButton, 0, 80, 62, 40, "SpecTip"), null);
     110                this.add(getButton(lightsButton, 0, 120, 62, 40, "LightsTip"), null);
    112111                this.add(panelChan, null);
    113112                this.add(panelHaz, null);
     
    183182                lightsButton.addActionListener(alType);
    184183
    185                 this.add(getTopButton(), null);
    186                 this.add(getFogButton(), null);
    187                 this.add(getRadarButton(), null);
    188                 this.add(getLitButton(), null);
     184                this.add(getButton(topButton, 0, 165, 34, 32, "TopmarksTip"), null);
     185                this.add(getButton(fogButton, 0, 205, 34, 32, "FogSignalsTip"), null);
     186                this.add(getButton(radarButton, 0, 245, 34, 32, "RadarTip"), null);
     187                this.add(getButton(litButton, 0, 285, 34, 32, "LitTip"), null);
    189188                miscButtons = new ButtonGroup();
    190189                miscButtons.add(topButton);
     
    271270        }
    272271
    273         private JRadioButton getChanButton() {
    274                 if (chanButton == null) {
    275                         chanButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ChanButton.png")));
    276                         chanButton.setBounds(new Rectangle(0, 0, 62, 40));
    277                         chanButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    278                         chanButton.setToolTipText(Messages.getString("ChanTip"));
    279                 }
    280                 return chanButton;
    281         }
    282 
    283         private JRadioButton getHazButton() {
    284                 if (hazButton == null) {
    285                         hazButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/HazButton.png")));
    286                         hazButton.setBounds(new Rectangle(0, 40, 62, 40));
    287                         hazButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    288                         hazButton.setToolTipText(Messages.getString("HazTip"));
    289                 }
    290                 return hazButton;
    291         }
    292 
    293         private JRadioButton getSpecButton() {
    294                 if (specButton == null) {
    295                         specButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SpecButton.png")));
    296                         specButton.setBounds(new Rectangle(0, 80, 62, 40));
    297                         specButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    298                         specButton.setToolTipText(Messages.getString("SpecTip"));
    299                 }
    300                 return specButton;
    301         }
    302 
    303         private JRadioButton getLightsButton() {
    304                 if (lightsButton == null) {
    305                         lightsButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightsButton.png")));
    306                         lightsButton.setBounds(new Rectangle(0, 120, 62, 40));
    307                         lightsButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    308                         lightsButton.setToolTipText(Messages.getString("LightsTip"));
    309                 }
    310                 return lightsButton;
    311         }
    312 
    313         private JRadioButton getTopButton() {
    314                 if (topButton == null) {
    315                         topButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TopButton.png")));
    316                         topButton.setBounds(new Rectangle(0, 165, 34, 32));
    317                         topButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    318                         topButton.setToolTipText(Messages.getString("TopmarksTip"));
    319                 }
    320                 return topButton;
    321         }
    322 
    323         private JRadioButton getFogButton() {
    324                 if (fogButton == null) {
    325                         fogButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FogButton.png")));
    326                         fogButton.setBounds(new Rectangle(0, 205, 34, 32));
    327                         fogButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    328                         fogButton.setToolTipText(Messages.getString("FogSignalsTip"));
    329                 }
    330                 return fogButton;
    331         }
    332 
    333         private JRadioButton getRadarButton() {
    334                 if (radarButton == null) {
    335                         radarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RadarButton.png")));
    336                         radarButton.setBounds(new Rectangle(0, 245, 34, 32));
    337                         radarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    338                         radarButton.setToolTipText(Messages.getString("RadarTip"));
    339                 }
    340                 return radarButton;
    341         }
    342 
    343         private JRadioButton getLitButton() {
    344                 if (litButton == null) {
    345                         litButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LitButton.png")));
    346                         litButton.setBounds(new Rectangle(0, 285, 34, 32));
    347                         litButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    348                         litButton.setToolTipText(Messages.getString("LitTip"));
    349                 }
    350                 return litButton;
     272        private JRadioButton getButton(JRadioButton button, int x, int y, int w, int h, String tip) {
     273                button.setBounds(new Rectangle(x, y, w, h));
     274                button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     275                button.setToolTipText(Messages.getString(tip));
     276                return button;
    351277        }
    352278
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java

    r24839 r24870  
    2929        private OSeaMAction dlg;
    3030        private ButtonGroup regionButtons = null;
    31         public JRadioButton regionAButton = null;
    32         public JRadioButton regionBButton = null;
     31        public JRadioButton regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png")));
     32        public JRadioButton regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png")));
    3333        private ButtonGroup shapeButtons = null;
    34         public JRadioButton pillarButton = null;
    35         public JRadioButton sparButton = null;
    36         public JRadioButton canButton = null;
    37         public JRadioButton floatButton = null;
    38         public JRadioButton beaconButton = null;
    39         public JRadioButton towerButton = null;
    40         public JRadioButton perchButton = null;
     34        public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
     35        public JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
     36        public JRadioButton canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png")));
     37        public JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
     38        public JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
     39        public JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
     40        public JRadioButton perchButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PerchPButton.png")));
    4141        private ActionListener alShape = null;
    4242
     
    4444                dlg = dia;
    4545                this.setLayout(null);
    46                 this.add(getRegionAButton(), null);
    47                 this.add(getRegionBButton(), null);
    48                 this.add(getPillarButton(), null);
    49                 this.add(getSparButton(), null);
    50                 this.add(getCanButton(), null);
    51                 this.add(getFloatButton(), null);
    52                 this.add(getBeaconButton(), null);
    53                 this.add(getTowerButton(), null);
    54                 this.add(getPerchButton(), null);
     46                this.add(getButton(regionAButton, 0, 2, 34, 30, "RegionATip"), null);
     47                this.add(getButton(regionBButton, 0, 32, 34, 30, "RegionBTip"), null);
     48                this.add(getButton(pillarButton, 0, 64, 34, 32, "PillarTip"), null);
     49                this.add(getButton(sparButton, 0, 96, 34, 32, "SparTip"), null);
     50                this.add(getButton(canButton, 0, 128, 34, 32, "CanTip"), null);
     51                this.add(getButton(floatButton, 35, 0, 34, 32, "FloatTip"), null);
     52                this.add(getButton(beaconButton, 35, 32, 34, 32, "BeaconTip"), null);
     53                this.add(getButton(towerButton, 35, 64, 34, 32, "TowerTip"), null);
     54                this.add(getButton(perchButton, 35, 96, 34, 32, "PerchTip"), null);
    5555
    5656                regionButtons = new ButtonGroup();
     
    137137        }
    138138
    139         private JRadioButton getRegionAButton() {
    140                 if (regionAButton == null) {
    141                         regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png")));
    142                         regionAButton.setBounds(new Rectangle(0, 2, 34, 30));
    143                         regionAButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    144                         regionAButton.setToolTipText(Messages.getString("RegionATip"));
    145                 }
    146                 return regionAButton;
    147         }
    148 
    149         private JRadioButton getRegionBButton() {
    150                 if (regionBButton == null) {
    151                         regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png")));
    152                         regionBButton.setBounds(new Rectangle(0, 32, 34, 30));
    153                         regionBButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    154                         regionBButton.setToolTipText(Messages.getString("RegionBTip"));
    155                 }
    156                 return regionBButton;
    157         }
    158 
    159         private JRadioButton getPillarButton() {
    160                 if (pillarButton == null) {
    161                         pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
    162                         pillarButton.setBounds(new Rectangle(0, 64, 34, 32));
    163                         pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    164                         pillarButton.setToolTipText(Messages.getString("PillarTip"));
    165                 }
    166                 return pillarButton;
    167         }
    168 
    169         private JRadioButton getSparButton() {
    170                 if (sparButton == null) {
    171                         sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
    172                         sparButton.setBounds(new Rectangle(0, 96, 34, 32));
    173                         sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    174                         sparButton.setToolTipText(Messages.getString("SparTip"));
    175                 }
    176                 return sparButton;
    177         }
    178 
    179         private JRadioButton getCanButton() {
    180                 if (canButton == null) {
    181                         canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png")));
    182                         canButton.setBounds(new Rectangle(0, 128, 34, 32));
    183                         canButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    184                         canButton.setToolTipText(Messages.getString("CanTip"));
    185                 }
    186                 return canButton;
    187         }
    188 
    189         private JRadioButton getFloatButton() {
    190                 if (floatButton == null) {
    191                         floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
    192                         floatButton.setBounds(new Rectangle(35, 0, 34, 32));
    193                         floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    194                         floatButton.setToolTipText(Messages.getString("FloatTip"));
    195                 }
    196                 return floatButton;
    197         }
    198 
    199         private JRadioButton getBeaconButton() {
    200                 if (beaconButton == null) {
    201                         beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
    202                         beaconButton.setBounds(new Rectangle(35, 32, 34, 32));
    203                         beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    204                         beaconButton.setToolTipText(Messages.getString("BeaconTip"));
    205                 }
    206                 return beaconButton;
    207         }
    208 
    209         private JRadioButton getTowerButton() {
    210                 if (towerButton == null) {
    211                         towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
    212                         towerButton.setBounds(new Rectangle(35, 64, 34, 32));
    213                         towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    214                         towerButton.setToolTipText(Messages.getString("TowerTip"));
    215                 }
    216                 return towerButton;
    217         }
    218 
    219         private JRadioButton getPerchButton() {
    220                 if (perchButton == null) {
    221                         perchButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PerchPButton.png")));
    222                         perchButton.setBounds(new Rectangle(35, 96, 34, 32));
    223                         perchButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    224                         perchButton.setToolTipText(Messages.getString("PerchTip"));
    225                 }
    226                 return perchButton;
     139        private JRadioButton getButton(JRadioButton button, int x, int y, int w, int h, String tip) {
     140                button.setBounds(new Rectangle(x, y, w, h));
     141                button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     142                button.setToolTipText(Messages.getString(tip));
     143                return button;
    227144        }
    228145
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPrefPort.java

    r24839 r24870  
    2828        private OSeaMAction dlg;
    2929        private ButtonGroup regionButtons = null;
    30         public JRadioButton regionAButton = null;
    31         public JRadioButton regionBButton = null;
     30        public JRadioButton regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png")));
     31        public JRadioButton regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png")));
    3232        private ButtonGroup shapeButtons = null;
    33         public JRadioButton pillarButton = null;
    34         public JRadioButton sparButton = null;
    35         public JRadioButton canButton = null;
    36         public JRadioButton floatButton = null;
    37         public JRadioButton beaconButton = null;
    38         public JRadioButton towerButton = null;
     33        public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
     34        public JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
     35        public JRadioButton canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png")));
     36        public JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
     37        public JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
     38        public JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
    3939        private ActionListener alShape = null;
    4040
     
    4242                dlg = dia;
    4343                this.setLayout(null);
    44                 this.add(getRegionAButton(), null);
    45                 this.add(getRegionBButton(), null);
    46                 this.add(getPillarButton(), null);
    47                 this.add(getSparButton(), null);
    48                 this.add(getCanButton(), null);
    49                 this.add(getFloatButton(), null);
    50                 this.add(getBeaconButton(), null);
    51                 this.add(getTowerButton(), null);
     44                this.add(getButton(regionAButton, 0, 2, 34, 30, "RegionATip"), null);
     45                this.add(getButton(regionBButton, 0, 32, 34, 30, "RegionBTip"), null);
     46                this.add(getButton(pillarButton, 0, 64, 34, 32, "PillarTip"), null);
     47                this.add(getButton(sparButton, 0, 96, 34, 32, "SparTip"), null);
     48                this.add(getButton(canButton, 0, 128, 34, 32, "CanTip"), null);
     49                this.add(getButton(floatButton, 35, 0, 34, 32, "FloatTip"), null);
     50                this.add(getButton(beaconButton, 35, 32, 34, 32, "BeaconTip"), null);
     51                this.add(getButton(towerButton, 35, 64, 34, 32, "TowerTip"), null);
    5252
    5353                regionButtons = new ButtonGroup();
     
    126126        }
    127127
    128         private JRadioButton getRegionAButton() {
    129                 if (regionAButton == null) {
    130                         regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png")));
    131                         regionAButton.setBounds(new Rectangle(0, 2, 34, 30));
    132                         regionAButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    133                         regionAButton.setToolTipText(Messages.getString("RegionATip"));
    134                 }
    135                 return regionAButton;
    136         }
    137 
    138         private JRadioButton getRegionBButton() {
    139                 if (regionBButton == null) {
    140                         regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png")));
    141                         regionBButton.setBounds(new Rectangle(0, 32, 34, 30));
    142                         regionBButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    143                         regionBButton.setToolTipText(Messages.getString("RegionBTip"));
    144                 }
    145                 return regionBButton;
    146         }
    147 
    148         private JRadioButton getPillarButton() {
    149                 if (pillarButton == null) {
    150                         pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
    151                         pillarButton.setBounds(new Rectangle(0, 64, 34, 32));
    152                         pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    153                         pillarButton.setToolTipText(Messages.getString("PillarTip"));
    154                 }
    155                 return pillarButton;
    156         }
    157 
    158         private JRadioButton getSparButton() {
    159                 if (sparButton == null) {
    160                         sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
    161                         sparButton.setBounds(new Rectangle(0, 96, 34, 32));
    162                         sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    163                         sparButton.setToolTipText(Messages.getString("SparTip"));
    164                 }
    165                 return sparButton;
    166         }
    167 
    168         private JRadioButton getCanButton() {
    169                 if (canButton == null) {
    170                         canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png")));
    171                         canButton.setBounds(new Rectangle(0, 128, 34, 32));
    172                         canButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    173                         canButton.setToolTipText(Messages.getString("CanTip"));
    174                 }
    175                 return canButton;
    176         }
    177 
    178         private JRadioButton getFloatButton() {
    179                 if (floatButton == null) {
    180                         floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
    181                         floatButton.setBounds(new Rectangle(35, 0, 34, 32));
    182                         floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    183                         floatButton.setToolTipText(Messages.getString("FloatTip"));
    184                 }
    185                 return floatButton;
    186         }
    187 
    188         private JRadioButton getBeaconButton() {
    189                 if (beaconButton == null) {
    190                         beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
    191                         beaconButton.setBounds(new Rectangle(35, 32, 34, 32));
    192                         beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    193                         beaconButton.setToolTipText(Messages.getString("BeaconTip"));
    194                 }
    195                 return beaconButton;
    196         }
    197 
    198         private JRadioButton getTowerButton() {
    199                 if (towerButton == null) {
    200                         towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
    201                         towerButton.setBounds(new Rectangle(35, 64, 34, 32));
    202                         towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    203                         towerButton.setToolTipText(Messages.getString("TowerTip"));
    204                 }
    205                 return towerButton;
     128        private JRadioButton getButton(JRadioButton button, int x, int y, int w, int h, String tip) {
     129                button.setBounds(new Rectangle(x, y, w, h));
     130                button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     131                button.setToolTipText(Messages.getString(tip));
     132                return button;
    206133        }
    207134
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPrefStbd.java

    r24839 r24870  
    2828        private OSeaMAction dlg;
    2929        private ButtonGroup regionButtons = null;
    30         public JRadioButton regionAButton = null;
    31         public JRadioButton regionBButton = null;
     30        public JRadioButton regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png")));
     31        public JRadioButton regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png")));
    3232        private ButtonGroup shapeButtons = null;
    33         public JRadioButton pillarButton = null;
    34         public JRadioButton sparButton = null;
    35         public JRadioButton coneButton = null;
    36         public JRadioButton floatButton = null;
    37         public JRadioButton beaconButton = null;
    38         public JRadioButton towerButton = null;
     33        public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
     34        public JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
     35        public JRadioButton coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png")));
     36        public JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
     37        public JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
     38        public JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
    3939        private ActionListener alShape = null;
    4040
     
    4242                dlg = dia;
    4343                this.setLayout(null);
    44                 this.add(getRegionAButton(), null);
    45                 this.add(getRegionBButton(), null);
    46                 this.add(getPillarButton(), null);
    47                 this.add(getSparButton(), null);
    48                 this.add(getConeButton(), null);
    49                 this.add(getFloatButton(), null);
    50                 this.add(getBeaconButton(), null);
    51                 this.add(getTowerButton(), null);
     44                this.add(getButton(regionAButton, 0, 2, 34, 30, "RegionATip"), null);
     45                this.add(getButton(regionBButton, 0, 32, 34, 30, "RegionBTip"), null);
     46                this.add(getButton(pillarButton, 0, 64, 34, 32, "PillarTip"), null);
     47                this.add(getButton(sparButton, 0, 96, 34, 32, "SparTip"), null);
     48                this.add(getButton(coneButton, 0, 128, 34, 32, "ConeTip"), null);
     49                this.add(getButton(floatButton, 35, 0, 34, 32, "FloatTip"), null);
     50                this.add(getButton(beaconButton, 35, 32, 34, 32, "BeaconTip"), null);
     51                this.add(getButton(towerButton, 35, 64, 34, 32, "TowerTip"), null);
    5252
    5353                regionButtons = new ButtonGroup();
     
    126126        }
    127127
    128         private JRadioButton getRegionAButton() {
    129                 if (regionAButton == null) {
    130                         regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png")));
    131                         regionAButton.setBounds(new Rectangle(0, 2, 34, 30));
    132                         regionAButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    133                         regionAButton.setToolTipText(Messages.getString("RegionATip"));
    134                 }
    135                 return regionAButton;
    136         }
    137 
    138         private JRadioButton getRegionBButton() {
    139                 if (regionBButton == null) {
    140                         regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png")));
    141                         regionBButton.setBounds(new Rectangle(0, 32, 34, 30));
    142                         regionBButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    143                         regionBButton.setToolTipText(Messages.getString("RegionBTip"));
    144                 }
    145                 return regionBButton;
    146         }
    147 
    148         private JRadioButton getPillarButton() {
    149                 if (pillarButton == null) {
    150                         pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
    151                         pillarButton.setBounds(new Rectangle(0, 64, 34, 32));
    152                         pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    153                         pillarButton.setToolTipText(Messages.getString("PillarTip"));
    154                 }
    155                 return pillarButton;
    156         }
    157 
    158         private JRadioButton getSparButton() {
    159                 if (sparButton == null) {
    160                         sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
    161                         sparButton.setBounds(new Rectangle(0, 96, 34, 32));
    162                         sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    163                         sparButton.setToolTipText(Messages.getString("SparTip"));
    164                 }
    165                 return sparButton;
    166         }
    167 
    168         private JRadioButton getConeButton() {
    169                 if (coneButton == null) {
    170                         coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png")));
    171                         coneButton.setBounds(new Rectangle(0, 128, 34, 32));
    172                         coneButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    173                         coneButton.setToolTipText(Messages.getString("ConeTip"));
    174                 }
    175                 return coneButton;
    176         }
    177 
    178         private JRadioButton getFloatButton() {
    179                 if (floatButton == null) {
    180                         floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
    181                         floatButton.setBounds(new Rectangle(35, 0, 34, 32));
    182                         floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    183                         floatButton.setToolTipText(Messages.getString("FloatTip"));
    184                 }
    185                 return floatButton;
    186         }
    187 
    188         private JRadioButton getBeaconButton() {
    189                 if (beaconButton == null) {
    190                         beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
    191                         beaconButton.setBounds(new Rectangle(35, 32, 34, 32));
    192                         beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    193                         beaconButton.setToolTipText(Messages.getString("BeaconTip"));
    194                 }
    195                 return beaconButton;
    196         }
    197 
    198         private JRadioButton getTowerButton() {
    199                 if (towerButton == null) {
    200                         towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
    201                         towerButton.setBounds(new Rectangle(35, 64, 34, 32));
    202                         towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    203                         towerButton.setToolTipText(Messages.getString("TowerTip"));
    204                 }
    205                 return towerButton;
     128        private JRadioButton getButton(JRadioButton button, int x, int y, int w, int h, String tip) {
     129                button.setBounds(new Rectangle(x, y, w, h));
     130                button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     131                button.setToolTipText(Messages.getString(tip));
     132                return button;
    206133        }
    207134
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSpec.java

    r24848 r24870  
    88import java.awt.Color;
    99import java.awt.Rectangle;
     10import java.awt.event.ActionListener;
    1011
    1112import javax.swing.ButtonGroup;
     
    1314import javax.swing.JRadioButton;
    1415
     16import java.util.EnumMap;
     17import java.util.Iterator;
     18
    1519import oseam.Messages;
    1620import oseam.dialogs.OSeaMAction;
    1721import oseam.seamarks.SeaMark.Shp;
    18 import oseam.seamarks.SeaMark.Col;
    19 
    20 import java.awt.event.ActionListener;
    2122
    2223public class PanelSpec extends JPanel {
    2324
    2425        private OSeaMAction dlg;
    25         private ButtonGroup shapeButtons = null;
    26         private JRadioButton pillarButton = null;
    27         private JRadioButton sparButton = null;
    28         private JRadioButton canButton = null;
    29         private JRadioButton coneButton = null;
    30         private JRadioButton sphereButton = null;
    31         private JRadioButton barrelButton = null;
    32         private JRadioButton superButton = null;
    33         private JRadioButton floatButton = null;
    34         private JRadioButton beaconButton = null;
    35         private JRadioButton towerButton = null;
     26        private ButtonGroup shapeButtons = new ButtonGroup();
     27        private JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
     28        private JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
     29        private JRadioButton canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png")));
     30        private JRadioButton coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png")));
     31        private JRadioButton sphereButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereButton.png")));
     32        private JRadioButton barrelButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BarrelButton.png")));
     33        private JRadioButton superButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SuperButton.png")));
     34        private JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
     35        private JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
     36        private JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
     37        private EnumMap<Shp, JRadioButton> shapes = new EnumMap<Shp, JRadioButton>(Shp.class);
    3638        private PanelCol panelCol = null;
     39        private ActionListener alShape = new ActionListener() {
     40                public void actionPerformed(java.awt.event.ActionEvent e) {
     41                        Iterator<Shp> it = shapes.keySet().iterator();
     42                        while (it.hasNext()) {
     43                                Shp shp = it.next();
     44                                JRadioButton button = shapes.get(shp);
     45                                if (button.isSelected()) {
     46                                        dlg.mark.setShape(shp);
     47                                        button.setBorderPainted(true);
     48                                } else
     49                                        button.setBorderPainted(false);
     50                        }
     51                        if (dlg.mark != null)
     52                                dlg.mark.paintSign();
     53                }
     54        };
    3755
    3856        public PanelSpec(OSeaMAction dia) {
     
    4361                this.setLayout(null);
    4462                this.add(panelCol, null);
    45                 this.add(getPillarButton(), null);
    46                 this.add(getSparButton(), null);
    47                 this.add(getCanButton(), null);
    48                 this.add(getConeButton(), null);
    49                 this.add(getSphereButton(), null);
    50                 this.add(getBarrelButton(), null);
    51                 this.add(getSuperButton(), null);
    52                 this.add(getFloatButton(), null);
    53                 this.add(getBeaconButton(), null);
    54                 this.add(getTowerButton(), null);
    55                 shapeButtons = new ButtonGroup();
    56                 shapeButtons.add(pillarButton);
    57                 shapeButtons.add(sparButton);
    58                 shapeButtons.add(canButton);
    59                 shapeButtons.add(coneButton);
    60                 shapeButtons.add(sphereButton);
    61                 shapeButtons.add(barrelButton);
    62                 shapeButtons.add(superButton);
    63                 shapeButtons.add(floatButton);
    64                 shapeButtons.add(beaconButton);
    65                 shapeButtons.add(towerButton);
    66                 ActionListener alShape = new ActionListener() {
    67                         public void actionPerformed(java.awt.event.ActionEvent e) {
    68                                 if (pillarButton.isSelected()) {
    69                                         dlg.mark.setShape(Shp.PILLAR);
    70                                         pillarButton.setBorderPainted(true);
    71                                 } else {
    72                                         pillarButton.setBorderPainted(false);
    73                                 }
    74                                 if (sparButton.isSelected()) {
    75                                         dlg.mark.setShape(Shp.SPAR);
    76                                         sparButton.setBorderPainted(true);
    77                                 } else {
    78                                         sparButton.setBorderPainted(false);
    79                                 }
    80                                 if (canButton.isSelected()) {
    81                                         dlg.mark.setShape(Shp.CAN);
    82                                         canButton.setBorderPainted(true);
    83                                 } else {
    84                                         canButton.setBorderPainted(false);
    85                                 }
    86                                 if (coneButton.isSelected()) {
    87                                         dlg.mark.setShape(Shp.CONE);
    88                                         coneButton.setBorderPainted(true);
    89                                 } else {
    90                                         coneButton.setBorderPainted(false);
    91                                 }
    92                                 if (sphereButton.isSelected()) {
    93                                         dlg.mark.setShape(Shp.SPHERE);
    94                                         sphereButton.setBorderPainted(true);
    95                                 } else {
    96                                         sphereButton.setBorderPainted(false);
    97                                 }
    98                                 if (barrelButton.isSelected()) {
    99                                         dlg.mark.setShape(Shp.BARREL);
    100                                         barrelButton.setBorderPainted(true);
    101                                 } else {
    102                                         barrelButton.setBorderPainted(false);
    103                                 }
    104                                 if (superButton.isSelected()) {
    105                                         dlg.mark.setShape(Shp.SUPER);
    106                                         superButton.setBorderPainted(true);
    107                                 } else {
    108                                         superButton.setBorderPainted(false);
    109                                 }
    110                                 if (floatButton.isSelected()) {
    111                                         dlg.mark.setShape(Shp.FLOAT);
    112                                         floatButton.setBorderPainted(true);
    113                                 } else {
    114                                         floatButton.setBorderPainted(false);
    115                                 }
    116                                 if (beaconButton.isSelected()) {
    117                                         dlg.mark.setShape(Shp.BEACON);
    118                                         beaconButton.setBorderPainted(true);
    119                                 } else {
    120                                         beaconButton.setBorderPainted(false);
    121                                 }
    122                                 if (towerButton.isSelected()) {
    123                                         dlg.mark.setShape(Shp.TOWER);
    124                                         towerButton.setBorderPainted(true);
    125                                 } else {
    126                                         towerButton.setBorderPainted(false);
    127                                 }
    128                                 if (dlg.mark != null)
    129                                         dlg.mark.paintSign();
    130                         }
    131                 };
    132                 pillarButton.addActionListener(alShape);
    133                 sparButton.addActionListener(alShape);
    134                 canButton.addActionListener(alShape);
    135                 coneButton.addActionListener(alShape);
    136                 sphereButton.addActionListener(alShape);
    137                 barrelButton.addActionListener(alShape);
    138                 superButton.addActionListener(alShape);
    139                 floatButton.addActionListener(alShape);
    140                 beaconButton.addActionListener(alShape);
    141                 towerButton.addActionListener(alShape);
     63                this.add(getShapeButton(pillarButton, 55, 0, 34, 32, "PillarTip", Shp.PILLAR), null);
     64                this.add(getShapeButton(sparButton, 55, 32, 34, 32, "SparTip", Shp.SPAR), null);
     65                this.add(getShapeButton(canButton, 55, 64, 34, 32, "CanTip", Shp.CAN), null);
     66                this.add(getShapeButton(coneButton, 55, 96, 34, 32, "ConeTip", Shp.CONE), null);
     67                this.add(getShapeButton(sphereButton, 55, 128, 34, 32, "SphereTip", Shp.SPHERE), null);
     68                this.add(getShapeButton(barrelButton, 90, 0, 34, 32, "BarrelTip", Shp.BARREL), null);
     69                this.add(getShapeButton(superButton, 90, 32, 34, 32, "SuperTip", Shp.SUPER), null);
     70                this.add(getShapeButton(floatButton, 90, 64, 34, 32, "FloatTip", Shp.FLOAT), null);
     71                this.add(getShapeButton(beaconButton, 90, 96, 34, 32, "BeaconTip", Shp.BEACON), null);
     72                this.add(getShapeButton(towerButton, 90, 128, 34, 32, "TowerTip", Shp.TOWER), null);
    14273        }
    14374
     
    14677        }
    14778
    148         private JRadioButton getPillarButton() {
    149                 if (pillarButton == null) {
    150                         pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
    151                         pillarButton.setBounds(new Rectangle(55, 0, 34, 32));
    152                         pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    153                         pillarButton.setToolTipText(Messages.getString("PillarTip"));
    154                 }
    155                 return pillarButton;
    156         }
    157 
    158         private JRadioButton getSparButton() {
    159                 if (sparButton == null) {
    160                         sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
    161                         sparButton.setBounds(new Rectangle(55, 32, 34, 32));
    162                         sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    163                         sparButton.setToolTipText(Messages.getString("SparTip"));
    164                 }
    165                 return sparButton;
    166         }
    167 
    168         private JRadioButton getCanButton() {
    169                 if (canButton == null) {
    170                         canButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanButton.png")));
    171                         canButton.setBounds(new Rectangle(55, 64, 34, 32));
    172                         canButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    173                         canButton.setToolTipText(Messages.getString("CanTip"));
    174                 }
    175                 return canButton;
    176         }
    177 
    178         private JRadioButton getConeButton() {
    179                 if (coneButton == null) {
    180                         coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png")));
    181                         coneButton.setBounds(new Rectangle(55, 96, 34, 32));
    182                         coneButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    183                         coneButton.setToolTipText(Messages.getString("ConeTip"));
    184                 }
    185                 return coneButton;
    186         }
    187 
    188         private JRadioButton getSphereButton() {
    189                 if (sphereButton == null) {
    190                         sphereButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereButton.png")));
    191                         sphereButton.setBounds(new Rectangle(55, 128, 34, 32));
    192                         sphereButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    193                         sphereButton.setToolTipText(Messages.getString("SphereTip"));
    194                 }
    195                 return sphereButton;
    196         }
    197 
    198         private JRadioButton getBarrelButton() {
    199                 if (barrelButton == null) {
    200                         barrelButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BarrelButton.png")));
    201                         barrelButton.setBounds(new Rectangle(90, 0, 34, 32));
    202                         barrelButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    203                         barrelButton.setToolTipText(Messages.getString("BarrelTip"));
    204                 }
    205                 return barrelButton;
    206         }
    207 
    208         private JRadioButton getSuperButton() {
    209                 if (superButton == null) {
    210                         superButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SuperButton.png")));
    211                         superButton.setBounds(new Rectangle(90, 32, 34, 32));
    212                         superButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    213                         superButton.setToolTipText(Messages.getString("SuperTip"));
    214                 }
    215                 return superButton;
    216         }
    217 
    218         private JRadioButton getFloatButton() {
    219                 if (floatButton == null) {
    220                         floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
    221                         floatButton.setBounds(new Rectangle(90, 64, 34, 32));
    222                         floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    223                         floatButton.setToolTipText(Messages.getString("FloatTip"));
    224                 }
    225                 return floatButton;
    226         }
    227 
    228         private JRadioButton getBeaconButton() {
    229                 if (beaconButton == null) {
    230                         beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
    231                         beaconButton.setBounds(new Rectangle(90, 96, 34, 32));
    232                         beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    233                         beaconButton.setToolTipText(Messages.getString("BeaconTip"));
    234                 }
    235                 return beaconButton;
    236         }
    237 
    238         private JRadioButton getTowerButton() {
    239                 if (towerButton == null) {
    240                         towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
    241                         towerButton.setBounds(new Rectangle(90, 128, 34, 32));
    242                         towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    243                         towerButton.setToolTipText(Messages.getString("TowerTip"));
    244                 }
    245                 return towerButton;
     79        private JRadioButton getShapeButton(JRadioButton button, int x, int y, int w, int h, String tip, Shp shp) {
     80                button.setBounds(new Rectangle(x, y, w, h));
     81                button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     82                button.setToolTipText(Messages.getString(tip));
     83                button.addActionListener(alShape);
     84                shapes.put(shp, button);
     85                shapeButtons.add(button);
     86                return button;
    24687        }
    24788
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelStbd.java

    r24839 r24870  
    2828        private OSeaMAction dlg;
    2929        private ButtonGroup regionButtons = null;
    30         public JRadioButton regionAButton = null;
    31         public JRadioButton regionBButton = null;
     30        public JRadioButton regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png")));
     31        public JRadioButton regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png")));
    3232        private ButtonGroup shapeButtons = null;
    33         public JRadioButton pillarButton = null;
    34         public JRadioButton sparButton = null;
    35         public JRadioButton coneButton = null;
    36         public JRadioButton floatButton = null;
    37         public JRadioButton beaconButton = null;
    38         public JRadioButton towerButton = null;
    39         public JRadioButton perchButton = null;
     33        public JRadioButton pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
     34        public JRadioButton sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
     35        public JRadioButton coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png")));
     36        public JRadioButton floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
     37        public JRadioButton beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
     38        public JRadioButton towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
     39        public JRadioButton perchButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PerchSButton.png")));
    4040        private ActionListener alShape = null;
    4141
     
    4343                dlg = dia;
    4444                this.setLayout(null);
    45                 this.add(getRegionAButton(), null);
    46                 this.add(getRegionBButton(), null);
    47                 this.add(getPillarButton(), null);
    48                 this.add(getSparButton(), null);
    49                 this.add(getConeButton(), null);
    50                 this.add(getFloatButton(), null);
    51                 this.add(getBeaconButton(), null);
    52                 this.add(getTowerButton(), null);
    53                 this.add(getPerchButton(), null);
     45                this.add(getButton(regionAButton, 0, 2, 34, 30, "RegionATip"), null);
     46                this.add(getButton(regionBButton, 0, 32, 34, 30, "RegionBTip"), null);
     47                this.add(getButton(pillarButton, 0, 64, 34, 32, "PillarTip"), null);
     48                this.add(getButton(sparButton, 0, 96, 34, 32, "SparTip"), null);
     49                this.add(getButton(coneButton, 0, 128, 34, 32, "ConeTip"), null);
     50                this.add(getButton(floatButton, 35, 0, 34, 32, "FloatTip"), null);
     51                this.add(getButton(beaconButton, 35, 32, 34, 32, "BeaconTip"), null);
     52                this.add(getButton(towerButton, 35, 64, 34, 32, "TowerTip"), null);
     53                this.add(getButton(perchButton, 35, 96, 34, 32, "PerchTip"), null);
    5454
    5555                regionButtons = new ButtonGroup();
     
    136136        }
    137137
    138         private JRadioButton getRegionAButton() {
    139                 if (regionAButton == null) {
    140                         regionAButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionAButton.png")));
    141                         regionAButton.setBounds(new Rectangle(0, 2, 34, 30));
    142                         regionAButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    143                         regionAButton.setToolTipText(Messages.getString("RegionATip"));
    144                 }
    145                 return regionAButton;
    146         }
    147 
    148         private JRadioButton getRegionBButton() {
    149                 if (regionBButton == null) {
    150                         regionBButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/RegionBButton.png")));
    151                         regionBButton.setBounds(new Rectangle(0, 32, 34, 30));
    152                         regionBButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    153                         regionBButton.setToolTipText(Messages.getString("RegionBTip"));
    154                 }
    155                 return regionBButton;
    156         }
    157 
    158         private JRadioButton getPillarButton() {
    159                 if (pillarButton == null) {
    160                         pillarButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PillarButton.png")));
    161                         pillarButton.setBounds(new Rectangle(0, 64, 34, 32));
    162                         pillarButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    163                         pillarButton.setToolTipText(Messages.getString("PillarTip"));
    164                 }
    165                 return pillarButton;
    166         }
    167 
    168         private JRadioButton getSparButton() {
    169                 if (sparButton == null) {
    170                         sparButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SparButton.png")));
    171                         sparButton.setBounds(new Rectangle(0, 96, 34, 32));
    172                         sparButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    173                         sparButton.setToolTipText(Messages.getString("SparTip"));
    174                 }
    175                 return sparButton;
    176         }
    177 
    178         private JRadioButton getConeButton() {
    179                 if (coneButton == null) {
    180                         coneButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeButton.png")));
    181                         coneButton.setBounds(new Rectangle(0, 128, 34, 32));
    182                         coneButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    183                         coneButton.setToolTipText(Messages.getString("ConeTip"));
    184                 }
    185                 return coneButton;
    186         }
    187 
    188         private JRadioButton getFloatButton() {
    189                 if (floatButton == null) {
    190                         floatButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/FloatButton.png")));
    191                         floatButton.setBounds(new Rectangle(35, 0, 34, 32));
    192                         floatButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    193                         floatButton.setToolTipText(Messages.getString("FloatTip"));
    194                 }
    195                 return floatButton;
    196         }
    197 
    198         private JRadioButton getBeaconButton() {
    199                 if (beaconButton == null) {
    200                         beaconButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BeaconButton.png")));
    201                         beaconButton.setBounds(new Rectangle(35, 32, 34, 32));
    202                         beaconButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    203                         beaconButton.setToolTipText(Messages.getString("BeaconTip"));
    204                 }
    205                 return beaconButton;
    206         }
    207 
    208         private JRadioButton getTowerButton() {
    209                 if (towerButton == null) {
    210                         towerButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TowerButton.png")));
    211                         towerButton.setBounds(new Rectangle(35, 64, 34, 32));
    212                         towerButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    213                         towerButton.setToolTipText(Messages.getString("TowerTip"));
    214                 }
    215                 return towerButton;
    216         }
    217 
    218         private JRadioButton getPerchButton() {
    219                 if (perchButton == null) {
    220                         perchButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/PerchSButton.png")));
    221                         perchButton.setBounds(new Rectangle(35, 96, 34, 32));
    222                         perchButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    223                         perchButton.setToolTipText(Messages.getString("PerchTip"));
    224                 }
    225                 return perchButton;
     138        private JRadioButton getButton(JRadioButton button, int x, int y, int w, int h, String tip) {
     139                button.setBounds(new Rectangle(x, y, w, h));
     140                button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     141                button.setToolTipText(Messages.getString(tip));
     142                return button;
    226143        }
    227144
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelTop.java

    r24839 r24870  
    2929        public PanelCol panelCol = null;
    3030        private ButtonGroup topButtons = null;
    31         public JRadioButton noTopButton = null;
    32         public JRadioButton canTopButton = null;
    33         public JRadioButton coneTopButton = null;
    34         public JRadioButton sphereTopButton = null;
    35         public JRadioButton XTopButton = null;
    36         public JRadioButton northTopButton = null;
    37         public JRadioButton southTopButton = null;
    38         public JRadioButton eastTopButton = null;
    39         public JRadioButton westTopButton = null;
    40         public JRadioButton spheres2TopButton = null;
    41         public JRadioButton boardDayButton = null;
    42         public JRadioButton diamondDayButton = null;
    43         public JRadioButton triangleDayButton = null;
    44         public JRadioButton triangleInvDayButton = null;
    45         public JRadioButton squareDayButton = null;
    46         public JRadioButton mooringTopButton = null;
     31        public JRadioButton noTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/NoTopButton.png")));
     32        public JRadioButton canTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanTopButton.png")));
     33        public JRadioButton coneTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeTopButton.png")));
     34        public JRadioButton sphereTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereTopButton.png")));
     35        public JRadioButton XTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/XTopButton.png")));
     36        public JRadioButton northTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/NorthTopButton.png")));
     37        public JRadioButton southTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SouthTopButton.png")));
     38        public JRadioButton eastTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/EastTopButton.png")));
     39        public JRadioButton westTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/WestTopButton.png")));
     40        public JRadioButton spheres2TopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/Spheres2TopButton.png")));
     41        public JRadioButton boardDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BoardDayButton.png")));
     42        public JRadioButton diamondDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/DiamondDayButton.png")));
     43        public JRadioButton triangleDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TriangleDayButton.png")));
     44        public JRadioButton triangleInvDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TriangleInvDayButton.png")));
     45        public JRadioButton squareDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SquareDayButton.png")));
     46        public JRadioButton mooringTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/MooringTopButton.png")));
    4747        ActionListener alTop = null;
    4848
     
    5353                this.setLayout(null);
    5454                this.add(panelCol, null);
    55                 this.add(getNoTopButton(), null);
    56                 this.add(getCanTopButton(), null);
    57                 this.add(getConeTopButton(), null);
    58                 this.add(getSphereTopButton(), null);
    59                 this.add(getXTopButton(), null);
    60                 this.add(getNorthTopButton(), null);
    61                 this.add(getSouthTopButton(), null);
    62                 this.add(getEastTopButton(), null);
    63                 this.add(getWestTopButton(), null);
    64                 this.add(getSpheres2TopButton(), null);
    65                 this.add(getBoardDayButton(), null);
    66                 this.add(getDiamondDayButton(), null);
    67                 this.add(getTriangleDayButton(), null);
    68                 this.add(getTriangleInvDayButton(), null);
    69                 this.add(getSquareDayButton(), null);
    70                 this.add(getMooringTopButton(), null);
     55                this.add(getButton(noTopButton, 40, 5, 27, 27, "NoTopTip"), null);
     56                this.add(getButton(canTopButton, 70, 5, 27, 27, "CanTopTip"), null);
     57                this.add(getButton(coneTopButton, 100, 5, 27, 27, "ConeTopTip"), null);
     58                this.add(getButton(sphereTopButton, 130, 5, 27, 27, "SphereTopTip"), null);
     59                this.add(getButton(XTopButton, 160, 5, 27, 27, "XTopTip"), null);
     60                this.add(getButton(northTopButton, 40, 35, 27, 27, "NorthTopTip"), null);
     61                this.add(getButton(southTopButton, 70, 35, 27, 27, "SouthTopTip"), null);
     62                this.add(getButton(eastTopButton, 100, 35, 27, 27, "EastTopTip"), null);
     63                this.add(getButton(westTopButton, 130, 35, 27, 27, "WestTopTip"), null);
     64                this.add(getButton(spheres2TopButton, 160, 35, 27, 27, "Spheres2TopTip"), null);
     65                this.add(getButton(boardDayButton, 40, 65, 27, 27, "BoardDayTip"), null);
     66                this.add(getButton(diamondDayButton, 70, 65, 27, 27, "DiamondDayTip"), null);
     67                this.add(getButton(triangleDayButton, 100, 65, 27, 27, "TriangleDayTip"), null);
     68                this.add(getButton(triangleInvDayButton, 130, 65, 27, 27, "TriangleInvDayTip"), null);
     69                this.add(getButton(squareDayButton, 160, 65, 27, 27, "SquareDayTip"), null);
     70                this.add(getButton(mooringTopButton, 40, 95, 27, 27, "MooringTopTip"), null);
    7171                topButtons = new ButtonGroup();
    7272                topButtons.add(noTopButton);
     
    130130        }
    131131
    132         private JRadioButton getNoTopButton() {
    133                 if (noTopButton == null) {
    134                         noTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/NoTopButton.png")));
    135                         noTopButton.setBounds(new Rectangle(40, 5, 27, 27));
    136                         noTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    137                         noTopButton.setToolTipText(Messages.getString("NoTopTip"));
    138                 }
    139                 return noTopButton;
    140         }
    141 
    142         private JRadioButton getCanTopButton() {
    143                 if (canTopButton == null) {
    144                         canTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/CanTopButton.png")));
    145                         canTopButton.setBounds(new Rectangle(70, 5, 27, 27));
    146                         canTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    147                         canTopButton.setToolTipText(Messages.getString("CanTopTip"));
    148                 }
    149                 return canTopButton;
    150         }
    151 
    152         private JRadioButton getConeTopButton() {
    153                 if (coneTopButton == null) {
    154                         coneTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/ConeTopButton.png")));
    155                         coneTopButton.setBounds(new Rectangle(100, 5, 27, 27));
    156                         coneTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    157                         coneTopButton.setToolTipText(Messages.getString("ConeTopTip"));
    158                 }
    159                 return coneTopButton;
    160         }
    161 
    162         private JRadioButton getSphereTopButton() {
    163                 if (sphereTopButton == null) {
    164                         sphereTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SphereTopButton.png")));
    165                         sphereTopButton.setBounds(new Rectangle(130, 5, 27, 27));
    166                         sphereTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    167                         sphereTopButton.setToolTipText(Messages.getString("SphereTopTip"));
    168                 }
    169                 return sphereTopButton;
    170         }
    171 
    172         private JRadioButton getXTopButton() {
    173                 if (XTopButton == null) {
    174                         XTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/XTopButton.png")));
    175                         XTopButton.setBounds(new Rectangle(160, 5, 27, 27));
    176                         XTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    177                         XTopButton.setToolTipText(Messages.getString("XTopTip"));
    178                 }
    179                 return XTopButton;
    180         }
    181 
    182         private JRadioButton getNorthTopButton() {
    183                 if (northTopButton == null) {
    184                         northTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/NorthTopButton.png")));
    185                         northTopButton.setBounds(new Rectangle(40, 35, 27, 27));
    186                         northTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    187                         northTopButton.setToolTipText(Messages.getString("NorthTopTip"));
    188                 }
    189                 return northTopButton;
    190         }
    191 
    192         private JRadioButton getSouthTopButton() {
    193                 if (southTopButton == null) {
    194                         southTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SouthTopButton.png")));
    195                         southTopButton.setBounds(new Rectangle(70, 35, 27, 27));
    196                         southTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    197                         southTopButton.setToolTipText(Messages.getString("SouthTopTip"));
    198                 }
    199                 return southTopButton;
    200         }
    201 
    202         private JRadioButton getEastTopButton() {
    203                 if (eastTopButton == null) {
    204                         eastTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/EastTopButton.png")));
    205                         eastTopButton.setBounds(new Rectangle(100, 35, 27, 27));
    206                         eastTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    207                         eastTopButton.setToolTipText(Messages.getString("EastTopTip"));
    208                 }
    209                 return eastTopButton;
    210         }
    211 
    212         private JRadioButton getWestTopButton() {
    213                 if (westTopButton == null) {
    214                         westTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/WestTopButton.png")));
    215                         westTopButton.setBounds(new Rectangle(130, 35, 27, 27));
    216                         westTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    217                         westTopButton.setToolTipText(Messages.getString("WestTopTip"));
    218                 }
    219                 return westTopButton;
    220         }
    221 
    222         private JRadioButton getSpheres2TopButton() {
    223                 if (spheres2TopButton == null) {
    224                         spheres2TopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/Spheres2TopButton.png")));
    225                         spheres2TopButton.setBounds(new Rectangle(160, 35, 27, 27));
    226                         spheres2TopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    227                         spheres2TopButton.setToolTipText(Messages.getString("Spheres2TopTip"));
    228                 }
    229                 return spheres2TopButton;
    230         }
    231 
    232         private JRadioButton getBoardDayButton() {
    233                 if (boardDayButton == null) {
    234                         boardDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/BoardDayButton.png")));
    235                         boardDayButton.setBounds(new Rectangle(40, 65, 27, 27));
    236                         boardDayButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    237                         boardDayButton.setToolTipText(Messages.getString("BoardDayTip"));
    238                 }
    239                 return boardDayButton;
    240         }
    241 
    242         private JRadioButton getDiamondDayButton() {
    243                 if (diamondDayButton == null) {
    244                         diamondDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/DiamondDayButton.png")));
    245                         diamondDayButton.setBounds(new Rectangle(70, 65, 27, 27));
    246                         diamondDayButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    247                         diamondDayButton.setToolTipText(Messages.getString("DiamondDayTip"));
    248                 }
    249                 return diamondDayButton;
    250         }
    251 
    252         private JRadioButton getTriangleDayButton() {
    253                 if (triangleDayButton == null) {
    254                         triangleDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TriangleDayButton.png")));
    255                         triangleDayButton.setBounds(new Rectangle(100, 65, 27, 27));
    256                         triangleDayButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    257                         triangleDayButton.setToolTipText(Messages.getString("TriangleDayTip"));
    258                 }
    259                 return triangleDayButton;
    260         }
    261 
    262         private JRadioButton getTriangleInvDayButton() {
    263                 if (triangleInvDayButton == null) {
    264                         triangleInvDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TriangleInvDayButton.png")));
    265                         triangleInvDayButton.setBounds(new Rectangle(130, 65, 27, 27));
    266                         triangleInvDayButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    267                         triangleInvDayButton.setToolTipText(Messages.getString("TriangleInvDayTip"));
    268                 }
    269                 return triangleInvDayButton;
    270         }
    271 
    272         private JRadioButton getSquareDayButton() {
    273                 if (squareDayButton == null) {
    274                         squareDayButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/SquareDayButton.png")));
    275                         squareDayButton.setBounds(new Rectangle(160, 65, 27, 27));
    276                         squareDayButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    277                         squareDayButton.setToolTipText(Messages.getString("SquareDayTip"));
    278                 }
    279                 return squareDayButton;
    280         }
    281 
    282         private JRadioButton getMooringTopButton() {
    283                 if (mooringTopButton == null) {
    284                         mooringTopButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/MooringTopButton.png")));
    285                         mooringTopButton.setBounds(new Rectangle(40, 95, 27, 27));
    286                         mooringTopButton.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    287                         mooringTopButton.setToolTipText(Messages.getString("MooringTopTip"));
    288                 }
    289                 return mooringTopButton;
     132        private JRadioButton getButton(JRadioButton button, int x, int y, int w, int h, String tip) {
     133                        button.setBounds(new Rectangle(x, y, w, h));
     134                        button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     135                        button.setToolTipText(Messages.getString(tip));
     136                return button;
    290137        }
    291138
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkCard.java

    r24839 r24870  
    153153                if (dlg.node == null)
    154154                        return;
     155                else
     156                        super.saveSign();
    155157
    156158                String shape = "";
     
    158160                switch (getShape()) {
    159161                case PILLAR:
    160                         super.saveSign("buoy_cardinal");
     162                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_cardinal"));
    161163                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:shape", "pillar"));
    162164                        break;
    163165                case SPAR:
    164                         super.saveSign("buoy_cardinal");
     166                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_cardinal"));
    165167                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_cardinal:shape", "spar"));
    166168                        break;
    167169                case BEACON:
    168                         super.saveSign("beacon_cardinal");
     170                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_cardinal"));
    169171                        break;
    170172                case TOWER:
    171                         super.saveSign("beacon_cardinal");
     173                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_cardinal"));
    172174                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_cardinal:shape", "tower"));
    173175                        break;
    174176                case FLOAT:
    175                         super.saveSign("light_float");
     177                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float"));
    176178                        break;
    177179                default:
     
    264266                        break;
    265267                }
    266                 saveTopMarkData(shape, "black");
    267                 saveLightData();
    268                 saveRadarFogData();
     268                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", shape));
     269                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:colour", "black"));
    269270        }
    270271
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkIsol.java

    r24848 r24870  
    104104        public void saveSign() {
    105105
    106                 if (dlg.node == null) {
     106                if (dlg.node == null)
    107107                        return;
    108                 }
     108                else
     109                        super.saveSign();
    109110
    110111                switch (getShape()) {
    111112                case PILLAR:
    112                         super.saveSign("buoy_isolated_danger");
     113                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_isolated_danger"));
    113114                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_isolated_danger:shape", "pillar"));
    114115                        break;
    115116                case SPAR:
    116                         super.saveSign("buoy_isolated_danger");
     117                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_isolated_danger"));
    117118                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_isolated_danger:shape", "spar"));
    118119                        break;
    119120                case BEACON:
    120                         super.saveSign("beacon_isolated_danger");
     121                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_isolated_danger"));
    121122                        break;
    122123                case TOWER:
    123                         super.saveSign("beacon_isolated_danger");
     124                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_isolated_danger"));
    124125                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_isolated_danger:shape", "tower"));
    125126                        break;
    126127                case FLOAT:
    127                         super.saveSign("light_float");
     128                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float"));
    128129                        break;
    129130                default:
     
    149150                }
    150151
    151                 saveTopMarkData("2 spheres", "black");
    152                 saveLightData();
    153                 saveRadarFogData();
     152                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "2 spheres"));
     153                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:colour", "black"));
    154154        }
    155155}
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLat.java

    r24848 r24870  
    472472        public void saveSign() {
    473473
    474                 if (dlg.node == null) {
     474                if (dlg.node == null)
    475475                        return;
    476                 }
     476                else
     477                        super.saveSign();
    477478
    478479                Cat cat = getCategory();
     
    485486                        switch (getShape()) {
    486487                        case CAN:
    487                                 super.saveSign("buoy_lateral");
     488                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));
    488489                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "can"));
    489490                                break;
    490491                        case PILLAR:
    491                                 super.saveSign("buoy_lateral");
     492                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));
    492493                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "pillar"));
    493494                                break;
    494495                        case SPAR:
    495                                 super.saveSign("buoy_lateral");
     496                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));
    496497                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "spar"));
    497498                                break;
    498499                        case BEACON:
    499                                 super.saveSign("beacon_lateral");
     500                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral"));
    500501                                break;
    501502                        case TOWER:
    502                                 super.saveSign("beacon_lateral");
     503                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral"));
    503504                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "tower"));
    504505                                break;
    505506                        case FLOAT:
    506                                 super.saveSign("light_float");
     507                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float"));
    507508                                break;
    508509                        case PERCH:
    509                                 super.saveSign("beacon_lateral");
     510                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral"));
    510511                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "perch"));
    511512                                break;
     
    555556                        switch (getShape()) {
    556557                        case CAN:
    557                                 super.saveSign("buoy_lateral");
     558                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));
    558559                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "can"));
    559560                                break;
    560561                        case PILLAR:
    561                                 super.saveSign("buoy_lateral");
     562                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));
    562563                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "pillar"));
    563564                                break;
    564565                        case SPAR:
    565                                 super.saveSign("buoy_lateral");
     566                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));
    566567                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "spar"));
    567568                                break;
    568569                        case BEACON:
    569                                 super.saveSign("beacon_lateral");
     570                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral"));
    570571                                break;
    571572                        case TOWER:
    572                                 super.saveSign("beacon_lateral");
     573                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral"));
    573574                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "tower"));
    574575                                break;
    575576                        case FLOAT:
    576                                 super.saveSign("light_float");
     577                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float"));
    577578                                break;
    578579                        default:
     
    621622                        switch (getShape()) {
    622623                        case CONE:
    623                                 super.saveSign("buoy_lateral");
     624                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));
    624625                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "conical"));
    625626                                break;
    626627                        case PILLAR:
    627                                 super.saveSign("buoy_lateral");
     628                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));
    628629                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "pillar"));
    629630                                break;
    630631                        case SPAR:
    631                                 super.saveSign("buoy_lateral");
     632                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));
    632633                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "spar"));
    633634                                break;
    634635                        case BEACON:
    635                                 super.saveSign("beacon_lateral");
     636                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral"));
    636637                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "stake"));
    637638                                break;
    638639                        case TOWER:
    639                                 super.saveSign("beacon_lateral");
     640                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral"));
    640641                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "tower"));
    641642                                break;
    642643                        case FLOAT:
    643                                 super.saveSign("light_float");
     644                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float"));
    644645                                break;
    645646                        case PERCH:
    646                                 super.saveSign("beacon_lateral");
     647                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral"));
    647648                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "perch"));
    648649                                break;
     
    692693                        switch (getShape()) {
    693694                        case CONE:
    694                                 super.saveSign("buoy_lateral");
     695                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));
    695696                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "conical"));
    696697                                break;
    697698                        case PILLAR:
    698                                 super.saveSign("buoy_lateral");
     699                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));
    699700                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "pillar"));
    700701                                break;
    701702                        case SPAR:
    702                                 super.saveSign("buoy_lateral");
     703                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_lateral"));
    703704                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_lateral:shape", "spar"));
    704705                                break;
    705706                        case BEACON:
    706                                 super.saveSign("beacon_lateral");
     707                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral"));
    707708                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "stake"));
    708709                                break;
    709710                        case TOWER:
    710                                 super.saveSign("beacon_lateral");
     711                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_lateral"));
    711712                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_lateral:shape", "tower"));
    712713                                break;
    713714                        case FLOAT:
    714                                 super.saveSign("light_float");
     715                                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float"));
    715716                                break;
    716717                        default:
     
    759760                default:
    760761                }
    761                 saveTopMarkData(shape, colour);
    762                 saveLightData();
    763                 saveRadarFogData();
     762                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", shape));
     763                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:colour", colour));
    764764
    765765                Main.pref.put("tomsplugin.IALA", getRegion() ? "B" : "A");
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkLight.java

    r24848 r24870  
    44
    55import javax.swing.ImageIcon;
     6
     7import org.openstreetmap.josm.Main;
     8import org.openstreetmap.josm.command.ChangePropertyCommand;
    69
    710import oseam.dialogs.OSeaMAction;
     
    8083
    8184        public void saveSign() {
    82                 if (dlg.node == null) {
     85                if (dlg.node == null)
    8386                        return;
    84                 }
     87                else
     88                        super.saveSign();
    8589
    8690                switch (getCategory()) {
    8791                case LIGHT_HOUSE:
    88                         super.saveSign("landmark");
     92                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "landmark"));
    8993                        break;
    9094                case LIGHT_MAJOR:
    91                         super.saveSign("light_major");
     95                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_major"));
    9296                        break;
    9397                case LIGHT_MINOR:
    94                         super.saveSign("light_minor");
     98                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_minor"));
    9599                        break;
    96100                case LIGHT_VESSEL:
    97                         super.saveSign("light_vessel");
     101                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_vessel"));
    98102                        break;
    99103                case LIGHT_FLOAT:
    100                         super.saveSign("light_float");
     104                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float"));
    101105                        break;
    102106                default:
    103107                }
    104                 saveLightData();
    105                 saveRadarFogData();
    106108        }
    107109
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSaw.java

    r24848 r24870  
    135135
    136136        public void saveSign() {
    137                 if (dlg.node == null) {
     137                if (dlg.node == null)
    138138                        return;
    139                 }
     139                else
     140                        super.saveSign();
    140141
    141142                switch (getShape()) {
    142143                case PILLAR:
    143                         super.saveSign("buoy_safe_water");
     144                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_safe_water"));
    144145                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_safe_water:shape", "pillar"));
    145146                        break;
    146147                case SPAR:
    147                         super.saveSign("buoy_safe_water");
     148                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_safe_water"));
    148149                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_safe_water:shape", "spar"));
    149150                        break;
    150151                case SPHERE:
    151                         super.saveSign("buoy_safe_water");
     152                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_safe_water"));
    152153                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_safe_water:shape", "sphere"));
    153154                        break;
    154155                case BEACON:
    155                         super.saveSign("beacon_safe_water");
     156                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_safe_water"));
    156157                        break;
    157158                case FLOAT:
    158                         super.saveSign("light_float");
     159                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float"));
    159160                        break;
    160161                default:
     
    178179                default:
    179180                }
    180                 saveTopMarkData("sphere", "red");
    181                 saveLightData();
    182                 saveRadarFogData();
     181                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:shape", "sphere"));
     182                Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:topmark:colour", "red"));
    183183        }
    184184}
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/MarkSpec.java

    r24848 r24870  
    162162
    163163        public void saveSign() {
    164                 if (dlg.node == null) {
     164                if (dlg.node == null)
    165165                        return;
    166                 }
     166                else
     167                        super.saveSign();
    167168
    168169                switch (getShape()) {
    169170                case PILLAR:
    170                         super.saveSign("buoy_special_purpose");
     171                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose"));
    171172                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "pillar"));
    172173                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow"));
    173174                        break;
    174175                case SPAR:
    175                         super.saveSign("buoy_special_purpose");
     176                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose"));
    176177                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "spar"));
    177178                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow"));
    178179                        break;
    179180                case CAN:
    180                         super.saveSign("buoy_special_purpose");
     181                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose"));
    181182                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "can"));
    182183                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow"));
    183184                        break;
    184185                case CONE:
    185                         super.saveSign("buoy_special_purpose");
     186                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose"));
    186187                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "conical"));
    187188                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow"));
    188189                        break;
    189190                case SPHERE:
    190                         super.saveSign("buoy_special_purpose");
     191                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose"));
    191192                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "sphere"));
    192193                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow"));
    193194                        break;
    194195                case BARREL:
    195                         super.saveSign("buoy_special_purpose");
     196                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "buoy_special_purpose"));
    196197                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:shape", "barrel"));
    197198                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:buoy_special_purpose:colour", "yellow"));
    198199                        break;
    199200                case FLOAT:
    200                         super.saveSign("light_float");
     201                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "light_float"));
    201202                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:light_float:colour", "yellow"));
    202203                        break;
    203204                case BEACON:
    204                         super.saveSign("beacon_special_purpose");
     205                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_special_purpose"));
    205206                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_special_purpose:colour", "yellow"));
    206207                        break;
    207208                case TOWER:
    208                         super.saveSign("beacon_special_purpose");
     209                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:type", "beacon_special_purpose"));
    209210                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_special_purpose:shape", "tower"));
    210211                        Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node, "seamark:beacon_special_purpose:colour", "yellow"));
     
    218219                 * saveTopMarkData("cylinder", "yellow"); break; case TOP_YELLOW_CONE:
    219220                 * saveTopMarkData("cone, point up", "yellow"); break; }
    220                  */saveLightData();
    221                 saveRadarFogData();
     221                 * Main.main.undoRedo.add(new ChangePropertyCommand(dlg.node,
     222                 * "seamark:topmark:shape", shape)); Main.main.undoRedo.add(new
     223                 * ChangePropertyCommand(dlg.node, "seamark:topmark:colour", "yellow"));
     224                 */
    222225        }
    223226}
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java

    r24839 r24870  
    1616abstract public class SeaMark {
    1717
    18         public final static boolean IALA_A = false;
    19         public final static boolean IALA_B = true;
    20 
    21         public enum Cat {
    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
    23         }
    24 
    25         public enum Shp {
    26                 UNKNOWN, PILLAR, SPAR, CAN, CONE, SPHERE, BARREL, FLOAT, SUPER, BEACON, TOWER, STAKE, PERCH
    27         }
    28 
    29         public enum Col {
    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
    31         }
    32 
    33         public enum Top {
    34                 UNKNOWN, X_SHAPE, CAN, CONE
    35         }
    36 
    37         public enum Rtb {
    38                 UNKNOWN, RACON, RAMARK, LEADING
    39         }
    40 
    41         public enum Fog {
    42                 UNKNOWN, HORN, SIREN, DIA, BELL, WHIS, GONG, EXPLOS
    43         }
    44 
    4518        /**
    4619         * Variables
     
    5831        }
    5932
     33        public final static boolean IALA_A = false;
     34        public final static boolean IALA_B = true;
     35
    6036        private boolean region = false;
    6137
     
    6844        }
    6945
     46        public enum Col {
     47                UNKNOWN, WHITE, RED, ORANGE, AMBER, YELLOW, GREEN, BLUE, VIOLET,
     48                BLACK, RED_GREEN_RED, GREEN_RED_GREEN, RED_WHITE,
     49                BLACK_YELLOW, BLACK_YELLOW_BLACK, YELLOW_BLACK, YELLOW_BLACK_YELLOW, BLACK_RED_BLACK
     50        }
     51
    7052        private Col colour = Col.UNKNOWN;
    7153
     
    8870        }
    8971
     72        public enum Cat {
     73                UNKNOWN, LAT_PORT, LAT_STBD, LAT_PREF_PORT, LAT_PREF_STBD,
     74                CARD_NORTH, CARD_EAST, CARD_SOUTH, CARD_WEST,
     75                LIGHT_HOUSE, LIGHT_MAJOR, LIGHT_MINOR, LIGHT_VESSEL, LIGHT_FLOAT
     76        }
     77
    9078        private Cat category = Cat.UNKNOWN;
    9179
     
    9886        }
    9987
     88        public enum Shp {
     89                UNKNOWN, PILLAR, SPAR, CAN, CONE, SPHERE, BARREL, FLOAT, SUPER, BEACON, TOWER, STAKE, PERCH
     90        }
     91
    10092        private Shp shape = Shp.UNKNOWN;
    10193
     
    108100        }
    109101
     102        public enum Top {
     103                UNKNOWN, X_SHAPE, CAN, CONE
     104        }
     105
    110106        private boolean TopMark = false;
    111107
     
    138134        }
    139135
     136        public enum Rtb {
     137                UNKNOWN, RACON, RAMARK, LEADING
     138        }
     139
    140140        private Rtb RaType = Rtb.UNKNOWN;
    141141
     
    166166        public void setFog(boolean fog) {
    167167                FogSignal = fog;
     168        }
     169
     170        public enum Fog {
     171                UNKNOWN, HORN, SIREN, DIA, BELL, WHIS, GONG, EXPLOS
    168172        }
    169173
     
    599603                 */}
    600604
    601         public void saveSign(String type) {
     605        public void saveSign() {
    602606                Iterator<String> it = dlg.node.getKeys().keySet().iterator();
    603607                String str;
     
    613617                if (!str.isEmpty())
    614618                        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() {
    619619                /*
    620620                 * String colour; if (dlg.cM01Fired.isSelected()) { if (!(colour =
     
    686686                 * ChangePropertyCommand(Node, "seamark:light:" + i + ":sector_end",
    687687                 * Bearing2[i])); } }
    688                  */}
    689 
    690         protected void saveTopMarkData(String shape, String colour) {
    691                 /*
    692688                 * if (hasTopMark()) { Main.main.undoRedo.add(new
    693689                 * ChangePropertyCommand(Node, "seamark:topmark:shape", shape));
    694690                 * Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    695691                 * "seamark:topmark:colour", colour)); }
    696                  */}
    697 
    698         protected void saveRadarFogData() {
    699                 /*
    700692                 * if (hasRadar()) { Main.main.undoRedo.add(new ChangePropertyCommand(Node,
    701693                 * "seamark:radar_reflector", "yes")); } if (hasRacon()) { switch (RaType) {
Note: See TracChangeset for help on using the changeset viewer.