Changeset 27413 in osm for applications
- Timestamp:
- 2012-01-07T21:37:14+01:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/smed/plugs/oseam/src
- Files:
-
- 4 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/msg/messages.properties
r27405 r27413 290 290 NCCB=NCCB 291 291 292 Dolphin=Dolphin 293 DevDolphin=Deviation Dolphin 294 Bollard=Bollard 295 Wall=Tie-up Wall 296 Post=Post/Pile 297 Chain=Chain/Cable 298 Rope=Shore Ropes 299 Automatic=Automatic 300 MooringBuoy=Mooring Buoy 301 CALM=CALM Buoy 302 SBM=SBM Buoy 303 292 304 NotDecimal=Not a valid decimal string 293 305 TooBig=Maximum value exceeded -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/msg/messages_de.properties
r27391 r27413 290 290 NCCB=NCCB 291 291 292 Dolphin=Dolphin 293 DevDolphin=Deviation Dolphin 294 Bollard=Bollard 295 Wall=Tie-up Wall 296 Post=Post/Pile 297 Chain=Chain/Cable 298 Rope=Shore Ropes 299 Automatic=Automatic 300 MooringBuoy=Mooring Buoy 301 CALM=CALM Buoy 302 SBM=SBM Buoy 303 292 304 NotDecimal=Kein korrekter Dezimalwert 293 305 TooBig=Maximaler Wert überschritten -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/msg/messages_en.properties
r27405 r27413 290 290 NCCB=NCCB 291 291 292 Dolphin=Dolphin 293 DevDolphin=Deviation Dolphin 294 Bollard=Bollard 295 Wall=Tie-up Wall 296 Post=Post/Pile 297 Chain=Chain/Cable 298 Rope=Shore Ropes 299 Automatic=Automatic 300 MooringBuoy=Mooring Buoy 301 CALM=CALM Buoy 302 SBM=SBM Buoy 303 292 304 NotDecimal=Not a valid decimal string 293 305 TooBig=Maximum value exceeded -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelMain.java
r27389 r27413 312 312 case PLF: 313 313 lightsButton.setBorderPainted(true); 314 topButton.setEnabled(false);315 314 panelLights.setVisible(true); 316 315 panelLights.syncPanel(); -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/panels/PanelSpec.java
r27230 r27413 10 10 import oseam.Messages; 11 11 import oseam.dialogs.OSeaMAction; 12 import oseam.seamarks.SeaMark; 12 13 import oseam.seamarks.SeaMark.*; 13 14 … … 24 25 if (dlg.node != null && (idx == categoryBox.getSelectedIndex())) 25 26 dlg.panelMain.mark.setCategory(cat); 27 } 28 } 29 }; 30 public JComboBox mooringBox; 31 public EnumMap<Cat, Integer> moorings = new EnumMap<Cat, Integer>(Cat.class); 32 private ActionListener alMooringBox = new ActionListener() { 33 public void actionPerformed(java.awt.event.ActionEvent e) { 34 for (Cat cat : moorings.keySet()) { 35 int idx = moorings.get(cat); 36 if (dlg.node != null && (idx == mooringBox.getSelectedIndex())) { 37 dlg.panelMain.mark.setCategory(cat); 38 if ((cat == Cat.INB_CALM) || (cat == Cat.INB_SBM)) { 39 dlg.panelMain.mark.setObject(Obj.BOYINB); 40 } else { 41 dlg.panelMain.mark.setObject(Obj.MORFAC); 42 } 43 } 26 44 } 27 45 } … … 82 100 } 83 101 }; 102 public JToggleButton mooringButton = new JToggleButton(new ImageIcon(getClass().getResource("/images/MooringButton.png"))); 103 private ActionListener alMooring = new ActionListener() { 104 public void actionPerformed(java.awt.event.ActionEvent e) { 105 dlg.panelMain.mark.setObject(Obj.UNKOBJ); 106 dlg.panelMain.mark.setCategory(Cat.NOCAT); 107 syncPanel(); 108 if (mooringButton.isSelected()) { 109 categoryBox.setVisible(false); 110 mooringBox.setVisible(true); 111 mooringButton.setBorderPainted(true); 112 } else { 113 mooringBox.setVisible(false); 114 categoryBox.setVisible(true); 115 mooringButton.setBorderPainted(false); 116 } 117 } 118 }; 84 119 85 120 public PanelSpec(OSeaMAction dia) { … … 105 140 categoryBox.setBounds(new Rectangle(5, 120, 160, 20)); 106 141 add(categoryBox); 142 categoryBox.setVisible(true); 107 143 categoryBox.addActionListener(alCategoryBox); 108 144 addCatItem("", Cat.NOCAT); … … 124 160 addCatItem(Messages.getString("FerryCross"), Cat.SPM_FRRY); 125 161 addCatItem(Messages.getString("Anchorage"), Cat.SPM_ANCH); 162 mooringBox = new JComboBox(); 163 mooringBox.setBounds(new Rectangle(5, 120, 160, 20)); 164 add(mooringBox); 165 mooringBox.setVisible(false); 166 mooringBox.addActionListener(alMooringBox); 167 addMorItem("", Cat.NOCAT); 168 addMorItem(Messages.getString("Dolphin"), Cat.MOR_DLPN); 169 addMorItem(Messages.getString("DevDolphin"), Cat.MOR_DDPN); 170 addMorItem(Messages.getString("Bollard"), Cat.MOR_BLRD); 171 addMorItem(Messages.getString("Wall"), Cat.MOR_WALL); 172 addMorItem(Messages.getString("Post"), Cat.MOR_POST); 173 addMorItem(Messages.getString("Chain"), Cat.MOR_CHWR); 174 addMorItem(Messages.getString("Rope"), Cat.MOR_ROPE); 175 addMorItem(Messages.getString("Automatic"), Cat.MOR_AUTO); 176 addMorItem(Messages.getString("MooringBuoy"), Cat.MOR_BUOY); 177 addMorItem(Messages.getString("CALM"), Cat.INB_CALM); 178 addMorItem(Messages.getString("SBM"), Cat.INB_SBM); 126 179 127 180 topmarkButton.setBounds(new Rectangle(136, 0, 34, 32)); 181 topmarkButton.setToolTipText(Messages.getString("Topmark")); 128 182 topmarkButton.setBorder(BorderFactory.createLoweredBevelBorder()); 129 183 topmarkButton.addActionListener(alTop); 130 184 add(topmarkButton); 185 186 mooringButton.setBounds(new Rectangle(136, 64, 34, 32)); 187 mooringButton.setToolTipText(Messages.getString("Mooring")); 188 mooringButton.setBorder(BorderFactory.createLoweredBevelBorder()); 189 mooringButton.addActionListener(alMooring); 190 add(mooringButton); 131 191 } 132 192 133 193 public void syncPanel() { 194 if (SeaMark.EntMAP.get(dlg.panelMain.mark.getObject()) == Ent.MOORING) { 195 mooringButton.setBorderPainted(true); 196 categoryBox.setVisible(false); 197 mooringBox.setVisible(true); 198 for (Cat cat : moorings.keySet()) { 199 int item = moorings.get(cat); 200 if (dlg.panelMain.mark.getCategory() == cat) 201 mooringBox.setSelectedIndex(item); 202 } 203 } else { 204 mooringButton.setBorderPainted(false); 205 mooringBox.setVisible(false); 206 categoryBox.setVisible(true); 207 for (Cat cat : categories.keySet()) { 208 int item = categories.get(cat); 209 if (dlg.panelMain.mark.getCategory() == cat) 210 categoryBox.setSelectedIndex(item); 211 } 212 } 134 213 for (Shp shp : shapes.keySet()) { 135 214 JRadioButton button = shapes.get(shp); … … 139 218 button.setBorderPainted(false); 140 219 } 141 for (Cat cat : categories.keySet()) {142 int item = categories.get(cat);143 if (dlg.panelMain.mark.getCategory() == cat)144 categoryBox.setSelectedIndex(item);145 }146 220 topmarkButton.setBorderPainted(dlg.panelMain.mark.getTopmark() != Top.NOTOP); 147 221 topmarkButton.setSelected(dlg.panelMain.mark.getTopmark() != Top.NOTOP); … … 152 226 categories.put(cat, categoryBox.getItemCount()); 153 227 categoryBox.addItem(str); 228 } 229 230 private void addMorItem(String str, Cat cat) { 231 moorings.put(cat, mooringBox.getItemCount()); 232 mooringBox.addItem(str); 154 233 } 155 234 -
applications/editors/josm/plugins/smed/plugs/oseam/src/oseam/seamarks/SeaMark.java
r27405 r27413 65 65 FLTCAR, FLTISD, FLTLAT, FLTSAW, FLTSPP, 66 66 LITMAJ, LITMIN, LITFLT, LITVES, LITHSE, LNDMRK, 67 MORFAC, SISTAW, SISTAT, OFSPLF67 MORFAC, BOYINB, SISTAW, SISTAT, OFSPLF 68 68 } 69 69 … … 92 92 ObjSTR.put(Obj.LITHSE, "landmark"); 93 93 ObjSTR.put(Obj.MORFAC, "mooring"); 94 ObjSTR.put(Obj.BOYINB, "buoy_installation"); 94 95 ObjSTR.put(Obj.OFSPLF, "platform"); 95 96 ObjSTR.put(Obj.SISTAW, "signal_station_warning"); … … 157 158 EntMAP.put(Obj.LNDMRK, Ent.LIGHT); 158 159 EntMAP.put(Obj.MORFAC, Ent.MOORING); 160 EntMAP.put(Obj.BOYINB, Ent.MOORING); 159 161 EntMAP.put(Obj.OFSPLF, Ent.PLATFORM); 160 162 EntMAP.put(Obj.SISTAW, Ent.STATION); … … 191 193 GrpMAP.put(Obj.LNDMRK, Grp.LGT); 192 194 GrpMAP.put(Obj.MORFAC, Grp.SPP); 195 GrpMAP.put(Obj.BOYINB, Grp.SPP); 193 196 GrpMAP.put(Obj.OFSPLF, Grp.PLF); 194 197 GrpMAP.put(Obj.SISTAW, Grp.SIS); … … 201 204 SPM_UNKN, SPM_WARN, SPM_CHBF, SPM_YCHT, SPM_CABL, SPM_OFAL, SPM_ODAS, SPM_RECN, SPM_MOOR, SPM_LNBY, 202 205 SPM_LDNG, SPM_NOTC, SPM_TSS, SPM_FOUL, SPM_DIVE, SPM_FRRY, SPM_ANCH, 203 MOR_DLPN, MOR_DDPN, MOR_BLRD, MOR_WALL, MOR_POST, MOR_CHWR, MOR_ BUOY,206 MOR_DLPN, MOR_DDPN, MOR_BLRD, MOR_WALL, MOR_POST, MOR_CHWR, MOR_ROPE, MOR_AUTO, MOR_BUOY, INB_CALM, INB_SBM, 204 207 SIS_PTCL, SIS_PTED, SIS_IPT, SIS_BRTH, SIS_DOCK, SIS_LOCK, SIS_FBAR, SIS_BRDG, SIS_DRDG, SIS_TRFC, 205 208 SIS_DNGR, SIS_OBST, SIS_CABL, SIS_MILY, SIS_DSTR, SIS_WTHR, SIS_STRM, SIS_ICE, SIS_TIME, SIS_TIDE, … … 243 246 CatSTR.put(Cat.MOR_POST, "post"); 244 247 CatSTR.put(Cat.MOR_CHWR, "chain"); 248 CatSTR.put(Cat.MOR_ROPE, "shore_rope"); 249 CatSTR.put(Cat.MOR_AUTO, "automatic"); 245 250 CatSTR.put(Cat.MOR_BUOY, "buoy"); 251 CatSTR.put(Cat.INB_CALM, "calm"); 252 CatSTR.put(Cat.INB_SBM, "sbm"); 246 253 CatSTR.put(Cat.SIS_PTCL, "control"); 247 254 CatSTR.put(Cat.SIS_PTED, "entry"); … … 1143 1150 dlg.panelMain.moreButton.setVisible(true); 1144 1151 dlg.panelMain.saveButton.setEnabled(true); 1145 Ent ent = EntMAP.get(getObject()); 1146 dlg.panelMain.topButton.setEnabled((ent == Ent.BUOY) 1147 || (ent == Ent.BEACON) || (ent == Ent.LFLOAT)); 1152 dlg.panelMain.topButton.setEnabled(true); 1148 1153 dlg.panelMain.fogButton.setEnabled(true); 1149 1154 dlg.panelMain.radButton.setEnabled(true);
Note:
See TracChangeset
for help on using the changeset viewer.