Ignore:
Timestamp:
2014-10-19T01:27:04+02:00 (12 years ago)
Author:
donvip
Message:

[josm_plugins] fix java 7 warnings / global usage of try-with-resource

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed/src/panels/PanelLights.java

    r30737 r30738  
    2525                                int idx = landCats.get(cat);
    2626                                if (dlg.node != null && (idx == landCatBox.getSelectedIndex())) {
    27                                         dlg.panelMain.mark.setCategory(cat);
    28                                         dlg.panelMain.mark.testValid();
     27                                        SmedAction.panelMain.mark.setCategory(cat);
     28                                        SmedAction.panelMain.mark.testValid();
    2929                                }
    3030                        }
     
    3838                                int idx = trafficCats.get(cat);
    3939                                if (dlg.node != null && (idx == trafficCatBox.getSelectedIndex())) {
    40                                         dlg.panelMain.mark.setCategory(cat);
    41                                         dlg.panelMain.mark.testValid();
     40                                        SmedAction.panelMain.mark.setCategory(cat);
     41                                        SmedAction.panelMain.mark.testValid();
    4242                                }
    4343                        }
     
    5151                                int idx = warningCats.get(cat);
    5252                                if (dlg.node != null && (idx == warningCatBox.getSelectedIndex())) {
    53                                         dlg.panelMain.mark.setCategory(cat);
    54                                         dlg.panelMain.mark.testValid();
     53                                        SmedAction.panelMain.mark.setCategory(cat);
     54                                        SmedAction.panelMain.mark.testValid();
    5555                                }
    5656                        }
     
    6464                                int idx = platformCats.get(cat);
    6565                                if (dlg.node != null && (idx == platformCatBox.getSelectedIndex())) {
    66                                         dlg.panelMain.mark.setCategory(cat);
    67                                         dlg.panelMain.mark.testValid();
     66                                        SmedAction.panelMain.mark.setCategory(cat);
     67                                        SmedAction.panelMain.mark.testValid();
    6868                                }
    6969                        }
     
    7777                                int idx = pilotCats.get(cat);
    7878                                if (dlg.node != null && (idx == pilotCatBox.getSelectedIndex())) {
    79                                         dlg.panelMain.mark.setCategory(cat);
    80                                         dlg.panelMain.mark.testValid();
     79                                        SmedAction.panelMain.mark.setCategory(cat);
     80                                        SmedAction.panelMain.mark.testValid();
    8181                                }
    8282                        }
     
    9090                                int idx = rescueCats.get(cat);
    9191                                if (dlg.node != null && (idx == rescueCatBox.getSelectedIndex())) {
    92                                         dlg.panelMain.mark.setCategory(cat);
    93                                         dlg.panelMain.mark.testValid();
     92                                        SmedAction.panelMain.mark.setCategory(cat);
     93                                        SmedAction.panelMain.mark.testValid();
    9494                                }
    9595                        }
     
    103103                                int idx = radioCats.get(cat);
    104104                                if (dlg.node != null && (idx == radioCatBox.getSelectedIndex())) {
    105                                         dlg.panelMain.mark.setCategory(cat);
    106                                         dlg.panelMain.mark.testValid();
     105                                        SmedAction.panelMain.mark.setCategory(cat);
     106                                        SmedAction.panelMain.mark.testValid();
    107107                                }
    108108                        }
     
    116116                                int idx = radarCats.get(cat);
    117117                                if (dlg.node != null && (idx == radarCatBox.getSelectedIndex())) {
    118                                         dlg.panelMain.mark.setCategory(cat);
    119                                         dlg.panelMain.mark.testValid();
     118                                        SmedAction.panelMain.mark.setCategory(cat);
     119                                        SmedAction.panelMain.mark.testValid();
    120120                                }
    121121                        }
     
    130130                                int idx = functions.get(fnc);
    131131                                if (dlg.node != null && (idx == functionBox.getSelectedIndex())) {
    132                                         dlg.panelMain.mark.setFunc(fnc);
    133                                         dlg.panelMain.mark.testValid();
     132                                        SmedAction.panelMain.mark.setFunc(fnc);
     133                                        SmedAction.panelMain.mark.testValid();
    134134                                }
    135135                        }
     
    157157                                JRadioButton button = objects.get(obj);
    158158                                if (button.isSelected()) {
    159                                         dlg.panelMain.mark.setObject(obj);
     159                                        SmedAction.panelMain.mark.setObject(obj);
    160160                                        button.setBorderPainted(true);
    161161                                } else
    162162                                        button.setBorderPainted(false);
    163163                        }
    164                         if (dlg.panelMain.mark.getObject() == Obj.LITVES)
    165                                 dlg.panelMain.mark.setShape(Shp.SUPER);
    166                         else if (dlg.panelMain.mark.getObject() == Obj.LITFLT)
    167                                 dlg.panelMain.mark.setShape(Shp.FLOAT);
    168                         else dlg.panelMain.mark.setShape(Shp.UNKSHP);
     164                        if (SmedAction.panelMain.mark.getObject() == Obj.LITVES)
     165                                SmedAction.panelMain.mark.setShape(Shp.SUPER);
     166                        else if (SmedAction.panelMain.mark.getObject() == Obj.LITFLT)
     167                                SmedAction.panelMain.mark.setShape(Shp.FLOAT);
     168                        else SmedAction.panelMain.mark.setShape(Shp.UNKSHP);
    169169                        functionLabel.setVisible(false);
    170170                        categoryLabel.setVisible(false);
     
    181181                        chLabel.setVisible(false);
    182182                        chBox.setVisible(false);
    183                         dlg.panelMain.mark.setCategory(Cat.NOCAT);
     183                        SmedAction.panelMain.mark.setCategory(Cat.NOCAT);
    184184                        if (landButton.isSelected()) {
    185185                                functionLabel.setVisible(true);
     
    227227                                alRadarCatBox.actionPerformed(null);
    228228                        }
    229                         dlg.panelMain.mark.testValid();
     229                        SmedAction.panelMain.mark.testValid();
    230230                }
    231231        };
     
    234234        private FocusListener flCh = new FocusAdapter() {
    235235                public void focusLost(java.awt.event.FocusEvent e) {
    236                         dlg.panelMain.mark.setChannel(chBox.getText());
     236                        SmedAction.panelMain.mark.setChannel(chBox.getText());
    237237                }
    238238        };
     
    462462                chLabel.setVisible(false);
    463463                chBox.setVisible(false);
    464                 chBox.setText(dlg.panelMain.mark.getChannel());
    465                 if ((dlg.panelMain.mark.getObject() == Obj.LNDMRK) && ((dlg.panelMain.mark.getCategory() != Cat.NOCAT) || (dlg.panelMain.mark.getFunc() != Fnc.UNKFNC))) {
     464                chBox.setText(SmedAction.panelMain.mark.getChannel());
     465                if ((SmedAction.panelMain.mark.getObject() == Obj.LNDMRK) && ((SmedAction.panelMain.mark.getCategory() != Cat.NOCAT) || (SmedAction.panelMain.mark.getFunc() != Fnc.UNKFNC))) {
    466466                        functionLabel.setVisible(true);
    467467                        categoryLabel.setVisible(true);
     
    470470                        for (Fnc fnc : functions.keySet()) {
    471471                                int item = functions.get(fnc);
    472                                 if (dlg.panelMain.mark.getFunc() == fnc)
     472                                if (SmedAction.panelMain.mark.getFunc() == fnc)
    473473                                        functionBox.setSelectedIndex(item);
    474474                        }
    475475                        for (Cat cat : landCats.keySet()) {
    476476                                int item = landCats.get(cat);
    477                                 if (dlg.panelMain.mark.getCategory() == cat)
     477                                if (SmedAction.panelMain.mark.getCategory() == cat)
    478478                                        landCatBox.setSelectedIndex(item);
    479479                        }
    480                 } else if (dlg.panelMain.mark.getObject() == Obj.SISTAT) {
     480                } else if (SmedAction.panelMain.mark.getObject() == Obj.SISTAT) {
    481481                                categoryLabel.setVisible(true);
    482482                                trafficCatBox.setVisible(true);
    483483                                for (Cat cat : trafficCats.keySet()) {
    484484                                        int item = trafficCats.get(cat);
    485                                         if (dlg.panelMain.mark.getCategory() == cat)
     485                                        if (SmedAction.panelMain.mark.getCategory() == cat)
    486486                                                trafficCatBox.setSelectedIndex(item);
    487487                                }
    488488                                chLabel.setVisible(true);
    489489                                chBox.setVisible(true);
    490                 } else if (dlg.panelMain.mark.getObject() == Obj.SISTAW) {
     490                } else if (SmedAction.panelMain.mark.getObject() == Obj.SISTAW) {
    491491                        categoryLabel.setVisible(true);
    492492                        warningCatBox.setVisible(true);
    493493                        for (Cat cat : warningCats.keySet()) {
    494494                                int item = warningCats.get(cat);
    495                                 if (dlg.panelMain.mark.getCategory() == cat)
     495                                if (SmedAction.panelMain.mark.getCategory() == cat)
    496496                                        warningCatBox.setSelectedIndex(item);
    497497                        }
    498498                        chLabel.setVisible(true);
    499499                        chBox.setVisible(true);
    500                 } else if (dlg.panelMain.mark.getObject() == Obj.OFSPLF) {
     500                } else if (SmedAction.panelMain.mark.getObject() == Obj.OFSPLF) {
    501501                        categoryLabel.setVisible(true);
    502502                        platformCatBox.setVisible(true);
    503503                        for (Cat cat : platformCats.keySet()) {
    504504                                int item = platformCats.get(cat);
    505                                 if (dlg.panelMain.mark.getCategory() == cat)
     505                                if (SmedAction.panelMain.mark.getCategory() == cat)
    506506                                        platformCatBox.setSelectedIndex(item);
    507507                        }
    508                 } else if (dlg.panelMain.mark.getObject() == Obj.PILBOP) {
     508                } else if (SmedAction.panelMain.mark.getObject() == Obj.PILBOP) {
    509509                        categoryLabel.setVisible(true);
    510510                        pilotCatBox.setVisible(true);
    511511                        for (Cat cat : pilotCats.keySet()) {
    512512                                int item = pilotCats.get(cat);
    513                                 if (dlg.panelMain.mark.getCategory() == cat)
     513                                if (SmedAction.panelMain.mark.getCategory() == cat)
    514514                                        pilotCatBox.setSelectedIndex(item);
    515515                        }
    516516                        chLabel.setVisible(true);
    517517                        chBox.setVisible(true);
    518                 } else if (dlg.panelMain.mark.getObject() == Obj.RSCSTA) {
     518                } else if (SmedAction.panelMain.mark.getObject() == Obj.RSCSTA) {
    519519                        categoryLabel.setVisible(true);
    520520                        rescueCatBox.setVisible(true);
    521521                        for (Cat cat : rescueCats.keySet()) {
    522522                                int item = rescueCats.get(cat);
    523                                 if (dlg.panelMain.mark.getCategory() == cat)
     523                                if (SmedAction.panelMain.mark.getCategory() == cat)
    524524                                        rescueCatBox.setSelectedIndex(item);
    525525                        }
    526                 } else if (dlg.panelMain.mark.getObject() == Obj.RDOSTA) {
     526                } else if (SmedAction.panelMain.mark.getObject() == Obj.RDOSTA) {
    527527                        categoryLabel.setVisible(true);
    528528                        radioCatBox.setVisible(true);
    529529                        for (Cat cat : radioCats.keySet()) {
    530530                                int item = radioCats.get(cat);
    531                                 if (dlg.panelMain.mark.getCategory() == cat)
     531                                if (SmedAction.panelMain.mark.getCategory() == cat)
    532532                                        radioCatBox.setSelectedIndex(item);
    533533                        }
    534534                        chLabel.setVisible(true);
    535535                        chBox.setVisible(true);
    536                 } else if (dlg.panelMain.mark.getObject() == Obj.RADSTA) {
     536                } else if (SmedAction.panelMain.mark.getObject() == Obj.RADSTA) {
    537537                        categoryLabel.setVisible(true);
    538538                        radarCatBox.setVisible(true);
    539539                        for (Cat cat : radarCats.keySet()) {
    540540                                int item = radarCats.get(cat);
    541                                 if (dlg.panelMain.mark.getCategory() == cat)
     541                                if (SmedAction.panelMain.mark.getCategory() == cat)
    542542                                        radarCatBox.setSelectedIndex(item);
    543543                        }
     
    547547                for (Obj obj : objects.keySet()) {
    548548                        JRadioButton button = objects.get(obj);
    549                         button.setBorderPainted(dlg.panelMain.mark.getObject() == obj);
    550                 }
    551                 dlg.panelMain.mark.testValid();
     549                        button.setBorderPainted(SmedAction.panelMain.mark.getObject() == obj);
     550                }
     551                SmedAction.panelMain.mark.testValid();
    552552        }
    553553       
Note: See TracChangeset for help on using the changeset viewer.