Ignore:
Timestamp:
2010-09-19T14:59:53+02:00 (15 years ago)
Author:
malcolmh
Message:

bug fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/toms/src/toms/seamarks/buoys/BuoyLat.java

    r23261 r23268  
    299299            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.10")); //$NON-NLS-1$
    300300            break;
    301 
    302301        case STARBOARD_HAND:
    303302            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.03")); //$NON-NLS-1$
     
    309308            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.10")); //$NON-NLS-1$
    310309            break;
    311 
    312310        case PREF_PORT_HAND:
    313311            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.02")); //$NON-NLS-1$
     
    318316            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$
    319317            break;
    320 
    321318        case PREF_STARBOARD_HAND:
    322319            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.03")); //$NON-NLS-1$
     
    327324            dlg.cbM01StyleOfMark.addItem(Messages.getString("Buoy.07")); //$NON-NLS-1$
    328325            break;
    329 
    330         default:
    331         }
     326                }
    332327
    333328        if (style >= dlg.cbM01StyleOfMark.getItemCount())
     
    339334    }
    340335
    341     public boolean isValid() {
    342         return (getBuoyIndex() > 0) && (getStyleIndex() > 0);
    343     }
    344 
    345     public void paintSign() {
    346         if (dlg.paintlock)
    347             return;
    348         super.paintSign();
     336        public void refreshLights() {
     337                super.refreshLights();
     338        }
     339
     340        public boolean isValid() {
     341                return (getBuoyIndex() > 0) && (getStyleIndex() > 0);
     342        }
     343
     344        public void setLightColour() {
     345                if (getRegion() == IALA_A) {
     346                        if (getBuoyIndex() == PORT_HAND || getBuoyIndex() == PREF_PORT_HAND)
     347                                super.setLightColour("R"); //$NON-NLS-1$
     348                        else
     349                                super.setLightColour("G"); //$NON-NLS-1$
     350                } else {
     351                        if (getBuoyIndex() == PORT_HAND || getBuoyIndex() == PREF_PORT_HAND)
     352                                super.setLightColour("G"); //$NON-NLS-1$
     353                        else
     354                                super.setLightColour("R"); //$NON-NLS-1$
     355                }
     356        }
     357
     358        public void paintSign() {
     359                if (dlg.paintlock)
     360                        return;
     361                super.paintSign();
    349362
    350363        dlg.sM01StatusBar.setText(getErrMsg());
     
    354367            dlg.tfM01Name.setText(getName());
    355368
    356             int cat = getBuoyIndex();
    357             boolean region = getRegion();
    358             int style = getStyleIndex();
    359 
    360             if (style == LAT_PERCH) {
    361                 dlg.cM01TopMark.setVisible(false);
    362                 dlg.cM01TopMark.setSelected(false);
    363                 dlg.cM01Radar.setVisible(false);
    364                 dlg.cM01Racon.setVisible(false);
    365                 dlg.cM01Fog.setVisible(false);
    366                 dlg.cM01Fired.setVisible(false);
    367                 dlg.cM01Fired.setSelected(false);
    368             } else {
    369                 dlg.cM01TopMark.setEnabled(true);
    370                 dlg.cM01TopMark.setVisible(true);
    371                 dlg.cM01Radar.setVisible(true);
    372                 dlg.cM01Racon.setVisible(true);
    373                 dlg.cM01Fog.setVisible(true);
    374                 dlg.cM01Fired.setVisible(true);
    375                 dlg.cM01Fired.setEnabled(true);
    376                 dlg.cM01TopMark.setEnabled(true);
    377             }
    378             dlg.cbM01Colour.setVisible(false);
    379             dlg.lM01Colour.setVisible(false);
    380             dlg.rbM01Fired1.setVisible(false);
    381             dlg.rbM01FiredN.setVisible(false);
    382             dlg.lM01Height.setVisible(false);
    383             dlg.tfM01Height.setVisible(false);
    384             dlg.lM01Range.setVisible(false);
    385             dlg.tfM01Range.setVisible(false);
    386 
    387             if (isFired()) {
    388                 switch (style) {
    389                 case LAT_BEACON:
    390                 case LAT_TOWER:
    391                     dlg.rbM01Fired1.setVisible(true);
    392                     dlg.rbM01FiredN.setVisible(true);
    393                     dlg.lM01Height.setVisible(true);
    394                     dlg.tfM01Height.setVisible(true);
    395                     dlg.lM01Range.setVisible(true);
    396                     dlg.tfM01Range.setVisible(true);
    397                     break;
    398                 case LAT_FLOAT:
    399                     dlg.lM01Height.setVisible(true);
    400                     dlg.tfM01Height.setVisible(true);
    401                     dlg.lM01Range.setVisible(true);
    402                     dlg.tfM01Range.setVisible(true);
    403                     break;
    404                 default:
    405                 }
    406             }
     369                        boolean region = getRegion();
     370                        int style = getStyleIndex();
     371
     372                        if (style == LAT_PERCH) {
     373                                dlg.cM01TopMark.setVisible(false);
     374                                dlg.cM01TopMark.setSelected(false);
     375                                dlg.cM01Radar.setVisible(false);
     376                                dlg.cM01Racon.setVisible(false);
     377                                dlg.cM01Fog.setVisible(false);
     378                                dlg.cM01Fired.setVisible(false);
     379                                dlg.cM01Fired.setSelected(false);
     380                        } else {
     381                                dlg.cM01TopMark.setEnabled(true);
     382                                dlg.cM01TopMark.setVisible(true);
     383                                dlg.cM01Radar.setVisible(true);
     384                                dlg.cM01Racon.setVisible(true);
     385                                dlg.cM01Fog.setVisible(true);
     386                                dlg.cM01Fired.setVisible(true);
     387                                dlg.cM01Fired.setEnabled(true);
     388                                dlg.cM01TopMark.setEnabled(true);
     389                        }
     390                        if (!isSectored()) {
     391                                dlg.cbM01Colour.setVisible(false);
     392                                dlg.lM01Colour.setVisible(false);
     393                        }
     394                        dlg.rbM01Fired1.setVisible(false);
     395                        dlg.rbM01FiredN.setVisible(false);
     396                        dlg.lM01Height.setVisible(false);
     397                        dlg.tfM01Height.setVisible(false);
     398                        dlg.lM01Range.setVisible(false);
     399                        dlg.tfM01Range.setVisible(false);
     400
     401                        if (isFired()) {
     402                                switch (style) {
     403                                case LAT_BEACON:
     404                                case LAT_TOWER:
     405                                case LAT_FLOAT:
     406                                        dlg.lM01Height.setVisible(true);
     407                                        dlg.tfM01Height.setVisible(true);
     408                                        dlg.lM01Range.setVisible(true);
     409                                        dlg.tfM01Range.setVisible(true);
     410                                        break;
     411                                default:
     412                                }
     413                        }
    407414
    408415            String image = "/images/Lateral"; //$NON-NLS-1$
     
    10591066        Main.pref.put("tomsplugin.IALA", getRegion() ? "B" : "A"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    10601067    }
    1061 
    1062     public void setLightColour() {
    1063         if (getRegion() == IALA_A) {
    1064             if (getBuoyIndex() == PORT_HAND || getBuoyIndex() == PREF_PORT_HAND)
    1065                 super.setLightColour("R"); //$NON-NLS-1$
    1066             else
    1067                 super.setLightColour("G"); //$NON-NLS-1$
    1068         } else {
    1069             if (getBuoyIndex() == PORT_HAND || getBuoyIndex() == PREF_PORT_HAND)
    1070                 super.setLightColour("G"); //$NON-NLS-1$
    1071             else
    1072                 super.setLightColour("R"); //$NON-NLS-1$
    1073         }
    1074     }
    1075 
    10761068}
Note: See TracChangeset for help on using the changeset viewer.