Ignore:
Timestamp:
2011-09-28T14:18:15+02:00 (13 years ago)
Author:
malcolmh
Message:

save

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelCol.java

    r26713 r26720  
    4343                                                dlg.mark.setColour(ent, col);
    4444                                                if (ent != Ent.LIGHT) {
    45                                                         stackCol.get(stackIdx).setBackground(dlg.mark.ColMAP.get(dlg.mark.getColour(ent, stackIdx)));
     45                                                        if (button == offButton) {
     46                                                                stack.remove(stackCol.get(stackIdx));
     47                                                                stackCol.remove(stackIdx);
     48                                                        } else if (button == addButton) {
     49                                                                stackCol.add(stackIdx, new JRadioButton());
     50                                                                stackCol.get(stackIdx).setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
     51                                                                stack.add(stackCol.get(stackIdx));
     52                                                        }
     53                                                        for (int i = 0; stackCol.size() > i; i++) {
     54                                                                stackCol.get(i).setBounds(37, (89 + (i * (60 / stackCol.size()))), 30, (60 / stackCol.size()));
     55                                                                stackCol.get(i).setBackground(dlg.mark.ColMAP.get(dlg.mark.getColour(ent, i)));
     56                                                        }
    4657                                                }
    4758                                        }
     
    95106                        stack.setBounds(37, 89, 30, 60);
    96107                        this.add(stack);
    97                         Col col;
    98                         for (int i = 0; (col = dlg.mark.getColour(ent, i)) != Col.UNKNOWN; i++) {
    99                                 stackCol.add(new JRadioButton());
     108                        if (dlg.mark != null) {
     109                                for (int i = 0; dlg.mark.getColour(ent, i) != Col.UNKNOWN; i++) {
     110                                        stackCol.add(new JRadioButton());
     111                                }
    100112                        }
    101 
    102113                }
    103114        }
Note: See TracChangeset for help on using the changeset viewer.