Ignore:
Timestamp:
2010-09-08T10:42:51+02:00 (14 years ago)
Author:
malcolmh
Message:

fog signals

Location:
applications/editors/josm/plugins/toms/src/toms
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/toms/src/toms/dialogs/SmpDialogAction.java

    r23058 r23072  
    116116        public JRadioButton rbM01RegionA = null;
    117117        public JRadioButton rbM01RegionB = null;
    118         public JLabel lM01Icon = null;  // Shape
    119         public JLabel lM02Icon = null;  // Light
    120         public JLabel lM03Icon = null;  // Reflector
    121         public JLabel lM04Icon = null;  // Racon
    122         public JLabel lM05Icon = null;  // Fog
     118        public JLabel lM01Icon = null; // Shape
     119        public JLabel lM02Icon = null; // Light
     120        public JLabel lM03Icon = null; // Reflector
     121        public JLabel lM04Icon = null; // Racon
     122        public JLabel lM05Icon = null; // Fog
    123123        public JLabel lM01FireMark = null;
    124124        private JLabel lM01TypeOfMark = null;
     
    172172
    173173        public boolean paintlock = false;
    174        
     174
    175175        public JMenuItem getSmpItem() {
    176176                return SmpItem;
     
    10231023                                public void actionPerformed(ActionEvent e) {
    10241024                                        int rac = cbM01Racon.getSelectedIndex();
    1025                                         buoy.setRatyp(rac);
     1025                                        buoy.setRaType(rac);
    10261026                                        buoy.paintSign();
    10271027                                }
     
    10371037                        tfM01Racon.addFocusListener(new FocusAdapter() {
    10381038                                public void focusLost(FocusEvent e) {
    1039                                         buoy.setName(tfM01Racon.getText());
     1039                                        buoy.setRaconGroup(tfM01Racon.getText());
    10401040                                }
    10411041                        });
     
    10651065                        cbM01Fog.setBounds(new Rectangle(100, 220, 70, 20));
    10661066                        cbM01Fog.setFont(new Font("Dialog", Font.PLAIN, 12)); //$NON-NLS-1$
     1067                        cbM01Fog.removeAllItems();
     1068                        cbM01Fog.addItem("Not Set");
     1069                        cbM01Fog.addItem("Horn");
     1070                        cbM01Fog.addItem("Siren");
     1071                        cbM01Fog.addItem("Dia");
     1072                        cbM01Fog.addItem("Bell");
     1073                        cbM01Fog.addItem("Whis");
     1074                        cbM01Fog.addItem("Gong");
     1075                        cbM01Fog.addItem("Explos");
    10671076                        cbM01Fog.addActionListener(new ActionListener() {
    10681077                                public void actionPerformed(ActionEvent e) {
    1069                                         int fog = cbM01Fog.getSelectedIndex();
     1078                                        if (cbM01Fog.getSelectedIndex() > 0)
     1079                                                buoy.setFogSound((String) cbM01Fog.getSelectedItem());
     1080                                        else
     1081                                                buoy.setFogSound("");
     1082                                        buoy.paintSign();
    10701083                                }
    10711084                        });
     
    10801093                        tfM01FogGroup.addFocusListener(new FocusAdapter() {
    10811094                                public void focusLost(FocusEvent e) {
    1082                                         buoy.setName(tfM01FogGroup.getText());
     1095                                        buoy.setFogGroup(tfM01FogGroup.getText());
    10831096                                }
    10841097                        });
     
    10931106                        tfM01FogPeriod.addFocusListener(new FocusAdapter() {
    10941107                                public void focusLost(FocusEvent e) {
    1095                                         buoy.setName(tfM01FogPeriod.getText());
     1108                                        buoy.setFogPeriod(tfM01FogPeriod.getText());
    10961109                                }
    10971110                        });
  • applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/Buoy.java

    r23060 r23072  
    7777        }
    7878
    79         private int Ratyp = 0;
    80        
    81         public int getRatyp() {
    82                 return Ratyp;
    83         }
    84        
    85         public void setRatyp(int typ) {
    86                 Ratyp = typ;
    87         }
    88        
     79        private int RaType = 0;
     80
     81        public int getRaType() {
     82                return RaType;
     83        }
     84
     85        public void setRaType(int type) {
     86                RaType = type;
     87        }
     88
     89        private String RaconGroup = "";
     90
     91        public String getRaconGroup() {
     92                return RaconGroup;
     93        }
     94
     95        public void setRaconGroup(String raconGroup) {
     96                RaconGroup = raconGroup;
     97        }
     98
    8999        private boolean Fog = false;
    90100
     
    95105        public void setFog(boolean fog) {
    96106                Fog = fog;
     107        }
     108
     109        private String FogSound = "";
     110
     111        public String getFogSound() {
     112                return FogSound;
     113        }
     114
     115        public void setFogSound(String fogSound) {
     116                FogSound = fogSound;
     117        }
     118
     119        private String FogGroup = "";
     120
     121        public String getFogGroup() {
     122                return FogGroup;
     123        }
     124
     125        public void setFogGroup(String fogGroup) {
     126                FogSound = fogGroup;
     127        }
     128
     129        private String FogPeriod = "";
     130
     131        public String getFogPeriod() {
     132                return FogPeriod;
     133        }
     134
     135        public void setFogPeriod(String fogPeriod) {
     136                FogPeriod = fogPeriod;
    97137        }
    98138
     
    254294        public void paintSign() {
    255295
    256                 if (dlg.paintlock) return;
     296                if (dlg.paintlock)
     297                        return;
    257298                dlg.lM01Icon.setIcon(null);
    258299                dlg.lM02Icon.setIcon(null);
     
    260301                dlg.lM04Icon.setIcon(null);
    261302                dlg.lM05Icon.setIcon(null);
    262                
     303
    263304                dlg.rbM01RegionA.setSelected(!getRegion());
    264305                dlg.rbM01RegionB.setSelected(getRegion());
     
    270311
    271312                dlg.tfM01Name.setText(getName());
    272                
     313
    273314                if (hasRadar()) {
    274                         dlg.lM03Icon.setIcon(new ImageIcon(getClass().getResource("/images/Radar_Reflector.png")));
    275                 }
    276                
     315                        dlg.lM03Icon.setIcon(new ImageIcon(getClass().getResource(
     316                                        "/images/Radar_Reflector.png")));
     317                }
     318
    277319                if (hasRacon()) {
    278                         dlg.lM04Icon.setIcon(new ImageIcon(getClass().getResource("/images/Radar_Station.png")));
     320                        dlg.lM04Icon.setIcon(new ImageIcon(getClass().getResource(
     321                                        "/images/Radar_Station.png")));
    279322                        dlg.cbM01Racon.setVisible(true);
    280                         if (getRatyp() == RATYP_RACON) {
     323                        if (getRaType() == RATYP_RACON) {
    281324                                dlg.lM01Racon.setVisible(true);
    282325                                dlg.tfM01Racon.setVisible(true);
     
    291334                        dlg.tfM01Racon.setVisible(false);
    292335                }
    293                
     336
    294337                if (hasFog()) {
    295                         dlg.lM05Icon.setIcon(new ImageIcon(getClass().getResource("/images/Fog_Signal.png")));
    296                 }
    297                
     338                        dlg.lM05Icon.setIcon(new ImageIcon(getClass().getResource(
     339                                        "/images/Fog_Signal.png")));
     340                        dlg.cbM01Fog.setVisible(true);
     341                        if (getFogSound().equals("")) {
     342                                dlg.lM01FogGroup.setVisible(false);
     343                                dlg.tfM01FogGroup.setVisible(false);
     344                                dlg.lM01FogPeriod.setVisible(false);
     345                                dlg.tfM01FogPeriod.setVisible(false);
     346                        } else {
     347                                dlg.lM01FogGroup.setVisible(true);
     348                                dlg.tfM01FogGroup.setVisible(true);
     349                                dlg.lM01FogPeriod.setVisible(true);
     350                                dlg.tfM01FogPeriod.setVisible(true);
     351                        }
     352                } else {
     353                        dlg.cbM01Fog.setVisible(false);
     354                        dlg.lM01FogGroup.setVisible(false);
     355                        dlg.tfM01FogGroup.setVisible(false);
     356                        dlg.lM01FogPeriod.setVisible(false);
     357                        dlg.tfM01FogPeriod.setVisible(false);
     358                }
     359
    298360                if (isFired()) {
    299361                        String lp, c;
     
    303365                        String col = getLightColour();
    304366                        if (col.equals("W"))
    305                                 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource("/images/Light_White_120.png")));
     367                                dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource(
     368                                                "/images/Light_White_120.png")));
    306369                        else if (col.equals("R"))
    307                                 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Red_120.png")));
     370                                dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource(
     371                                                "/images/Light_Red_120.png")));
    308372                        else if (col.equals("G"))
    309                                 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Green_120.png")));
     373                                dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource(
     374                                                "/images/Light_Green_120.png")));
    310375                        else
    311                                 dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource("/images/Light_Magenta_120.png")));
    312        
     376                                dlg.lM02Icon.setIcon(new ImageIcon(getClass().getResource(
     377                                                "/images/Light_Magenta_120.png")));
     378
    313379                        dlg.cbM01Kennung.setEnabled(true);
    314380
     
    437503                dlg.lM01Racon.setVisible(false);
    438504                setRacon(false);
    439                 setRatyp(0);
     505                setRaType(0);
    440506                dlg.cM01Fog.setSelected(false);
    441507                dlg.cM01Fog.setVisible(false);
    442                 dlg.cbM01Fog.removeAllItems();
    443508                dlg.cbM01Fog.setVisible(false);
     509                setFogSound("");
    444510                dlg.tfM01FogGroup.setText("");
    445511                dlg.tfM01FogGroup.setVisible(false);
Note: See TracChangeset for help on using the changeset viewer.