Changeset 26568 in osm for applications


Ignore:
Timestamp:
2011-08-24T20:04:53+02:00 (13 years ago)
Author:
malcolmh
Message:

save

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

Legend:

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

    r26566 r26568  
    1313
    1414        private OSeaMAction dlg;
    15         private ButtonGroup catButtons = new ButtonGroup();
     15        private ButtonGroup objButtons = new ButtonGroup();
    1616        public JRadioButton houseButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LighthouseButton.png")));
    1717        public JRadioButton majorButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightMajorButton.png")));
     
    2121        public JRadioButton trafficButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TrafficButton.png")));
    2222        public JRadioButton warningButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/WarningButton.png")));
    23         private EnumMap<Cat, JRadioButton> categories = new EnumMap<Cat, JRadioButton>(Cat.class);
    24         private EnumMap<Cat, Obj> objects = new EnumMap<Cat, Obj>(Cat.class);
    25         private ActionListener alCat = new ActionListener() {
     23        private EnumMap<Obj, JRadioButton> objects = new EnumMap<Obj, JRadioButton>(Obj.class);
     24        private ActionListener alObj = new ActionListener() {
    2625                public void actionPerformed(java.awt.event.ActionEvent e) {
    27                         for (Cat cat : categories.keySet()) {
    28                                 JRadioButton button = categories.get(cat);
     26                        for (Obj obj : objects.keySet()) {
     27                                JRadioButton button = objects.get(obj);
    2928                                if (button.isSelected()) {
    30                                         dlg.mark.setCategory(cat);
    31                                         dlg.mark.setObject(objects.get(cat));
     29                                        dlg.mark.setObject(obj);
    3230                                        button.setBorderPainted(true);
    3331                                } else
     
    4038                dlg = dia;
    4139                this.setLayout(null);
    42                 this.add(getCatButton(houseButton, 0, 0, 34, 32, "Lighthouse", Cat.LIGHT_HOUSE, Obj.LNDMRK), null);
    43                 this.add(getCatButton(majorButton, 35, 0, 34, 32, "MajorLight", Cat.LIGHT_MAJOR, Obj.LITMAJ), null);
    44                 this.add(getCatButton(minorButton, 70, 0, 34, 32, "MinorLight", Cat.LIGHT_MINOR, Obj.LITMIN), null);
    45                 this.add(getCatButton(vesselButton, 105, 0, 34, 32, "LightVessel", Cat.LIGHT_VESSEL, Obj.LITVES), null);
    46                 this.add(getCatButton(floatButton, 140, 0, 34, 32, "LightFloat", Cat.LIGHT_FLOAT, Obj.LITFLT), null);
    47                 this.add(getCatButton(trafficButton, 50, 32, 34, 32, "SSTraffic", Cat.SIGNAL_STATION, Obj.SIGSTA), null);
    48                 this.add(getCatButton(warningButton, 125, 32, 34, 32, "SSWarning", Cat.SIGNAL_STATION, Obj.SIGSTA), null);
     40                this.add(getObjButton(houseButton, 0, 0, 34, 32, "Lighthouse", Obj.LNDMRK), null);
     41                this.add(getObjButton(majorButton, 35, 0, 34, 32, "MajorLight", Obj.LITMAJ), null);
     42                this.add(getObjButton(minorButton, 70, 0, 34, 32, "MinorLight", Obj.LITMIN), null);
     43                this.add(getObjButton(vesselButton, 105, 0, 34, 32, "LightVessel", Obj.LITVES), null);
     44                this.add(getObjButton(floatButton, 140, 0, 34, 32, "LightFloat", Obj.LITFLT), null);
     45                this.add(getObjButton(trafficButton, 50, 35, 34, 32, "SSTraffic", Obj.SISTAT), null);
     46                this.add(getObjButton(warningButton, 90, 35, 34, 32, "SSWarning", Obj.SISTAW), null);
    4947        }
    5048
     
    5351        }
    5452
    55         private JRadioButton getCatButton(JRadioButton button, int x, int y, int w, int h, String tip, Cat cat, Obj obj) {
     53        private JRadioButton getObjButton(JRadioButton button, int x, int y, int w, int h, String tip,Obj obj) {
    5654                button.setBounds(new Rectangle(x, y, w, h));
    5755                button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2));
    5856                button.setToolTipText(Messages.getString(tip));
    59                 button.addActionListener(alCat);
    60                 catButtons.add(button);
    61                 categories.put(cat, button);
    62                 objects.put(cat, obj);
     57                button.addActionListener(alObj);
     58                objButtons.add(button);
     59                objects.put(obj, button);
    6360                return button;
    6461        }
  • applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java

    r26561 r26568  
    4747
    4848        public enum Obj {
    49                 UNKNOWN, BCNCAR, BCNISD, BCNLAT, BCNSAW, BCNSPP, BOYCAR, BOYISD, BOYLAT, BOYSAW, BOYSPP, FLTCAR, FLTISD, FLTLAT, FLTSAW, FLTSPP, LITMAJ, LITMIN, LITFLT, LITVES, LNDMRK, MORFAC, SIGSTA
     49                UNKNOWN, BCNCAR, BCNISD, BCNLAT, BCNSAW, BCNSPP, BOYCAR, BOYISD, BOYLAT, BOYSAW, BOYSPP, FLTCAR, FLTISD, FLTLAT, FLTSAW, FLTSPP,
     50                LITMAJ, LITMIN, LITFLT, LITVES, LNDMRK, MORFAC, SISTAW, SISTAT
    5051        }
    5152
     
    7273                ObjSTR.put(Obj.LNDMRK, "landmark");
    7374                ObjSTR.put(Obj.MORFAC, "mooring");
    74                 ObjSTR.put(Obj.SIGSTA, "signal_station_warning");
    75                 ObjSTR.put(Obj.SIGSTA, "signal_station_traffic");
     75                ObjSTR.put(Obj.SISTAW, "signal_station_warning");
     76                ObjSTR.put(Obj.SISTAT, "signal_station_traffic");
    7677        }
    7778
     
    108109                EntMAP.put(Obj.LNDMRK, Ent.LIGHT);
    109110                EntMAP.put(Obj.MORFAC, Ent.MOORING);
    110                 EntMAP.put(Obj.SIGSTA, Ent.STATION);
     111                EntMAP.put(Obj.SISTAW, Ent.STATION);
     112                EntMAP.put(Obj.SISTAT, Ent.STATION);
    111113        }
    112114
     
    134136                GrpMAP.put(Obj.LNDMRK, Grp.LIT);
    135137                GrpMAP.put(Obj.MORFAC, Grp.SPP);
    136                 GrpMAP.put(Obj.SIGSTA, Grp.SIS);
     138                GrpMAP.put(Obj.SISTAW, Grp.SIS);
     139                GrpMAP.put(Obj.SISTAT, Grp.SIS);
    137140        }
    138141
    139142        public enum Cat {
    140                 UNKNOWN, LAT_PORT, LAT_STBD, LAT_PREF_PORT, LAT_PREF_STBD, CARD_NORTH, CARD_EAST, CARD_SOUTH, CARD_WEST, LIGHT_HOUSE, LIGHT_MAJOR, LIGHT_MINOR, LIGHT_VESSEL, LIGHT_FLOAT, MOORING_BUOY, SIGNAL_STATION
     143                UNKNOWN, LAT_PORT, LAT_STBD, LAT_PREF_PORT, LAT_PREF_STBD, CARD_NORTH, CARD_EAST, CARD_SOUTH, CARD_WEST, MOORING_BUOY
    141144        }
    142145
Note: See TracChangeset for help on using the changeset viewer.