Ignore:
Timestamp:
2010-12-08T20:06:07+01:00 (14 years ago)
Author:
malcolmh
Message:

new buttons

File:
1 edited

Legend:

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

    r24602 r24658  
    3030        private JRadioButton barrelButton = null;
    3131        private JRadioButton floatButton = null;
    32        
     32
    3333        public PanelSafeWater() {
    3434                super();
     
    3737
    3838        private void initialize() {
    39          this.setLayout(null);
    40          this.add(getPillarButton(), null);
    41          this.add(getSparButton(), null);
    42          this.add(getSphereButton(), null);
    43          this.add(getBarrelButton(), null);
    44          this.add(getFloatButton(), null);
    45          
    46          shapeButtons = new ButtonGroup();
    47          shapeButtons.add(pillarButton);
    48          shapeButtons.add(sparButton);
    49          shapeButtons.add(sphereButton);
    50          shapeButtons.add(barrelButton);
    51          shapeButtons.add(floatButton);
    52                         ActionListener alShape = new ActionListener() {
    53                                 public void actionPerformed(java.awt.event.ActionEvent e) {
    54                                         pillarButton.setEnabled(!pillarButton.isSelected());
    55                                         sparButton.setEnabled(!sparButton.isSelected());
    56                                         sphereButton.setEnabled(!sphereButton.isSelected());
    57                                         barrelButton.setEnabled(!barrelButton.isSelected());
    58                                         floatButton.setEnabled(!floatButton.isSelected());
    59                                 }
    60                         };
    61                         pillarButton.addActionListener(alShape);
    62                         sparButton.addActionListener(alShape);
    63                         sphereButton.addActionListener(alShape);
    64                         barrelButton.addActionListener(alShape);
    65                         floatButton.addActionListener(alShape);
     39                this.setLayout(null);
     40                this.add(getPillarButton(), null);
     41                this.add(getSparButton(), null);
     42                this.add(getSphereButton(), null);
     43                this.add(getBarrelButton(), null);
     44                this.add(getFloatButton(), null);
     45
     46                shapeButtons = new ButtonGroup();
     47                shapeButtons.add(pillarButton);
     48                shapeButtons.add(sparButton);
     49                shapeButtons.add(sphereButton);
     50                shapeButtons.add(barrelButton);
     51                shapeButtons.add(floatButton);
     52                ActionListener alShape = new ActionListener() {
     53                        public void actionPerformed(java.awt.event.ActionEvent e) {
     54                                pillarButton.setEnabled(!pillarButton.isSelected());
     55                                sparButton.setEnabled(!sparButton.isSelected());
     56                                sphereButton.setEnabled(!sphereButton.isSelected());
     57                                barrelButton.setEnabled(!barrelButton.isSelected());
     58                                floatButton.setEnabled(!floatButton.isSelected());
     59                        }
     60                };
     61                pillarButton.addActionListener(alShape);
     62                sparButton.addActionListener(alShape);
     63                sphereButton.addActionListener(alShape);
     64                barrelButton.addActionListener(alShape);
     65                floatButton.addActionListener(alShape);
    6666        }
    6767
    6868        private JRadioButton getPillarButton() {
    6969                if (pillarButton == null) {
    70                         pillarButton = new JRadioButton(new ImageIcon(getClass().getResource(
    71                                         Messages.getString("PillarButton"))));
    72                         pillarButton.setBounds(new Rectangle(0, 0, 90, 32));
     70                        pillarButton = new JRadioButton(new ImageIcon(getClass()
     71                                        .getResource("/images/PillarButton.png")));
     72                        pillarButton.setBounds(new Rectangle(0, 0, 35, 32));
    7373                }
    7474                return pillarButton;
     
    7878                if (sparButton == null) {
    7979                        sparButton = new JRadioButton(new ImageIcon(getClass().getResource(
    80                                         Messages.getString("SparButton"))));
    81                         sparButton.setBounds(new Rectangle(0, 32, 90, 32));
     80                                        "/images/SparButton.png")));
     81                        sparButton.setBounds(new Rectangle(0, 32, 35, 32));
    8282                }
    8383                return sparButton;
     
    8686        private JRadioButton getSphereButton() {
    8787                if (sphereButton == null) {
    88                         sphereButton = new JRadioButton(new ImageIcon(getClass().getResource(
    89                                         Messages.getString("SphereButton"))));
    90                         sphereButton.setBounds(new Rectangle(0, 64, 90, 32));
     88                        sphereButton = new JRadioButton(new ImageIcon(getClass()
     89                                        .getResource("/images/SphereButton.png")));
     90                        sphereButton.setBounds(new Rectangle(0, 64, 35, 32));
    9191                }
    9292                return sphereButton;
     
    9595        private JRadioButton getBarrelButton() {
    9696                if (barrelButton == null) {
    97                         barrelButton = new JRadioButton(new ImageIcon(getClass().getResource(
    98                                         Messages.getString("BarrelButton"))));
    99                         barrelButton.setBounds(new Rectangle(0, 96, 90, 32));
     97                        barrelButton = new JRadioButton(new ImageIcon(getClass()
     98                                        .getResource("/images/BarrelButton.png")));
     99                        barrelButton.setBounds(new Rectangle(0, 96, 35, 32));
    100100                }
    101101                return barrelButton;
     
    104104        private JRadioButton getFloatButton() {
    105105                if (floatButton == null) {
    106                         floatButton = new JRadioButton(new ImageIcon(getClass().getResource(
    107                                         Messages.getString("FloatButton"))));
    108                         floatButton.setBounds(new Rectangle(0, 128, 90, 32));
     106                        floatButton = new JRadioButton(new ImageIcon(getClass()
     107                                        .getResource("/images/FloatButton.png")));
     108                        floatButton.setBounds(new Rectangle(0, 128, 35, 32));
    109109                }
    110110                return floatButton;
Note: See TracChangeset for help on using the changeset viewer.