Ignore:
Timestamp:
2014-10-19T01:27:04+02:00 (11 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/PanelCol.java

    r30737 r30738  
    4141                                if (button.isSelected()) {
    4242                                        if (ent == Ent.LIGHT) {
    43                                                 if (((String) dlg.panelMain.mark.getLightAtt(Att.CHR, 0)).contains("Al")) {
    44                                                         if (((button == delButton) && (dlg.panelMain.mark.getLightAtt(Att.ALT, 0) == Col.UNKCOL))
    45                                                                         || (dlg.panelMain.mark.getLightAtt(Att.COL, 0) == Col.UNKCOL)) {
    46                                                                 dlg.panelMain.mark.setLightAtt(Att.COL, 0, col);
    47                                                                 dlg.panelMain.panelLit.panelChr.col1Label.setBackground(SeaMark.ColMAP.get(col));
     43                                                if (((String) SmedAction.panelMain.mark.getLightAtt(Att.CHR, 0)).contains("Al")) {
     44                                                        if (((button == delButton) && (SmedAction.panelMain.mark.getLightAtt(Att.ALT, 0) == Col.UNKCOL))
     45                                                                        || (SmedAction.panelMain.mark.getLightAtt(Att.COL, 0) == Col.UNKCOL)) {
     46                                                                SmedAction.panelMain.mark.setLightAtt(Att.COL, 0, col);
     47                                                                SmedAction.panelMain.panelLit.panelChr.col1Label.setBackground(SeaMark.ColMAP.get(col));
    4848                                                        } else {
    49                                                                 dlg.panelMain.mark.setLightAtt(Att.ALT, 0, col);
    50                                                                 dlg.panelMain.panelLit.panelChr.col2Label.setBackground(SeaMark.ColMAP.get(col));
     49                                                                SmedAction.panelMain.mark.setLightAtt(Att.ALT, 0, col);
     50                                                                SmedAction.panelMain.panelLit.panelChr.col2Label.setBackground(SeaMark.ColMAP.get(col));
    5151                                                        }
    5252                                                } else {
    53                                                         dlg.panelMain.mark.setLightAtt(Att.COL, 0, col);
    54                                                         dlg.panelMain.panelLit.panelChr.col1Label.setBackground(SeaMark.ColMAP.get(col));
    55                                                         dlg.panelMain.panelLit.panelChr.col2Label.setBackground(SeaMark.ColMAP.get(col));
     53                                                        SmedAction.panelMain.mark.setLightAtt(Att.COL, 0, col);
     54                                                        SmedAction.panelMain.panelLit.panelChr.col1Label.setBackground(SeaMark.ColMAP.get(col));
     55                                                        SmedAction.panelMain.panelLit.panelChr.col2Label.setBackground(SeaMark.ColMAP.get(col));
    5656                                                }
    5757                                                button.setBorderPainted(true);
    5858                                        } else {
    5959                                                if (button == delButton) {
    60                                                         dlg.panelMain.mark.subColour(ent, stackIdx);
     60                                                        SmedAction.panelMain.mark.subColour(ent, stackIdx);
    6161                                                } else if (button == addButton) {
    6262                                                        if (stackCol.size() != 0)
    6363                                                                stackIdx++;
    6464                                                        if (stackCol.size() == 0)
    65                                                                 dlg.panelMain.mark.setColour(ent, col);
     65                                                                SmedAction.panelMain.mark.setColour(ent, col);
    6666                                                        else
    67                                                                 switch (dlg.panelMain.mark.getPattern(ent)) {
     67                                                                switch (SmedAction.panelMain.mark.getPattern(ent)) {
    6868                                                                case NOPAT:
    6969                                                                        break;
     
    7171                                                                case CROSS:
    7272                                                                        if (stackCol.size() < 2)
    73                                                                                 dlg.panelMain.mark.addColour(ent, stackIdx, col);
     73                                                                                SmedAction.panelMain.mark.addColour(ent, stackIdx, col);
    7474                                                                        break;
    7575                                                                case SQUARED:
    7676                                                                        if (stackCol.size() < 4)
    77                                                                                 dlg.panelMain.mark.addColour(ent, stackIdx, col);
     77                                                                                SmedAction.panelMain.mark.addColour(ent, stackIdx, col);
    7878                                                                        break;
    7979                                                                default:
    80                                                                         dlg.panelMain.mark.addColour(ent, stackIdx, col);
     80                                                                        SmedAction.panelMain.mark.addColour(ent, stackIdx, col);
    8181                                                                        break;
    8282                                                                }
    8383                                                } else {
    84                                                         dlg.panelMain.mark.setColour(ent, stackIdx, col);
     84                                                        SmedAction.panelMain.mark.setColour(ent, stackIdx, col);
    8585                                                }
    8686                                                syncPanel();
     
    150150                        for (Col col : colours.keySet()) {
    151151                                JRadioButton button = colours.get(col);
    152                                 if (dlg.panelMain.mark.getLightAtt(Att.COL, 0) == col) {
     152                                if (SmedAction.panelMain.mark.getLightAtt(Att.COL, 0) == col) {
    153153                                        button.setBorderPainted(true);
    154154                                } else
     
    157157                } else {
    158158                        int idx;
    159                         for (idx = 0; dlg.panelMain.mark.getColour(ent, idx) != Col.UNKCOL; idx++) {
     159                        for (idx = 0; SmedAction.panelMain.mark.getColour(ent, idx) != Col.UNKCOL; idx++) {
    160160                                if (stackCol.size() <= idx) {
    161161                                        stackCol.add(idx, new JRadioButton(new ImageIcon(getClass().getResource("/images/ColourButton.png"))));
     
    185185                                        JRadioButton btnI = stackCol.get(idx);
    186186                                        btnI.setBounds(2, (2 + (idx * height)), 30, height);
    187                                         btnI.setBackground(SeaMark.ColMAP.get(dlg.panelMain.mark.getColour(ent, idx)));
     187                                        btnI.setBackground(SeaMark.ColMAP.get(SmedAction.panelMain.mark.getColour(ent, idx)));
    188188                                        if (stackIdx == idx) {
    189189                                                btnI.setBorderPainted(true);
Note: See TracChangeset for help on using the changeset viewer.