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/PanelLit.java

    r30737 r30738  
    2121        private FocusListener flGroup = new FocusAdapter() {
    2222                public void focusLost(java.awt.event.FocusEvent e) {
    23                         dlg.panelMain.mark.setLightAtt(Att.GRP, 0, groupBox.getText());
     23                        SmedAction.panelMain.mark.setLightAtt(Att.GRP, 0, groupBox.getText());
    2424                }
    2525        };
     
    2828        private FocusListener flPeriod = new FocusAdapter() {
    2929                public void focusLost(java.awt.event.FocusEvent e) {
    30                         dlg.panelMain.mark.setLightAtt(Att.PER, 0, periodBox.getText());
     30                        SmedAction.panelMain.mark.setLightAtt(Att.PER, 0, periodBox.getText());
    3131                }
    3232        };
     
    3535        private FocusListener flSequence = new FocusAdapter() {
    3636                public void focusLost(java.awt.event.FocusEvent e) {
    37                         dlg.panelMain.mark.setLightAtt(Att.SEQ, 0, sequenceBox.getText());
     37                        SmedAction.panelMain.mark.setLightAtt(Att.SEQ, 0, sequenceBox.getText());
    3838                }
    3939        };
     
    4646                                int idx = visibilities.get(vis);
    4747                                if (idx == visibilityBox.getSelectedIndex())
    48                                         dlg.panelMain.mark.setLightAtt(Att.VIS, 0, vis);
     48                                        SmedAction.panelMain.mark.setLightAtt(Att.VIS, 0, vis);
    4949                        }
    5050                }
     
    5454        private FocusListener flHeight = new FocusAdapter() {
    5555                public void focusLost(java.awt.event.FocusEvent e) {
    56                         dlg.panelMain.mark.setLightAtt(Att.HGT, 0, heightBox.getText());
     56                        SmedAction.panelMain.mark.setLightAtt(Att.HGT, 0, heightBox.getText());
    5757                }
    5858        };
     
    6161        private FocusListener flRange = new FocusAdapter() {
    6262                public void focusLost(java.awt.event.FocusEvent e) {
    63                         dlg.panelMain.mark.setLightAtt(Att.RNG, 0, rangeBox.getText());
     63                        SmedAction.panelMain.mark.setLightAtt(Att.RNG, 0, rangeBox.getText());
    6464                }
    6565        };
     
    6868        private FocusListener flOrientation = new FocusAdapter() {
    6969                public void focusLost(java.awt.event.FocusEvent e) {
    70                         dlg.panelMain.mark.setLightAtt(Att.ORT, 0, orientationBox.getText());
     70                        SmedAction.panelMain.mark.setLightAtt(Att.ORT, 0, orientationBox.getText());
    7171                }
    7272        };
     
    7575        private FocusListener flMultiple = new FocusAdapter() {
    7676                public void focusLost(java.awt.event.FocusEvent e) {
    77                         dlg.panelMain.mark.setLightAtt(Att.MLT, 0, multipleBox.getText());
     77                        SmedAction.panelMain.mark.setLightAtt(Att.MLT, 0, multipleBox.getText());
    7878                }
    7979        };
     
    8686                                int idx = categories.get(lit);
    8787                                if (idx == categoryBox.getSelectedIndex())
    88                                         dlg.panelMain.mark.setLightAtt(Att.LIT, 0, lit);
    89                         }
    90                         if (dlg.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.DIR) {
    91                                 dlg.panelMain.mark.setLightAtt(Att.MLT, 0, "");
     88                                        SmedAction.panelMain.mark.setLightAtt(Att.LIT, 0, lit);
     89                        }
     90                        if (SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.DIR) {
     91                                SmedAction.panelMain.mark.setLightAtt(Att.MLT, 0, "");
    9292                                multipleBox.setText("");
    9393                                orientationLabel.setVisible(true);
     
    9595                                multipleLabel.setVisible(false);
    9696                                multipleBox.setVisible(false);
    97                         } else if ((dlg.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.VERT) || (dlg.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.HORIZ)) {
    98                                 dlg.panelMain.mark.setLightAtt(Att.ORT, 0, "");
     97                        } else if ((SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.VERT) || (SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.HORIZ)) {
     98                                SmedAction.panelMain.mark.setLightAtt(Att.ORT, 0, "");
    9999                                orientationBox.setText("");
    100100                                orientationLabel.setVisible(false);
     
    103103                                multipleBox.setVisible(true);
    104104                        } else {
    105                                 dlg.panelMain.mark.setLightAtt(Att.MLT, 0, "");
     105                                SmedAction.panelMain.mark.setLightAtt(Att.MLT, 0, "");
    106106                                multipleBox.setText("");
    107                                 dlg.panelMain.mark.setLightAtt(Att.ORT, 0, "");
     107                                SmedAction.panelMain.mark.setLightAtt(Att.ORT, 0, "");
    108108                                orientationBox.setText("");
    109109                                orientationLabel.setVisible(false);
     
    122122                                int idx = exhibitions.get(exh);
    123123                                if (idx == exhibitionBox.getSelectedIndex())
    124                                         dlg.panelMain.mark.setLightAtt(Att.EXH, 0, exh);
     124                                        SmedAction.panelMain.mark.setLightAtt(Att.EXH, 0, exh);
    125125                        }
    126126                }
     
    137137                        } else {
    138138                                panelSector.setVisible(false);
    139                                 while (dlg.panelMain.mark.getSectorCount() > 1)
    140                                         dlg.panelMain.mark.delLight(1);
     139                                while (SmedAction.panelMain.mark.getSectorCount() > 1)
     140                                        SmedAction.panelMain.mark.delLight(1);
    141141                        }
    142142                }
     
    285285                multipleLabel.setVisible(false);
    286286                multipleBox.setVisible(false);
    287                 groupBox.setText((String)dlg.panelMain.mark.getLightAtt(Att.GRP, 0));
    288                 periodBox.setText((String)dlg.panelMain.mark.getLightAtt(Att.PER, 0));
    289                 sequenceBox.setText((String)dlg.panelMain.mark.getLightAtt(Att.SEQ, 0));
    290                 heightBox.setText((String)dlg.panelMain.mark.getLightAtt(Att.HGT, 0));
    291                 rangeBox.setText((String)dlg.panelMain.mark.getLightAtt(Att.RNG, 0));
    292                 orientationBox.setText((String)dlg.panelMain.mark.getLightAtt(Att.ORT, 0));
    293                 orientationBox.setVisible(dlg.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.DIR);
    294                 multipleBox.setText((String)dlg.panelMain.mark.getLightAtt(Att.MLT, 0));
    295                 multipleBox.setVisible((dlg.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.VERT) || (dlg.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.HORIZ));
     287                groupBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.GRP, 0));
     288                periodBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.PER, 0));
     289                sequenceBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.SEQ, 0));
     290                heightBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.HGT, 0));
     291                rangeBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.RNG, 0));
     292                orientationBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.ORT, 0));
     293                orientationBox.setVisible(SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.DIR);
     294                multipleBox.setText((String)SmedAction.panelMain.mark.getLightAtt(Att.MLT, 0));
     295                multipleBox.setVisible((SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.VERT) || (SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == Lit.HORIZ));
    296296                for (Vis vis : visibilities.keySet()) {
    297297                        int item = visibilities.get(vis);
    298                         if (dlg.panelMain.mark.getLightAtt(Att.VIS, 0) == vis)
     298                        if (SmedAction.panelMain.mark.getLightAtt(Att.VIS, 0) == vis)
    299299                                visibilityBox.setSelectedIndex(item);
    300300                }
    301301                for (Lit lit : categories.keySet()) {
    302302                        int item = categories.get(lit);
    303                         if (dlg.panelMain.mark.getLightAtt(Att.LIT, 0) == lit)
     303                        if (SmedAction.panelMain.mark.getLightAtt(Att.LIT, 0) == lit)
    304304                                categoryBox.setSelectedIndex(item);
    305305                }
    306306                for (Exh exh : exhibitions.keySet()) {
    307307                        int item = exhibitions.get(exh);
    308                         if (dlg.panelMain.mark.getLightAtt(Att.EXH, 0) == exh)
     308                        if (SmedAction.panelMain.mark.getLightAtt(Att.EXH, 0) == exh)
    309309                                exhibitionBox.setSelectedIndex(item);
    310310                }
    311                 if (dlg.panelMain.mark.isSectored()) {
     311                if (SmedAction.panelMain.mark.isSectored()) {
    312312                        singleButton.setBorderPainted(false);
    313313                        sectorButton.setBorderPainted(true);
     
    317317                        sectorButton.setBorderPainted(false);
    318318                        panelSector.setVisible(false);
    319                         while (dlg.panelMain.mark.getSectorCount() > 1)
    320                                 dlg.panelMain.mark.delLight(dlg.panelMain.mark.getSectorCount() - 1);
     319                        while (SmedAction.panelMain.mark.getSectorCount() > 1)
     320                                SmedAction.panelMain.mark.delLight(SmedAction.panelMain.mark.getSectorCount() - 1);
    321321                }
    322322                panelCol.syncPanel();
Note: See TracChangeset for help on using the changeset viewer.