Ignore:
Timestamp:
2013-08-30T05:02:19+02:00 (12 years ago)
Author:
malcolmh
Message:

save

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed2/src/panels/PanelMain.java

    r29215 r29881  
    1616public class PanelMain extends JPanel {
    1717
    18         private JTabbedPane tabs = null;
    19 //      public PanelF panelF = null;
    2018        public static JTextField messageBar = null;
    2119        public JButton saveButton = null;
    2220        private ActionListener alSave = new ActionListener() {
    2321                public void actionPerformed(java.awt.event.ActionEvent e) {
    24 //                      item.saveSign(???);
    2522                }
    2623        };
     
    5754        };
    5855
     56        public ButtonGroup sectionButtons = null;
     57        public JRadioButton eButton = new JRadioButton();
     58        public JRadioButton fButton = new JRadioButton();
     59        public JRadioButton jButton = new JRadioButton();
     60        public JRadioButton kButton = new JRadioButton();
     61        public JRadioButton lButton = new JRadioButton();
     62        public JRadioButton mButton = new JRadioButton();
     63        public JRadioButton nButton = new JRadioButton();
     64        public JRadioButton pButton = new JRadioButton();
     65        public JRadioButton qButton = new JRadioButton();
     66        public JRadioButton rButton = new JRadioButton();
     67        public JRadioButton sButton = new JRadioButton();
     68        public JRadioButton tButton = new JRadioButton();
     69        public JRadioButton uButton = new JRadioButton();
     70        private ActionListener alSection = new ActionListener() {
     71                public void actionPerformed(java.awt.event.ActionEvent e) {
     72                        if (eButton.isSelected()) {
     73                                eButton.setBorderPainted(true);
     74                        } else {
     75                                eButton.setBorderPainted(false);
     76                        }
     77                        if (fButton.isSelected()) {
     78                                fButton.setBorderPainted(true);
     79                        } else {
     80                                fButton.setBorderPainted(false);
     81                        }
     82                        if (jButton.isSelected()) {
     83                                jButton.setBorderPainted(true);
     84                        } else {
     85                                jButton.setBorderPainted(false);
     86                        }
     87                        if (kButton.isSelected()) {
     88                                kButton.setBorderPainted(true);
     89                        } else {
     90                                kButton.setBorderPainted(false);
     91                        }
     92                }
     93        };
     94
    5995        public PanelMain() {
    6096
    6197                setLayout(null);
    6298                setSize(new Dimension(480, 480));
    63                 tabs = new JTabbedPane(JTabbedPane.TOP);
    64                 tabs.setBounds(new Rectangle(0, 0, 480, 420));
    65 
    66 //              JPanel panelF = new PanelF();
    67 //              tabs.addTab(null, new ImageIcon(getClass().getResource("/images/tabF.png")), panelF, Messages.getString("Ports"));
    68 
    69                 add(tabs);
    7099               
    71100    messageBar = new JTextField();
     
    88117                saveButton.addActionListener(alSave);
    89118
     119                add(getButton(eButton, 0, 0, 200, 20, "E Landmarks"), null);
     120                add(getButton(fButton, 0, 20, 200, 20, "F Ports"), null);
     121                add(getButton(jButton, 0, 40, 200, 20, "J Seabed"), null);
     122                add(getButton(kButton, 0, 60, 200, 20, "K Obstructions"), null);
     123                add(getButton(lButton, 0, 80, 200, 20, "L Obstructions"), null);
     124                add(getButton(mButton, 0, 100, 200, 20, "M Offshore Installations"), null);
     125                add(getButton(nButton, 0, 120, 200, 20, "N Areas & Limits"), null);
     126                add(getButton(pButton, 0, 140, 200, 20, "P Lights"), null);
     127                add(getButton(qButton, 0, 160, 200, 20, "Q Buoys & Beacons"), null);
     128                add(getButton(rButton, 0, 180, 200, 20, "R Fog Sigals"), null);
     129                add(getButton(sButton, 0, 200, 200, 20, "S Radio & Radar"), null);
     130                add(getButton(tButton, 0, 220, 200, 20, "T Services"), null);
     131                add(getButton(uButton, 0, 240, 200, 20, "U Small Craft Facilities"), null);
     132                sectionButtons = new ButtonGroup();
     133                sectionButtons.add(eButton);
     134                sectionButtons.add(fButton);
     135                sectionButtons.add(jButton);
     136                sectionButtons.add(kButton);
     137                sectionButtons.add(lButton);
     138                sectionButtons.add(mButton);
     139                sectionButtons.add(nButton);
     140                sectionButtons.add(pButton);
     141                sectionButtons.add(qButton);
     142                sectionButtons.add(rButton);
     143                sectionButtons.add(sButton);
     144                sectionButtons.add(tButton);
     145                sectionButtons.add(uButton);
     146                eButton.addActionListener(alSection);
     147                fButton.addActionListener(alSection);
     148                jButton.addActionListener(alSection);
     149                kButton.addActionListener(alSection);
     150                lButton.addActionListener(alSection);
     151                mButton.addActionListener(alSection);
     152                nButton.addActionListener(alSection);
     153                pButton.addActionListener(alSection);
     154                qButton.addActionListener(alSection);
     155                rButton.addActionListener(alSection);
     156                sButton.addActionListener(alSection);
     157                tButton.addActionListener(alSection);
     158                uButton.addActionListener(alSection);
    90159        }
     160       
     161        private JRadioButton getButton(JRadioButton button, int x, int y, int w, int h, String title) {
     162                button.setBounds(new Rectangle(x, y, w, h));
     163                button.setBorder(BorderFactory.createLoweredBevelBorder());
     164                button.setText(title);
     165                return button;
     166        }
     167
    91168}
Note: See TracChangeset for help on using the changeset viewer.