Ignore:
Timestamp:
2011-09-27T21:23:20+02:00 (13 years ago)
Author:
malcolmh
Message:

save

Location:
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam
Files:
3 edited

Legend:

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

    r26631 r26713  
    66import java.awt.event.*;
    77import javax.swing.*;
     8
    89import java.util.*;
    910
     
    4142                                        if (dlg.mark != null) {
    4243                                                dlg.mark.setColour(ent, col);
    43                                                 // act.actionPerformed(null);
     44                                                if (ent != Ent.LIGHT) {
     45                                                        stackCol.get(stackIdx).setBackground(dlg.mark.ColMAP.get(dlg.mark.getColour(ent, stackIdx)));
     46                                                }
    4447                                        }
     48                                        button.setBorderPainted(true);
     49                                } else
     50                                        button.setBorderPainted(false);
     51                        }
     52                }
     53        };
     54        private JPanel stack;
     55        private ButtonGroup stackColours = new ButtonGroup();
     56        private ArrayList<JRadioButton> stackCol = new ArrayList<JRadioButton>();
     57        private int stackIdx = 0;
     58        private ActionListener alStack = new ActionListener() {
     59                public void actionPerformed(java.awt.event.ActionEvent e) {
     60                        for (int i = 0; stackCol.size() > i; i++) {
     61                                JRadioButton button = stackCol.get(i);
     62                                if (button.isSelected()) {
     63                                        stackIdx = i;
    4564                                        button.setBorderPainted(true);
    4665                                } else
     
    7190                        this.add(getColButton(magentaButton, 35, 48, 34, 16, Messages.getString("Magenta"), Col.MAGENTA), null);
    7291                        this.add(getColButton(pinkButton, 35, 64, 34, 16, Messages.getString("Pink"), Col.PINK), null);
     92
     93                        stack = new JPanel();
     94                        stack.setBorder(BorderFactory.createLineBorder(Color.black));
     95                        stack.setBounds(37, 89, 30, 60);
     96                        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());
     100                        }
     101
    73102                }
    74103        }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelPat.java

    r26632 r26713  
    5353                this.add(getPatButton(squareButton, 72, 104, 27, 27, "SquarePat", Pat.SQUARE), null);
    5454                this.add(getPatButton(borderButton, 72, 130, 27, 27, "BorderPat", Pat.BORDER), null);
    55 
     55               
    5656        }
    5757
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java

    r26590 r26713  
    33import java.awt.*;
    44import java.awt.event.*;
     5import java.awt.Color.*;
    56import javax.swing.*;
    67import java.util.*;
     
    259260        }
    260261
     262        public static final EnumMap<Col, Color> ColMAP = new EnumMap<Col, Color>(Col.class);
     263        static {
     264                ColMAP.put(Col.WHITE, Color.WHITE);
     265                ColMAP.put(Col.RED, Color.RED);
     266                ColMAP.put(Col.ORANGE, Color.ORANGE);
     267                ColMAP.put(Col.AMBER, new Color(0xffbf00f));
     268                ColMAP.put(Col.YELLOW, Color.YELLOW);
     269                ColMAP.put(Col.GREEN, Color.GREEN);
     270                ColMAP.put(Col.BLUE, Color.BLUE);
     271                ColMAP.put(Col.VIOLET, new Color(0x8f00ff));
     272                ColMAP.put(Col.BLACK, Color.BLACK);
     273                ColMAP.put(Col.GREY, Color.GRAY);
     274                ColMAP.put(Col.BROWN, new Color(0xa45a58));
     275                ColMAP.put(Col.MAGENTA, Color.MAGENTA);
     276                ColMAP.put(Col.PINK, Color.PINK);
     277        }
     278
    261279        public static final EnumMap<Col, String> ColSTR = new EnumMap<Col, String>(Col.class);
    262280        static {
Note: See TracChangeset for help on using the changeset viewer.