Changeset 24720 in osm for applications


Ignore:
Timestamp:
2010-12-12T14:51:43+01:00 (14 years ago)
Author:
malcolmh
Message:

more panels

Location:
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
Files:
1 edited
4 copied

Legend:

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

    r24665 r24720  
    7373        private PanelSpec panelSpec = null;
    7474        private PanelLights panelLights = null;
     75        private PanelTop panelTop = null;
     76        private PanelFog panelFog = null;
     77        private PanelRadar panelRadar = null;
     78        private PanelLit panelLit = null;
    7579
    7680        public OSeaMAction() {
     
    99103                panelLights.setBounds(new Rectangle(65, 0, 335, 160));
    100104                panelLights.setVisible(false);
     105                panelTop = new PanelTop();
     106                panelTop.setBounds(new Rectangle(40, 165, 220, 155));
     107                panelTop.setVisible(false);
     108                panelFog = new PanelFog();
     109                panelFog.setBounds(new Rectangle(40, 165, 220, 155));
     110                panelFog.setVisible(false);
     111                panelRadar = new PanelRadar();
     112                panelRadar.setBounds(new Rectangle(40, 165, 220, 155));
     113                panelRadar.setVisible(false);
     114                panelLit = new PanelLit();
     115                panelLit.setBounds(new Rectangle(40, 165, 220, 155));
     116                panelLit.setVisible(false);
    101117        }
    102118
     
    139155                        oseamPanel.add(panelSpec, null);
    140156                        oseamPanel.add(panelLights, null);
     157                        oseamPanel.add(panelTop, null);
     158                        oseamPanel.add(panelFog, null);
     159                        oseamPanel.add(panelRadar, null);
     160                        oseamPanel.add(panelLit, null);
    141161                        typeButtons = new ButtonGroup();
    142162                        typeButtons.add(chanButton);
     
    192212                        ActionListener alMisc = new ActionListener() {
    193213                                public void actionPerformed(java.awt.event.ActionEvent e) {
    194                                         topButton.setEnabled(!topButton.isSelected());
    195                                         fogButton.setEnabled(!fogButton.isSelected());
    196                                         radarButton.setEnabled(!radarButton.isSelected());
    197                                         litButton.setEnabled(!litButton.isSelected());
     214                                        if (topButton.isSelected()) {
     215                                                topButton.setEnabled(false);
     216                                                panelTop.setVisible(true);
     217                                        } else {
     218                                                topButton.setEnabled(true);
     219                                                panelTop.setVisible(false);
     220                                        }
     221                                        if (fogButton.isSelected()) {
     222                                                fogButton.setEnabled(false);
     223                                                panelFog.setVisible(true);
     224                                        } else {
     225                                                fogButton.setEnabled(true);
     226                                                panelFog.setVisible(false);
     227                                        }
     228                                        if (radarButton.isSelected()) {
     229                                                radarButton.setEnabled(false);
     230                                                panelRadar.setVisible(true);
     231                                        } else {
     232                                                radarButton.setEnabled(true);
     233                                                panelRadar.setVisible(false);
     234                                        }
     235                                        if (litButton.isSelected()) {
     236                                                litButton.setEnabled(false);
     237                                                panelLit.setVisible(true);
     238                                        } else {
     239                                                litButton.setEnabled(true);
     240                                                panelLit.setVisible(false);
     241                                        }
    198242                                }
    199243                        };
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelFog.java

    r24710 r24720  
    11package oseam.panels;
    22
    3 import javax.swing.BorderFactory;
    43import javax.swing.JPanel;
    54
     
    2221import java.awt.event.ActionListener;
    2322
    24 public class PanelHaz extends JPanel {
     23public class PanelFog extends JPanel {
    2524
    26         private ButtonGroup catButtons = null;
    27         private JRadioButton northButton = null;
    28         private JRadioButton southButton = null;
    29         private JRadioButton eastButton = null;
    30         private JRadioButton westButton = null;
    31         private JRadioButton isolButton = null;
    3225
    33         private ButtonGroup shapeButtons = null;
    34         private JRadioButton pillarButton = null;
    35         private JRadioButton sparButton = null;
    36         private JRadioButton floatButton = null;
    37         private JRadioButton beaconButton = null;
    38         private JRadioButton towerButton = null;
    39 
    40         public PanelHaz() {
     26        public PanelFog() {
    4127                super();
    4228                initialize();
     
    4531        private void initialize() {
    4632                this.setLayout(null);
    47                 this.add(getNothButton(), null);
    48                 this.add(getSouthButton(), null);
    49                 this.add(getEastButton(), null);
    50                 this.add(getWestButton(), null);
    51                 this.add(getIsolButton(), null);
    52                 catButtons = new ButtonGroup();
    53                 catButtons.add(northButton);
    54                 catButtons.add(southButton);
    55                 catButtons.add(eastButton);
    56                 catButtons.add(westButton);
    57                 catButtons.add(isolButton);
    58                 ActionListener alCat = new ActionListener() {
    59                         public void actionPerformed(java.awt.event.ActionEvent e) {
    60                                 northButton.setEnabled(!northButton.isSelected());
    61                                 southButton.setEnabled(!southButton.isSelected());
    62                                 eastButton.setEnabled(!eastButton.isSelected());
    63                                 westButton.setEnabled(!westButton.isSelected());
    64                                 isolButton.setEnabled(!isolButton.isSelected());
    65                         }
    66                 };
    67                 northButton.addActionListener(alCat);
    68                 southButton.addActionListener(alCat);
    69                 eastButton.addActionListener(alCat);
    70                 westButton.addActionListener(alCat);
    71                 isolButton.addActionListener(alCat);
    72 
    73                 this.add(getPillarButton(), null);
    74                 this.add(getSparButton(), null);
    75                 this.add(getFloatButton(), null);
    76                 this.add(getBeaconButton(), null);
    77                 this.add(getTowerButton(), null);
    78                 shapeButtons = new ButtonGroup();
    79                 shapeButtons.add(pillarButton);
    80                 shapeButtons.add(sparButton);
    81                 shapeButtons.add(floatButton);
    82                 shapeButtons.add(beaconButton);
    83                 shapeButtons.add(towerButton);
    84                 ActionListener alShape = new ActionListener() {
    85                         public void actionPerformed(java.awt.event.ActionEvent e) {
    86                                 pillarButton.setEnabled(!pillarButton.isSelected());
    87                                 sparButton.setEnabled(!sparButton.isSelected());
    88                                 floatButton.setEnabled(!floatButton.isSelected());
    89                                 beaconButton.setEnabled(!beaconButton.isSelected());
    90                                 towerButton.setEnabled(!towerButton.isSelected());
    91                         }
    92                 };
    93                 pillarButton.addActionListener(alShape);
    94                 sparButton.addActionListener(alShape);
    95                 floatButton.addActionListener(alShape);
    96                 beaconButton.addActionListener(alShape);
    97                 towerButton.addActionListener(alShape);
    9833        }
    99 
    100         private JRadioButton getNothButton() {
    101                 if (northButton == null) {
    102                         northButton = new JRadioButton(new ImageIcon(getClass()
    103                                         .getResource("/images/CardNButton.png")));
    104                         northButton.setBounds(new Rectangle(0, 0, 55, 32));
    105                         northButton.setToolTipText(Messages.getString("NorthTip"));
    106                 }
    107                 return northButton;
    108         }
    109 
    110         private JRadioButton getSouthButton() {
    111                 if (southButton == null) {
    112                         southButton = new JRadioButton(new ImageIcon(getClass()
    113                                         .getResource("/images/CardSButton.png")));
    114                         southButton.setBounds(new Rectangle(0, 32, 55, 32));
    115                         southButton.setToolTipText(Messages.getString("SouthTip"));
    116                 }
    117                 return southButton;
    118         }
    119 
    120         private JRadioButton getEastButton() {
    121                 if (eastButton == null) {
    122                         eastButton = new JRadioButton(new ImageIcon(getClass().getResource(
    123                                         "/images/CardEButton.png")));
    124                         eastButton.setBounds(new Rectangle(0, 64, 55, 32));
    125                         eastButton.setToolTipText(Messages.getString("EastTip"));
    126                 }
    127                 return eastButton;
    128         }
    129 
    130         private JRadioButton getWestButton() {
    131                 if (westButton == null) {
    132                         westButton = new JRadioButton(new ImageIcon(getClass().getResource(
    133                                         "/images/CardWButton.png")));
    134                         westButton.setBounds(new Rectangle(0, 96, 55, 32));
    135                         westButton.setToolTipText(Messages.getString("WestTip"));
    136                 }
    137                 return westButton;
    138         }
    139 
    140         private JRadioButton getIsolButton() {
    141                 if (isolButton == null) {
    142                         isolButton = new JRadioButton(new ImageIcon(getClass().getResource(
    143                                         "/images/IsolButton.png")));
    144                         isolButton.setBounds(new Rectangle(0, 128, 55, 32));
    145                         isolButton.setToolTipText(Messages.getString("IsolTip"));
    146                 }
    147                 return isolButton;
    148         }
    149 
    150         private JRadioButton getPillarButton() {
    151                 if (pillarButton == null) {
    152                         pillarButton = new JRadioButton(new ImageIcon(getClass()
    153                                         .getResource("/images/PillarButton.png")));
    154                         pillarButton.setBounds(new Rectangle(55, 0, 90, 32));
    155                         pillarButton.setToolTipText(Messages.getString("PillarTip"));
    156                 }
    157                 return pillarButton;
    158         }
    159 
    160         private JRadioButton getSparButton() {
    161                 if (sparButton == null) {
    162                         sparButton = new JRadioButton(new ImageIcon(getClass().getResource(
    163                                         "/images/SparButton.png")));
    164                         sparButton.setBounds(new Rectangle(55, 32, 90, 32));
    165                         sparButton.setToolTipText(Messages.getString("SparTip"));
    166                 }
    167                 return sparButton;
    168         }
    169 
    170         private JRadioButton getFloatButton() {
    171                 if (floatButton == null) {
    172                         floatButton = new JRadioButton(new ImageIcon(getClass()
    173                                         .getResource("/images/FloatButton.png")));
    174                         floatButton.setBounds(new Rectangle(55, 64, 90, 32));
    175                         floatButton.setToolTipText(Messages.getString("FloatTip"));
    176                 }
    177                 return floatButton;
    178         }
    179 
    180         private JRadioButton getBeaconButton() {
    181                 if (beaconButton == null) {
    182                         beaconButton = new JRadioButton(new ImageIcon(getClass()
    183                                         .getResource("/images/BeaconButton.png")));
    184                         beaconButton.setBounds(new Rectangle(55, 96, 90, 32));
    185                         beaconButton.setToolTipText(Messages.getString("BeaconTip"));
    186                 }
    187                 return beaconButton;
    188         }
    189 
    190         private JRadioButton getTowerButton() {
    191                 if (towerButton == null) {
    192                         towerButton = new JRadioButton(new ImageIcon(getClass()
    193                                         .getResource("/images/TowerButton.png")));
    194                         towerButton.setBounds(new Rectangle(55, 128, 90, 32));
    195                         towerButton.setToolTipText(Messages.getString("TowerTip"));
    196                 }
    197                 return towerButton;
    198         }
    199 
    20034}
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelLit.java

    r24710 r24720  
    11package oseam.panels;
    22
    3 import javax.swing.BorderFactory;
    43import javax.swing.JPanel;
    54
     
    2221import java.awt.event.ActionListener;
    2322
    24 public class PanelHaz extends JPanel {
     23public class PanelLit extends JPanel {
    2524
    26         private ButtonGroup catButtons = null;
    27         private JRadioButton northButton = null;
    28         private JRadioButton southButton = null;
    29         private JRadioButton eastButton = null;
    30         private JRadioButton westButton = null;
    31         private JRadioButton isolButton = null;
    32 
    33         private ButtonGroup shapeButtons = null;
    34         private JRadioButton pillarButton = null;
    35         private JRadioButton sparButton = null;
    36         private JRadioButton floatButton = null;
    37         private JRadioButton beaconButton = null;
    38         private JRadioButton towerButton = null;
    39 
    40         public PanelHaz() {
     25        public PanelLit() {
    4126                super();
    4227                initialize();
     
    4530        private void initialize() {
    4631                this.setLayout(null);
    47                 this.add(getNothButton(), null);
    48                 this.add(getSouthButton(), null);
    49                 this.add(getEastButton(), null);
    50                 this.add(getWestButton(), null);
    51                 this.add(getIsolButton(), null);
    52                 catButtons = new ButtonGroup();
    53                 catButtons.add(northButton);
    54                 catButtons.add(southButton);
    55                 catButtons.add(eastButton);
    56                 catButtons.add(westButton);
    57                 catButtons.add(isolButton);
    58                 ActionListener alCat = new ActionListener() {
    59                         public void actionPerformed(java.awt.event.ActionEvent e) {
    60                                 northButton.setEnabled(!northButton.isSelected());
    61                                 southButton.setEnabled(!southButton.isSelected());
    62                                 eastButton.setEnabled(!eastButton.isSelected());
    63                                 westButton.setEnabled(!westButton.isSelected());
    64                                 isolButton.setEnabled(!isolButton.isSelected());
    65                         }
    66                 };
    67                 northButton.addActionListener(alCat);
    68                 southButton.addActionListener(alCat);
    69                 eastButton.addActionListener(alCat);
    70                 westButton.addActionListener(alCat);
    71                 isolButton.addActionListener(alCat);
    72 
    73                 this.add(getPillarButton(), null);
    74                 this.add(getSparButton(), null);
    75                 this.add(getFloatButton(), null);
    76                 this.add(getBeaconButton(), null);
    77                 this.add(getTowerButton(), null);
    78                 shapeButtons = new ButtonGroup();
    79                 shapeButtons.add(pillarButton);
    80                 shapeButtons.add(sparButton);
    81                 shapeButtons.add(floatButton);
    82                 shapeButtons.add(beaconButton);
    83                 shapeButtons.add(towerButton);
    84                 ActionListener alShape = new ActionListener() {
    85                         public void actionPerformed(java.awt.event.ActionEvent e) {
    86                                 pillarButton.setEnabled(!pillarButton.isSelected());
    87                                 sparButton.setEnabled(!sparButton.isSelected());
    88                                 floatButton.setEnabled(!floatButton.isSelected());
    89                                 beaconButton.setEnabled(!beaconButton.isSelected());
    90                                 towerButton.setEnabled(!towerButton.isSelected());
    91                         }
    92                 };
    93                 pillarButton.addActionListener(alShape);
    94                 sparButton.addActionListener(alShape);
    95                 floatButton.addActionListener(alShape);
    96                 beaconButton.addActionListener(alShape);
    97                 towerButton.addActionListener(alShape);
    9832        }
    99 
    100         private JRadioButton getNothButton() {
    101                 if (northButton == null) {
    102                         northButton = new JRadioButton(new ImageIcon(getClass()
    103                                         .getResource("/images/CardNButton.png")));
    104                         northButton.setBounds(new Rectangle(0, 0, 55, 32));
    105                         northButton.setToolTipText(Messages.getString("NorthTip"));
    106                 }
    107                 return northButton;
    108         }
    109 
    110         private JRadioButton getSouthButton() {
    111                 if (southButton == null) {
    112                         southButton = new JRadioButton(new ImageIcon(getClass()
    113                                         .getResource("/images/CardSButton.png")));
    114                         southButton.setBounds(new Rectangle(0, 32, 55, 32));
    115                         southButton.setToolTipText(Messages.getString("SouthTip"));
    116                 }
    117                 return southButton;
    118         }
    119 
    120         private JRadioButton getEastButton() {
    121                 if (eastButton == null) {
    122                         eastButton = new JRadioButton(new ImageIcon(getClass().getResource(
    123                                         "/images/CardEButton.png")));
    124                         eastButton.setBounds(new Rectangle(0, 64, 55, 32));
    125                         eastButton.setToolTipText(Messages.getString("EastTip"));
    126                 }
    127                 return eastButton;
    128         }
    129 
    130         private JRadioButton getWestButton() {
    131                 if (westButton == null) {
    132                         westButton = new JRadioButton(new ImageIcon(getClass().getResource(
    133                                         "/images/CardWButton.png")));
    134                         westButton.setBounds(new Rectangle(0, 96, 55, 32));
    135                         westButton.setToolTipText(Messages.getString("WestTip"));
    136                 }
    137                 return westButton;
    138         }
    139 
    140         private JRadioButton getIsolButton() {
    141                 if (isolButton == null) {
    142                         isolButton = new JRadioButton(new ImageIcon(getClass().getResource(
    143                                         "/images/IsolButton.png")));
    144                         isolButton.setBounds(new Rectangle(0, 128, 55, 32));
    145                         isolButton.setToolTipText(Messages.getString("IsolTip"));
    146                 }
    147                 return isolButton;
    148         }
    149 
    150         private JRadioButton getPillarButton() {
    151                 if (pillarButton == null) {
    152                         pillarButton = new JRadioButton(new ImageIcon(getClass()
    153                                         .getResource("/images/PillarButton.png")));
    154                         pillarButton.setBounds(new Rectangle(55, 0, 90, 32));
    155                         pillarButton.setToolTipText(Messages.getString("PillarTip"));
    156                 }
    157                 return pillarButton;
    158         }
    159 
    160         private JRadioButton getSparButton() {
    161                 if (sparButton == null) {
    162                         sparButton = new JRadioButton(new ImageIcon(getClass().getResource(
    163                                         "/images/SparButton.png")));
    164                         sparButton.setBounds(new Rectangle(55, 32, 90, 32));
    165                         sparButton.setToolTipText(Messages.getString("SparTip"));
    166                 }
    167                 return sparButton;
    168         }
    169 
    170         private JRadioButton getFloatButton() {
    171                 if (floatButton == null) {
    172                         floatButton = new JRadioButton(new ImageIcon(getClass()
    173                                         .getResource("/images/FloatButton.png")));
    174                         floatButton.setBounds(new Rectangle(55, 64, 90, 32));
    175                         floatButton.setToolTipText(Messages.getString("FloatTip"));
    176                 }
    177                 return floatButton;
    178         }
    179 
    180         private JRadioButton getBeaconButton() {
    181                 if (beaconButton == null) {
    182                         beaconButton = new JRadioButton(new ImageIcon(getClass()
    183                                         .getResource("/images/BeaconButton.png")));
    184                         beaconButton.setBounds(new Rectangle(55, 96, 90, 32));
    185                         beaconButton.setToolTipText(Messages.getString("BeaconTip"));
    186                 }
    187                 return beaconButton;
    188         }
    189 
    190         private JRadioButton getTowerButton() {
    191                 if (towerButton == null) {
    192                         towerButton = new JRadioButton(new ImageIcon(getClass()
    193                                         .getResource("/images/TowerButton.png")));
    194                         towerButton.setBounds(new Rectangle(55, 128, 90, 32));
    195                         towerButton.setToolTipText(Messages.getString("TowerTip"));
    196                 }
    197                 return towerButton;
    198         }
    199 
    20033}
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelRadar.java

    r24710 r24720  
    11package oseam.panels;
    22
    3 import javax.swing.BorderFactory;
    43import javax.swing.JPanel;
    54
     
    2221import java.awt.event.ActionListener;
    2322
    24 public class PanelHaz extends JPanel {
     23public class PanelRadar extends JPanel {
    2524
    26         private ButtonGroup catButtons = null;
    27         private JRadioButton northButton = null;
    28         private JRadioButton southButton = null;
    29         private JRadioButton eastButton = null;
    30         private JRadioButton westButton = null;
    31         private JRadioButton isolButton = null;
    3225
    33         private ButtonGroup shapeButtons = null;
    34         private JRadioButton pillarButton = null;
    35         private JRadioButton sparButton = null;
    36         private JRadioButton floatButton = null;
    37         private JRadioButton beaconButton = null;
    38         private JRadioButton towerButton = null;
    39 
    40         public PanelHaz() {
     26        public PanelRadar() {
    4127                super();
    4228                initialize();
     
    4531        private void initialize() {
    4632                this.setLayout(null);
    47                 this.add(getNothButton(), null);
    48                 this.add(getSouthButton(), null);
    49                 this.add(getEastButton(), null);
    50                 this.add(getWestButton(), null);
    51                 this.add(getIsolButton(), null);
    52                 catButtons = new ButtonGroup();
    53                 catButtons.add(northButton);
    54                 catButtons.add(southButton);
    55                 catButtons.add(eastButton);
    56                 catButtons.add(westButton);
    57                 catButtons.add(isolButton);
    58                 ActionListener alCat = new ActionListener() {
    59                         public void actionPerformed(java.awt.event.ActionEvent e) {
    60                                 northButton.setEnabled(!northButton.isSelected());
    61                                 southButton.setEnabled(!southButton.isSelected());
    62                                 eastButton.setEnabled(!eastButton.isSelected());
    63                                 westButton.setEnabled(!westButton.isSelected());
    64                                 isolButton.setEnabled(!isolButton.isSelected());
    65                         }
    66                 };
    67                 northButton.addActionListener(alCat);
    68                 southButton.addActionListener(alCat);
    69                 eastButton.addActionListener(alCat);
    70                 westButton.addActionListener(alCat);
    71                 isolButton.addActionListener(alCat);
    72 
    73                 this.add(getPillarButton(), null);
    74                 this.add(getSparButton(), null);
    75                 this.add(getFloatButton(), null);
    76                 this.add(getBeaconButton(), null);
    77                 this.add(getTowerButton(), null);
    78                 shapeButtons = new ButtonGroup();
    79                 shapeButtons.add(pillarButton);
    80                 shapeButtons.add(sparButton);
    81                 shapeButtons.add(floatButton);
    82                 shapeButtons.add(beaconButton);
    83                 shapeButtons.add(towerButton);
    84                 ActionListener alShape = new ActionListener() {
    85                         public void actionPerformed(java.awt.event.ActionEvent e) {
    86                                 pillarButton.setEnabled(!pillarButton.isSelected());
    87                                 sparButton.setEnabled(!sparButton.isSelected());
    88                                 floatButton.setEnabled(!floatButton.isSelected());
    89                                 beaconButton.setEnabled(!beaconButton.isSelected());
    90                                 towerButton.setEnabled(!towerButton.isSelected());
    91                         }
    92                 };
    93                 pillarButton.addActionListener(alShape);
    94                 sparButton.addActionListener(alShape);
    95                 floatButton.addActionListener(alShape);
    96                 beaconButton.addActionListener(alShape);
    97                 towerButton.addActionListener(alShape);
    9833        }
    99 
    100         private JRadioButton getNothButton() {
    101                 if (northButton == null) {
    102                         northButton = new JRadioButton(new ImageIcon(getClass()
    103                                         .getResource("/images/CardNButton.png")));
    104                         northButton.setBounds(new Rectangle(0, 0, 55, 32));
    105                         northButton.setToolTipText(Messages.getString("NorthTip"));
    106                 }
    107                 return northButton;
    108         }
    109 
    110         private JRadioButton getSouthButton() {
    111                 if (southButton == null) {
    112                         southButton = new JRadioButton(new ImageIcon(getClass()
    113                                         .getResource("/images/CardSButton.png")));
    114                         southButton.setBounds(new Rectangle(0, 32, 55, 32));
    115                         southButton.setToolTipText(Messages.getString("SouthTip"));
    116                 }
    117                 return southButton;
    118         }
    119 
    120         private JRadioButton getEastButton() {
    121                 if (eastButton == null) {
    122                         eastButton = new JRadioButton(new ImageIcon(getClass().getResource(
    123                                         "/images/CardEButton.png")));
    124                         eastButton.setBounds(new Rectangle(0, 64, 55, 32));
    125                         eastButton.setToolTipText(Messages.getString("EastTip"));
    126                 }
    127                 return eastButton;
    128         }
    129 
    130         private JRadioButton getWestButton() {
    131                 if (westButton == null) {
    132                         westButton = new JRadioButton(new ImageIcon(getClass().getResource(
    133                                         "/images/CardWButton.png")));
    134                         westButton.setBounds(new Rectangle(0, 96, 55, 32));
    135                         westButton.setToolTipText(Messages.getString("WestTip"));
    136                 }
    137                 return westButton;
    138         }
    139 
    140         private JRadioButton getIsolButton() {
    141                 if (isolButton == null) {
    142                         isolButton = new JRadioButton(new ImageIcon(getClass().getResource(
    143                                         "/images/IsolButton.png")));
    144                         isolButton.setBounds(new Rectangle(0, 128, 55, 32));
    145                         isolButton.setToolTipText(Messages.getString("IsolTip"));
    146                 }
    147                 return isolButton;
    148         }
    149 
    150         private JRadioButton getPillarButton() {
    151                 if (pillarButton == null) {
    152                         pillarButton = new JRadioButton(new ImageIcon(getClass()
    153                                         .getResource("/images/PillarButton.png")));
    154                         pillarButton.setBounds(new Rectangle(55, 0, 90, 32));
    155                         pillarButton.setToolTipText(Messages.getString("PillarTip"));
    156                 }
    157                 return pillarButton;
    158         }
    159 
    160         private JRadioButton getSparButton() {
    161                 if (sparButton == null) {
    162                         sparButton = new JRadioButton(new ImageIcon(getClass().getResource(
    163                                         "/images/SparButton.png")));
    164                         sparButton.setBounds(new Rectangle(55, 32, 90, 32));
    165                         sparButton.setToolTipText(Messages.getString("SparTip"));
    166                 }
    167                 return sparButton;
    168         }
    169 
    170         private JRadioButton getFloatButton() {
    171                 if (floatButton == null) {
    172                         floatButton = new JRadioButton(new ImageIcon(getClass()
    173                                         .getResource("/images/FloatButton.png")));
    174                         floatButton.setBounds(new Rectangle(55, 64, 90, 32));
    175                         floatButton.setToolTipText(Messages.getString("FloatTip"));
    176                 }
    177                 return floatButton;
    178         }
    179 
    180         private JRadioButton getBeaconButton() {
    181                 if (beaconButton == null) {
    182                         beaconButton = new JRadioButton(new ImageIcon(getClass()
    183                                         .getResource("/images/BeaconButton.png")));
    184                         beaconButton.setBounds(new Rectangle(55, 96, 90, 32));
    185                         beaconButton.setToolTipText(Messages.getString("BeaconTip"));
    186                 }
    187                 return beaconButton;
    188         }
    189 
    190         private JRadioButton getTowerButton() {
    191                 if (towerButton == null) {
    192                         towerButton = new JRadioButton(new ImageIcon(getClass()
    193                                         .getResource("/images/TowerButton.png")));
    194                         towerButton.setBounds(new Rectangle(55, 128, 90, 32));
    195                         towerButton.setToolTipText(Messages.getString("TowerTip"));
    196                 }
    197                 return towerButton;
    198         }
    199 
    20034}
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelTop.java

    r24710 r24720  
    11package oseam.panels;
    22
    3 import javax.swing.BorderFactory;
    43import javax.swing.JPanel;
    54
     
    1615import javax.swing.JCheckBox;
    1716import javax.swing.JRadioButton;
     17import javax.swing.JButton;
    1818
    1919import oseam.Messages;
     
    2222import java.awt.event.ActionListener;
    2323
    24 public class PanelHaz extends JPanel {
     24public class PanelTop extends JPanel {
    2525
    26         private ButtonGroup catButtons = null;
    27         private JRadioButton northButton = null;
    28         private JRadioButton southButton = null;
    29         private JRadioButton eastButton = null;
    30         private JRadioButton westButton = null;
    31         private JRadioButton isolButton = null;
     26        private ButtonGroup topButtons = null;
     27        private JRadioButton noTopButton = null;
    3228
    33         private ButtonGroup shapeButtons = null;
    34         private JRadioButton pillarButton = null;
    35         private JRadioButton sparButton = null;
    36         private JRadioButton floatButton = null;
    37         private JRadioButton beaconButton = null;
    38         private JRadioButton towerButton = null;
    39 
    40         public PanelHaz() {
     29        public PanelTop() {
    4130                super();
    4231                initialize();
     
    4534        private void initialize() {
    4635                this.setLayout(null);
    47                 this.add(getNothButton(), null);
    48                 this.add(getSouthButton(), null);
    49                 this.add(getEastButton(), null);
    50                 this.add(getWestButton(), null);
    51                 this.add(getIsolButton(), null);
    52                 catButtons = new ButtonGroup();
    53                 catButtons.add(northButton);
    54                 catButtons.add(southButton);
    55                 catButtons.add(eastButton);
    56                 catButtons.add(westButton);
    57                 catButtons.add(isolButton);
    58                 ActionListener alCat = new ActionListener() {
    59                         public void actionPerformed(java.awt.event.ActionEvent e) {
    60                                 northButton.setEnabled(!northButton.isSelected());
    61                                 southButton.setEnabled(!southButton.isSelected());
    62                                 eastButton.setEnabled(!eastButton.isSelected());
    63                                 westButton.setEnabled(!westButton.isSelected());
    64                                 isolButton.setEnabled(!isolButton.isSelected());
    65                         }
    66                 };
    67                 northButton.addActionListener(alCat);
    68                 southButton.addActionListener(alCat);
    69                 eastButton.addActionListener(alCat);
    70                 westButton.addActionListener(alCat);
    71                 isolButton.addActionListener(alCat);
    72 
    73                 this.add(getPillarButton(), null);
    74                 this.add(getSparButton(), null);
    75                 this.add(getFloatButton(), null);
    76                 this.add(getBeaconButton(), null);
    77                 this.add(getTowerButton(), null);
    78                 shapeButtons = new ButtonGroup();
    79                 shapeButtons.add(pillarButton);
    80                 shapeButtons.add(sparButton);
    81                 shapeButtons.add(floatButton);
    82                 shapeButtons.add(beaconButton);
    83                 shapeButtons.add(towerButton);
    84                 ActionListener alShape = new ActionListener() {
    85                         public void actionPerformed(java.awt.event.ActionEvent e) {
    86                                 pillarButton.setEnabled(!pillarButton.isSelected());
    87                                 sparButton.setEnabled(!sparButton.isSelected());
    88                                 floatButton.setEnabled(!floatButton.isSelected());
    89                                 beaconButton.setEnabled(!beaconButton.isSelected());
    90                                 towerButton.setEnabled(!towerButton.isSelected());
    91                         }
    92                 };
    93                 pillarButton.addActionListener(alShape);
    94                 sparButton.addActionListener(alShape);
    95                 floatButton.addActionListener(alShape);
    96                 beaconButton.addActionListener(alShape);
    97                 towerButton.addActionListener(alShape);
     36                this.add(getNoTopButton(), null);
     37                topButtons = new ButtonGroup();
     38                topButtons.add(noTopButton);
    9839        }
    9940
    100         private JRadioButton getNothButton() {
    101                 if (northButton == null) {
    102                         northButton = new JRadioButton(new ImageIcon(getClass()
    103                                         .getResource("/images/CardNButton.png")));
    104                         northButton.setBounds(new Rectangle(0, 0, 55, 32));
    105                         northButton.setToolTipText(Messages.getString("NorthTip"));
     41        private JRadioButton getNoTopButton() {
     42                if (noTopButton == null) {
     43                        noTopButton = new JRadioButton(new ImageIcon(getClass()
     44                                        .getResource("/images/NoTopButton.png")));
     45                        noTopButton.setBounds(new Rectangle(5, 5, 30, 30));
     46                        noTopButton.setToolTipText(Messages.getString("NorthTip"));
    10647                }
    107                 return northButton;
    108         }
    109 
    110         private JRadioButton getSouthButton() {
    111                 if (southButton == null) {
    112                         southButton = new JRadioButton(new ImageIcon(getClass()
    113                                         .getResource("/images/CardSButton.png")));
    114                         southButton.setBounds(new Rectangle(0, 32, 55, 32));
    115                         southButton.setToolTipText(Messages.getString("SouthTip"));
    116                 }
    117                 return southButton;
    118         }
    119 
    120         private JRadioButton getEastButton() {
    121                 if (eastButton == null) {
    122                         eastButton = new JRadioButton(new ImageIcon(getClass().getResource(
    123                                         "/images/CardEButton.png")));
    124                         eastButton.setBounds(new Rectangle(0, 64, 55, 32));
    125                         eastButton.setToolTipText(Messages.getString("EastTip"));
    126                 }
    127                 return eastButton;
    128         }
    129 
    130         private JRadioButton getWestButton() {
    131                 if (westButton == null) {
    132                         westButton = new JRadioButton(new ImageIcon(getClass().getResource(
    133                                         "/images/CardWButton.png")));
    134                         westButton.setBounds(new Rectangle(0, 96, 55, 32));
    135                         westButton.setToolTipText(Messages.getString("WestTip"));
    136                 }
    137                 return westButton;
    138         }
    139 
    140         private JRadioButton getIsolButton() {
    141                 if (isolButton == null) {
    142                         isolButton = new JRadioButton(new ImageIcon(getClass().getResource(
    143                                         "/images/IsolButton.png")));
    144                         isolButton.setBounds(new Rectangle(0, 128, 55, 32));
    145                         isolButton.setToolTipText(Messages.getString("IsolTip"));
    146                 }
    147                 return isolButton;
    148         }
    149 
    150         private JRadioButton getPillarButton() {
    151                 if (pillarButton == null) {
    152                         pillarButton = new JRadioButton(new ImageIcon(getClass()
    153                                         .getResource("/images/PillarButton.png")));
    154                         pillarButton.setBounds(new Rectangle(55, 0, 90, 32));
    155                         pillarButton.setToolTipText(Messages.getString("PillarTip"));
    156                 }
    157                 return pillarButton;
    158         }
    159 
    160         private JRadioButton getSparButton() {
    161                 if (sparButton == null) {
    162                         sparButton = new JRadioButton(new ImageIcon(getClass().getResource(
    163                                         "/images/SparButton.png")));
    164                         sparButton.setBounds(new Rectangle(55, 32, 90, 32));
    165                         sparButton.setToolTipText(Messages.getString("SparTip"));
    166                 }
    167                 return sparButton;
    168         }
    169 
    170         private JRadioButton getFloatButton() {
    171                 if (floatButton == null) {
    172                         floatButton = new JRadioButton(new ImageIcon(getClass()
    173                                         .getResource("/images/FloatButton.png")));
    174                         floatButton.setBounds(new Rectangle(55, 64, 90, 32));
    175                         floatButton.setToolTipText(Messages.getString("FloatTip"));
    176                 }
    177                 return floatButton;
    178         }
    179 
    180         private JRadioButton getBeaconButton() {
    181                 if (beaconButton == null) {
    182                         beaconButton = new JRadioButton(new ImageIcon(getClass()
    183                                         .getResource("/images/BeaconButton.png")));
    184                         beaconButton.setBounds(new Rectangle(55, 96, 90, 32));
    185                         beaconButton.setToolTipText(Messages.getString("BeaconTip"));
    186                 }
    187                 return beaconButton;
    188         }
    189 
    190         private JRadioButton getTowerButton() {
    191                 if (towerButton == null) {
    192                         towerButton = new JRadioButton(new ImageIcon(getClass()
    193                                         .getResource("/images/TowerButton.png")));
    194                         towerButton.setBounds(new Rectangle(55, 128, 90, 32));
    195                         towerButton.setToolTipText(Messages.getString("TowerTip"));
    196                 }
    197                 return towerButton;
     48                return noTopButton;
    19849        }
    19950
Note: See TracChangeset for help on using the changeset viewer.