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

save

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.