Changeset 26568 in osm for applications/editors/josm/plugins/smed
- Timestamp:
- 2011-08-24T20:04:53+02:00 (13 years ago)
- 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 13 13 14 14 private OSeaMAction dlg; 15 private ButtonGroup catButtons = new ButtonGroup();15 private ButtonGroup objButtons = new ButtonGroup(); 16 16 public JRadioButton houseButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LighthouseButton.png"))); 17 17 public JRadioButton majorButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/LightMajorButton.png"))); … … 21 21 public JRadioButton trafficButton = new JRadioButton(new ImageIcon(getClass().getResource("/images/TrafficButton.png"))); 22 22 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() { 26 25 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); 29 28 if (button.isSelected()) { 30 dlg.mark.setCategory(cat); 31 dlg.mark.setObject(objects.get(cat)); 29 dlg.mark.setObject(obj); 32 30 button.setBorderPainted(true); 33 31 } else … … 40 38 dlg = dia; 41 39 this.setLayout(null); 42 this.add(get CatButton(houseButton, 0, 0, 34, 32, "Lighthouse", Cat.LIGHT_HOUSE, Obj.LNDMRK), null);43 this.add(get CatButton(majorButton, 35, 0, 34, 32, "MajorLight", Cat.LIGHT_MAJOR, Obj.LITMAJ), null);44 this.add(get CatButton(minorButton, 70, 0, 34, 32, "MinorLight", Cat.LIGHT_MINOR, Obj.LITMIN), null);45 this.add(get CatButton(vesselButton, 105, 0, 34, 32, "LightVessel", Cat.LIGHT_VESSEL, Obj.LITVES), null);46 this.add(get CatButton(floatButton, 140, 0, 34, 32, "LightFloat", Cat.LIGHT_FLOAT, Obj.LITFLT), null);47 this.add(get CatButton(trafficButton, 50, 32, 34, 32, "SSTraffic", Cat.SIGNAL_STATION, Obj.SIGSTA), null);48 this.add(get CatButton(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); 49 47 } 50 48 … … 53 51 } 54 52 55 private JRadioButton get CatButton(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) { 56 54 button.setBounds(new Rectangle(x, y, w, h)); 57 55 button.setBorder(BorderFactory.createLineBorder(Color.magenta, 2)); 58 56 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); 63 60 return button; 64 61 } -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r26561 r26568 47 47 48 48 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 50 51 } 51 52 … … 72 73 ObjSTR.put(Obj.LNDMRK, "landmark"); 73 74 ObjSTR.put(Obj.MORFAC, "mooring"); 74 ObjSTR.put(Obj.SI GSTA, "signal_station_warning");75 ObjSTR.put(Obj.SI GSTA, "signal_station_traffic");75 ObjSTR.put(Obj.SISTAW, "signal_station_warning"); 76 ObjSTR.put(Obj.SISTAT, "signal_station_traffic"); 76 77 } 77 78 … … 108 109 EntMAP.put(Obj.LNDMRK, Ent.LIGHT); 109 110 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); 111 113 } 112 114 … … 134 136 GrpMAP.put(Obj.LNDMRK, Grp.LIT); 135 137 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); 137 140 } 138 141 139 142 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_STATION143 UNKNOWN, LAT_PORT, LAT_STBD, LAT_PREF_PORT, LAT_PREF_STBD, CARD_NORTH, CARD_EAST, CARD_SOUTH, CARD_WEST, MOORING_BUOY 141 144 } 142 145
Note:
See TracChangeset
for help on using the changeset viewer.