Ignore:
Timestamp:
2010-12-06T16:13:22+01:00 (14 years ago)
Author:
malcolmh
Message:

misc buttons

Location:
applications/editors/josm/plugins/smed/plugs/oseam/src
Files:
8 added
1 edited

Legend:

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

    r24613 r24616  
    6363        private JRadioButton hazButton = null;
    6464        private JRadioButton specButton = null;
    65         private JRadioButton lightButton = null;
     65        private JRadioButton lightsButton = null;
     66        private ButtonGroup miscButtons = null;
     67        private JRadioButton topButton = null;
     68        private JRadioButton fogButton = null;
     69        private JRadioButton radarButton = null;
     70        private JRadioButton litButton = null;
    6671        private PanelChan panelChan = null;
    6772        private PanelHaz panelHaz = null;
     
    121126                        oseamPanel.add(getHazButton(), null);
    122127                        oseamPanel.add(getSpecButton(), null);
    123                         oseamPanel.add(getLightButton(), null);
     128                        oseamPanel.add(getLightsButton(), null);
    124129                        oseamPanel.add(panelChan, null);
    125130                        oseamPanel.add(panelHaz, null);
     
    129134                        typeButtons.add(hazButton);
    130135                        typeButtons.add(specButton);
    131                         typeButtons.add(lightButton);
     136                        typeButtons.add(lightsButton);
    132137                        ActionListener alType = new ActionListener() {
    133138                                public void actionPerformed(java.awt.event.ActionEvent e) {
     
    153158                                                panelSpec.setVisible(false);
    154159                                        }
    155                                         lightButton.setEnabled(!lightButton.isSelected());
    156 //System.out.println("pressed: " + chanButton.isSelected() + " " + hazButton.isSelected() + " " + specButton.isSelected() + " " + lightButton.isSelected());
     160                                        lightsButton.setEnabled(!lightsButton.isSelected());
    157161                                }
    158162                        };
     
    160164                        hazButton.addActionListener(alType);
    161165                        specButton.addActionListener(alType);
    162                         lightButton.addActionListener(alType);
     166                        lightsButton.addActionListener(alType);
     167                       
     168                        oseamPanel.add(getTopButton(), null);
     169                        oseamPanel.add(getFogButton(), null);
     170                        oseamPanel.add(getRadarButton(), null);
     171                        oseamPanel.add(getLitButton(), null);
     172                        miscButtons = new ButtonGroup();
     173                        miscButtons.add(topButton);
     174                        miscButtons.add(fogButton);
     175                        miscButtons.add(radarButton);
     176                        miscButtons.add(litButton);
     177                        ActionListener alMisc = new ActionListener() {
     178                                public void actionPerformed(java.awt.event.ActionEvent e) {
     179                                        topButton.setEnabled(!topButton.isSelected());
     180                                        fogButton.setEnabled(!fogButton.isSelected());
     181                                        radarButton.setEnabled(!radarButton.isSelected());
     182                                        litButton.setEnabled(!litButton.isSelected());
     183                                }
     184                        };
     185                        topButton.addActionListener(alMisc);
     186                        fogButton.addActionListener(alMisc);
     187                        radarButton.addActionListener(alMisc);
     188                        litButton.addActionListener(alMisc);
    163189                       
    164190                        nameLabel = new JLabel();
     
    207233        }
    208234
    209         private JRadioButton getLightButton() {
    210                 if (lightButton == null) {
    211                         lightButton = new JRadioButton(new ImageIcon(getClass().getResource(
     235        private JRadioButton getLightsButton() {
     236                if (lightsButton == null) {
     237                        lightsButton = new JRadioButton(new ImageIcon(getClass().getResource(
    212238                                        Messages.getString("LightsButton"))));
    213                         lightButton.setBounds(new Rectangle(0, 120, 105, 40));
    214                         lightButton.setToolTipText(Messages.getString("LightsTip"));
    215                 }
    216                 return lightButton;
     239                        lightsButton.setBounds(new Rectangle(0, 120, 105, 40));
     240                        lightsButton.setToolTipText(Messages.getString("LightsTip"));
     241                }
     242                return lightsButton;
     243        }
     244
     245        private JRadioButton getTopButton() {
     246                if (topButton == null) {
     247                        topButton = new JRadioButton(new ImageIcon(getClass().getResource(
     248                                        "/images/TopButton.png")));
     249                        topButton.setBounds(new Rectangle(0, 165, 40, 40));
     250                        topButton.setToolTipText(tr("Topmarks"));
     251                }
     252                return topButton;
     253        }
     254
     255        private JRadioButton getFogButton() {
     256                if (fogButton == null) {
     257                        fogButton = new JRadioButton(new ImageIcon(getClass().getResource(
     258                                        "/images/FogButton.png")));
     259                        fogButton.setBounds(new Rectangle(0, 200, 40, 40));
     260                        fogButton.setToolTipText(tr("Fog signals"));
     261                }
     262                return fogButton;
     263        }
     264
     265        private JRadioButton getRadarButton() {
     266                if (radarButton == null) {
     267                        radarButton = new JRadioButton(new ImageIcon(getClass().getResource(
     268                                        "/images/RadarButton.png")));
     269                        radarButton.setBounds(new Rectangle(0, 235, 40, 40));
     270                        radarButton.setToolTipText(tr("Radar"));
     271                }
     272                return radarButton;
     273        }
     274
     275        private JRadioButton getLitButton() {
     276                if (litButton == null) {
     277                        litButton = new JRadioButton(new ImageIcon(getClass().getResource(
     278                                        "/images/LitButton.png")));
     279                        litButton.setBounds(new Rectangle(0, 270, 40, 40));
     280                        litButton.setToolTipText(tr("Lights"));
     281                }
     282                return litButton;
    217283        }
    218284
Note: See TracChangeset for help on using the changeset viewer.