Changeset 24600 in osm for applications/editors


Ignore:
Timestamp:
2010-12-05T20:53:39+01:00 (14 years ago)
Author:
malcolmh
Message:

port panel

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

Legend:

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

    r24594 r24600  
    5050        private JPanel oseamPanel = null;
    5151
     52        private JLabel shapeIcon = null;
     53        private JLabel lightIcon = null;
     54        private JLabel topIcon = null;
     55        private JLabel reflIcon = null;
     56        private JLabel raconIcon = null;
     57        private JLabel fogIcon = null;
    5258        private ButtonGroup typeButtons = null;
    5359        private JRadioButton chanButton = null;
     
    7177
    7278                panelChan= new PanelChan();
    73                 panelChan.setBounds(new Rectangle(110, 0, 290, 160));
     79                panelChan.setBounds(new Rectangle(105, 0, 295, 160));
    7480                panelChan.setVisible(false);
    7581        }
     
    8086                        oseamPanel.setLayout(null);
    8187                        oseamPanel.setSize(new Dimension(400, 360));
     88
     89                        shapeIcon = new JLabel();
     90                        shapeIcon.setBounds(new Rectangle(270, 160, 125, 155));
     91                shapeIcon.setBorder(BorderFactory.createLineBorder(Color.black, 1));
     92                        oseamPanel.add(shapeIcon, null);
     93                        lightIcon = new JLabel();
     94                        lightIcon.setBounds(new Rectangle(270, 160, 125, 155));
     95                        oseamPanel.add(lightIcon, null);
     96                        topIcon = new JLabel();
     97                        topIcon.setBounds(new Rectangle(270, 160, 125, 155));
     98                        oseamPanel.add(topIcon, null);
     99                        reflIcon = new JLabel();
     100                        reflIcon.setBounds(new Rectangle(270, 160, 125, 155));
     101                        oseamPanel.add(reflIcon, null);
     102                        raconIcon = new JLabel();
     103                        raconIcon.setBounds(new Rectangle(270, 160, 125, 155));
     104                        oseamPanel.add(raconIcon, null);
     105                        fogIcon = new JLabel();
     106                        fogIcon.setBounds(new Rectangle(270, 160, 125, 155));
     107                        oseamPanel.add(fogIcon, null);
    82108
    83109                        oseamPanel.add(getChanButton(), null);
     
    118144                        chanButton = new JRadioButton(new ImageIcon(getClass().getResource(
    119145                                        Messages.getString("ChanButton"))));
    120                         chanButton.setBounds(new Rectangle(5, 0, 105, 40));
     146                        chanButton.setBounds(new Rectangle(0, 0, 105, 40));
    121147                        chanButton.setToolTipText(Messages.getString("ChanTip"));
    122148                }
     
    128154                        hazButton = new JRadioButton(new ImageIcon(getClass().getResource(
    129155                                        Messages.getString("HazButton"))));
    130                         hazButton.setBounds(new Rectangle(5, 40, 105, 40));
     156                        hazButton.setBounds(new Rectangle(0, 40, 105, 40));
    131157                        hazButton.setToolTipText(Messages.getString("HazTip"));
    132158                }
     
    138164                        specButton = new JRadioButton(new ImageIcon(getClass().getResource(
    139165                                        Messages.getString("SpecButton"))));
    140                         specButton.setBounds(new Rectangle(5, 80, 105, 40));
     166                        specButton.setBounds(new Rectangle(0, 80, 105, 40));
    141167                        specButton.setToolTipText(Messages.getString("SpecTip"));
    142168                }
     
    148174                        lightButton = new JRadioButton(new ImageIcon(getClass().getResource(
    149175                                        Messages.getString("LightsButton"))));
    150                         lightButton.setBounds(new Rectangle(5, 120, 105, 40));
     176                        lightButton.setBounds(new Rectangle(0, 120, 105, 40));
    151177                        lightButton.setToolTipText(Messages.getString("LightsTip"));
    152178                }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/msg/messages.properties

    r24594 r24600  
    1919SafeWaterButton=/images/SafeWaterButton.png
    2020SafeWaterTip=Safe Water marks
     21PillarButton=/images/PillarButton.png
     22SparButton=/images/SparButton.png
     23CanButton=/images/CanButton.png
     24ConeButton=/images/ConeButton.png
     25SphereButton=/images/SphereButton.png
     26BarrelButton=/images/BarrelButton.png
     27FloatButton=/images/FloatButton.png
     28SuperButton=/images/SuperButton.png
     29BeaconButton=/images/BeaconButton.png
     30TowerButton=/images/TowerButton.png
     31PerchPButton=/images/PerchPButton.png
     32PerchSButton=/images/PerchSButton.png
     33StakeButton=/images/StakeButton.png
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/msg/messages_de.properties

    r24594 r24600  
    1919SafeWaterButton=/images/SafeWaterButton_de.png
    2020SafeWaterTip=Safe Water marks
     21PillarButton=/images/PillarButton_de.png
     22SparButton=/images/SparButton_de.png
     23CanButton=/images/CanButton_de.png
     24ConeButton=/images/ConeButton_de.png
     25SphereButton=/images/SphereButton_de.png
     26BarrelButton=/images/BarrelButton_de.png
     27FloatButton=/images/FloatButton_de.png
     28SuperButton=/images/SuperButton_de.png
     29BeaconButton=/images/BeaconButton_de.png
     30TowerButton=/images/TowerButton_de.png
     31PerchPButton=/images/PerchPButton_de.png
     32PerchSButton=/images/PerchSButton_de.png
     33StakeButton=/images/StakeButton_de.png
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/msg/messages_en.properties

    r24594 r24600  
    1919SafeWaterButton=/images/SafeWaterButton.png
    2020SafeWaterTip=Safe Water marks
     21PillarButton=/images/PillarButton.png
     22SparButton=/images/SparButton.png
     23CanButton=/images/CanButton.png
     24ConeButton=/images/ConeButton.png
     25SphereButton=/images/SphereButton.png
     26BarrelButton=/images/BarrelButton.png
     27FloatButton=/images/FloatButton.png
     28SuperButton=/images/SuperButton.png
     29BeaconButton=/images/BeaconButton.png
     30TowerButton=/images/TowerButton.png
     31PerchPButton=/images/PerchPButton.png
     32PerchSButton=/images/PerchSButton.png
     33StakeButton=/images/StakeButton.png
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelChan.java

    r24597 r24600  
    3030        private JRadioButton prefStbdButton = null;
    3131        private JRadioButton safeWaterButton = null;
     32        private PanelPort panelPort = null;
     33       
    3234        public PanelChan() {
    3335                super();
     36                panelPort= new PanelPort();
     37                panelPort.setBounds(new Rectangle(105, 0, 185, 160));
     38                panelPort.setVisible(false);
    3439                initialize();
    3540        }
     
    3742        private void initialize() {
    3843         this.setLayout(null);
     44         this.add(panelPort, null);
    3945         this.add(getPortButton(), null);
    4046         this.add(getStbdButton(), null);
     
    5258                                        if (portButton.isSelected()) {
    5359                                                portButton.setEnabled(false);
    54 //                                              panelPort.setVisible(true);
     60                                                panelPort.setVisible(true);
    5561                                        } else {
    5662                                                portButton.setEnabled(true);
    57 //                                              panelPort.setVisible(false);
     63                                                panelPort.setVisible(false);
    5864                                        }
    5965                                        stbdButton.setEnabled(!stbdButton.isSelected());
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPort.java

    r24597 r24600  
    2222import java.awt.event.ActionListener;
    2323
    24 public class PanelChan extends JPanel {
     24public class PanelPort extends JPanel {
    2525
    26         private ButtonGroup catButtons = null;
    27         private JRadioButton portButton = null;
    28         private JRadioButton stbdButton = null;
    29         private JRadioButton prefPortButton = null;
    30         private JRadioButton prefStbdButton = null;
    31         private JRadioButton safeWaterButton = null;
    32         public PanelChan() {
     26        private ButtonGroup regionButtons = null;
     27        private JRadioButton regionAButton = null;
     28        private JRadioButton regionBButton = null;
     29        private ButtonGroup shapeButtons = null;
     30        private JRadioButton pillarButton = null;
     31        private JRadioButton sparButton = null;
     32        private JRadioButton canButton = null;
     33        private JRadioButton floatButton = null;
     34        private JRadioButton beaconButton = null;
     35        private JRadioButton towerButton = null;
     36        private JRadioButton perchButton = null;
     37       
     38        public PanelPort() {
    3339                super();
    3440                initialize();
     
    3743        private void initialize() {
    3844         this.setLayout(null);
    39          this.add(getPortButton(), null);
    40          this.add(getStbdButton(), null);
    41          this.add(getPrefPortButton(), null);
    42          this.add(getPrefStbdButton(), null);
    43          this.add(getSafeWaterButton(), null);
    44          catButtons = new ButtonGroup();
    45          catButtons.add(portButton);
    46          catButtons.add(stbdButton);
    47          catButtons.add(prefPortButton);
    48          catButtons.add(prefStbdButton);
    49          catButtons.add(safeWaterButton);
    50                         ActionListener alCat = new ActionListener() {
     45         this.add(getRegionAButton(), null);
     46         this.add(getRegionBButton(), null);
     47         this.add(getPillarButton(), null);
     48         this.add(getSparButton(), null);
     49         this.add(getCanButton(), null);
     50         this.add(getFloatButton(), null);
     51         this.add(getBeaconButton(), null);
     52         this.add(getTowerButton(), null);
     53         this.add(getPerchButton(), null);
     54         
     55         regionButtons = new ButtonGroup();
     56         regionButtons.add(regionAButton);
     57         regionButtons.add(regionBButton);
     58                        ActionListener alRegion = new ActionListener() {
    5159                                public void actionPerformed(java.awt.event.ActionEvent e) {
    52                                         if (portButton.isSelected()) {
    53                                                 portButton.setEnabled(false);
    54 //                                              panelPort.setVisible(true);
     60                                        if (regionAButton.isSelected()) {
     61                                                regionAButton.setEnabled(false);
    5562                                        } else {
    56                                                 portButton.setEnabled(true);
    57 //                                              panelPort.setVisible(false);
     63                                                regionAButton.setEnabled(true);
    5864                                        }
    59                                         stbdButton.setEnabled(!stbdButton.isSelected());
    60                                         prefPortButton.setEnabled(!prefPortButton.isSelected());
    61                                         prefStbdButton.setEnabled(!prefStbdButton.isSelected());
    62                                         safeWaterButton.setEnabled(!safeWaterButton.isSelected());
     65                                        if (regionBButton.isSelected()) {
     66                                                regionBButton.setEnabled(false);
     67                                        } else {
     68                                                regionBButton.setEnabled(true);
     69                                        }
    6370                                }
    6471                        };
    65                         portButton.addActionListener(alCat);
    66                         stbdButton.addActionListener(alCat);
    67                         prefPortButton.addActionListener(alCat);
    68                         prefStbdButton.addActionListener(alCat);
    69                         safeWaterButton.addActionListener(alCat);
     72                        regionAButton.addActionListener(alRegion);
     73                        regionBButton.addActionListener(alRegion);
     74         
     75         shapeButtons = new ButtonGroup();
     76         shapeButtons.add(pillarButton);
     77         shapeButtons.add(sparButton);
     78         shapeButtons.add(canButton);
     79         shapeButtons.add(floatButton);
     80         shapeButtons.add(beaconButton);
     81         shapeButtons.add(towerButton);
     82         shapeButtons.add(perchButton);
     83                        ActionListener alShape = new ActionListener() {
     84                                public void actionPerformed(java.awt.event.ActionEvent e) {
     85                                        pillarButton.setEnabled(!pillarButton.isSelected());
     86                                        sparButton.setEnabled(!sparButton.isSelected());
     87                                        canButton.setEnabled(!canButton.isSelected());
     88                                        floatButton.setEnabled(!floatButton.isSelected());
     89                                        beaconButton.setEnabled(!beaconButton.isSelected());
     90                                        towerButton.setEnabled(!towerButton.isSelected());
     91                                        perchButton.setEnabled(!perchButton.isSelected());
     92                                }
     93                        };
     94                        pillarButton.addActionListener(alShape);
     95                        sparButton.addActionListener(alShape);
     96                        canButton.addActionListener(alShape);
     97                        floatButton.addActionListener(alShape);
     98                        beaconButton.addActionListener(alShape);
     99                        towerButton.addActionListener(alShape);
     100                        perchButton.addActionListener(alShape);
    70101        }
    71102
    72         private JRadioButton getPortButton() {
    73                 if (portButton == null) {
    74                         portButton = new JRadioButton(new ImageIcon(getClass().getResource(
    75                                         Messages.getString("PortButton"))));
    76                         portButton.setBounds(new Rectangle(0, 0, 105, 32));
    77                         portButton.setToolTipText(Messages.getString("PortTip"));
     103        private JRadioButton getRegionAButton() {
     104                if (regionAButton == null) {
     105                        regionAButton = new JRadioButton(new ImageIcon(getClass().getResource(
     106                                        "/images/RegionAButton.png")));
     107                        regionAButton.setBounds(new Rectangle(10, 0, 65, 30));
    78108                }
    79                 return portButton;
     109                return regionAButton;
    80110        }
    81111
    82         private JRadioButton getStbdButton() {
    83                 if (stbdButton == null) {
    84                         stbdButton = new JRadioButton(new ImageIcon(getClass().getResource(
    85                                         Messages.getString("StbdButton"))));
    86                         stbdButton.setBounds(new Rectangle(0, 32, 105, 32));
    87                         stbdButton.setToolTipText(Messages.getString("StbdTip"));
     112        private JRadioButton getRegionBButton() {
     113                if (regionBButton == null) {
     114                        regionBButton = new JRadioButton(new ImageIcon(getClass().getResource(
     115                                        "/images/RegionBButton.png")));
     116                        regionBButton.setBounds(new Rectangle(10, 30, 65, 30));
    88117                }
    89                 return stbdButton;
     118                return regionBButton;
    90119        }
    91120
    92         private JRadioButton getPrefPortButton() {
    93                 if (prefPortButton == null) {
    94                         prefPortButton = new JRadioButton(new ImageIcon(getClass().getResource(
    95                                         Messages.getString("PrefPortButton"))));
    96                         prefPortButton.setBounds(new Rectangle(0, 64, 105, 32));
    97                         prefPortButton.setToolTipText(Messages.getString("PrefPortTip"));
     121        private JRadioButton getPillarButton() {
     122                if (pillarButton == null) {
     123                        pillarButton = new JRadioButton(new ImageIcon(getClass().getResource(
     124                                        Messages.getString("PillarButton"))));
     125                        pillarButton.setBounds(new Rectangle(0, 64, 90, 32));
    98126                }
    99                 return prefPortButton;
     127                return pillarButton;
    100128        }
    101129
    102         private JRadioButton getPrefStbdButton() {
    103                 if (prefStbdButton == null) {
    104                         prefStbdButton = new JRadioButton(new ImageIcon(getClass().getResource(
    105                                         Messages.getString("PrefStbdButton"))));
    106                         prefStbdButton.setBounds(new Rectangle(0, 96, 105, 32));
    107                         prefStbdButton.setToolTipText(Messages.getString("PrefStbdTip"));
     130        private JRadioButton getSparButton() {
     131                if (sparButton == null) {
     132                        sparButton = new JRadioButton(new ImageIcon(getClass().getResource(
     133                                        Messages.getString("SparButton"))));
     134                        sparButton.setBounds(new Rectangle(0, 96, 90, 32));
    108135                }
    109                 return prefStbdButton;
     136                return sparButton;
    110137        }
    111138
    112         private JRadioButton getSafeWaterButton() {
    113                 if (safeWaterButton == null) {
    114                         safeWaterButton = new JRadioButton(new ImageIcon(getClass().getResource(
    115                                         Messages.getString("SafeWaterButton"))));
    116                         safeWaterButton.setBounds(new Rectangle(0, 128, 105, 32));
    117                         safeWaterButton.setToolTipText(Messages.getString("SafeWaterTip"));
     139        private JRadioButton getCanButton() {
     140                if (canButton == null) {
     141                        canButton = new JRadioButton(new ImageIcon(getClass().getResource(
     142                                        Messages.getString("CanButton"))));
     143                        canButton.setBounds(new Rectangle(0, 128, 90, 32));
    118144                }
    119                 return safeWaterButton;
     145                return canButton;
    120146        }
    121147
     148        private JRadioButton getFloatButton() {
     149                if (floatButton == null) {
     150                        floatButton = new JRadioButton(new ImageIcon(getClass().getResource(
     151                                        Messages.getString("FloatButton"))));
     152                        floatButton.setBounds(new Rectangle(90, 0, 90, 32));
     153                }
     154                return floatButton;
     155        }
     156
     157        private JRadioButton getBeaconButton() {
     158                if (beaconButton == null) {
     159                        beaconButton = new JRadioButton(new ImageIcon(getClass().getResource(
     160                                        Messages.getString("BeaconButton"))));
     161                        beaconButton.setBounds(new Rectangle(90, 32, 90, 32));
     162                }
     163                return beaconButton;
     164        }
     165
     166        private JRadioButton getTowerButton() {
     167                if (towerButton == null) {
     168                        towerButton = new JRadioButton(new ImageIcon(getClass().getResource(
     169                                        Messages.getString("TowerButton"))));
     170                        towerButton.setBounds(new Rectangle(90, 64, 90, 32));
     171                }
     172                return towerButton;
     173        }
     174
     175        private JRadioButton getPerchButton() {
     176                if (perchButton == null) {
     177                        perchButton = new JRadioButton(new ImageIcon(getClass().getResource(
     178                                        Messages.getString("PerchPButton"))));
     179                        perchButton.setBounds(new Rectangle(90, 96, 90, 32));
     180                }
     181                return perchButton;
     182        }
     183
     184
    122185}
Note: See TracChangeset for help on using the changeset viewer.