Changeset 30298 in osm for applications/editors
- Timestamp:
- 2014-02-19T10:26:43+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/smed2
- Files:
-
- 1 deleted
- 5 edited
- 4 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/js57toosm/src/js57toosm/Js57toosm.java
r30285 r30298 52 52 53 53 out.format("<?xml version='1.0' encoding='UTF-8'?>%n"); 54 out.format("<osm version='0.6' generator='js57toosm'>%n");54 out.format("<osm version='0.6' upload='false' generator='js57toosm'>%n"); 55 55 out.format("<bounds minlat='%.8f' minlon='%.8f' maxlat='%.8f' maxlon='%.8f'/>%n", bounds.minlat, bounds.minlon, bounds.maxlat, bounds.maxlon); 56 56 -
applications/editors/josm/plugins/smed2/src/messages/Messages.java
r30285 r30298 14 14 15 15 public class Messages { 16 private static final String BUNDLE_NAME = " msg.messages";16 private static final String BUNDLE_NAME = "resources/msg.messages"; 17 17 18 18 private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME); -
applications/editors/josm/plugins/smed2/src/panels/PanelMain.java
r30285 r30298 52 52 if (e.getSource() == importButton) { 53 53 Smed2Action.panelS57.setVisible(true); 54 messageBar.setText("Select S-57 ENC file for import");54 setStatus("Select S-57 ENC file for import", Color.yellow); 55 55 int returnVal = ifc.showOpenDialog(Main.parent); 56 56 if (returnVal == JFileChooser.APPROVE_OPTION) { … … 60 60 } catch (IOException e1) { 61 61 Smed2Action.panelS57.setVisible(false); 62 messageBar.setText("IO Exception");62 setStatus("IO Exception", Color.red); 63 63 } 64 64 } else { 65 65 Smed2Action.panelS57.setVisible(false); 66 messageBar.setText("");66 clrStatus(); 67 67 } 68 68 } … … 76 76 if (e.getSource() == exportButton) { 77 77 Smed2Action.panelS57.setVisible(true); 78 messageBar.setText("Select S-57 ENC file for export");78 setStatus("Select S-57 ENC file for export", Color.yellow); 79 79 int returnVal = efc.showOpenDialog(Main.parent); 80 80 if (returnVal == JFileChooser.APPROVE_OPTION) { … … 83 83 } catch (IOException e1) { 84 84 Smed2Action.panelS57.setVisible(false); 85 messageBar.setText("IO Exception");85 setStatus("IO Exception", Color.red); 86 86 } 87 87 } else { 88 88 Smed2Action.panelS57.setVisible(false); 89 messageBar.setText("");89 clrStatus(); 90 90 } 91 91 } … … 153 153 g2.setBackground(new Color(0xb5d0d0)); 154 154 if (img != null) g2.clearRect(0, 0, img.getWidth(), img.getHeight()); 155 g2.drawImage(img, 0, 0, null);; 155 g2.drawImage(img, 0, 0, null); 156 } 157 158 public static void setStatus(String text, Color bg) { 159 messageBar.setBackground(bg); 160 messageBar.setText(text); 161 } 162 163 public static void clrStatus() { 164 messageBar.setBackground(Color.white); 165 messageBar.setText(""); 156 166 } 157 167 -
applications/editors/josm/plugins/smed2/src/panels/PanelS57.java
r30286 r30298 10 10 package panels; 11 11 12 import java.awt.Color; 12 13 import java.awt.Dimension; 13 14 import java.io.*; … … 51 52 JFileChooser ifc = new JFileChooser(Main.pref.get("smed2plugin.file")); 52 53 FileInputStream in = new FileInputStream(inf); 53 PanelMain. messageBar.setText("Select OSM types file");54 PanelMain.setStatus("Select OSM types file", Color.yellow); 54 55 ifc.setCurrentDirectory(inf); 55 56 int returnVal = ifc.showOpenDialog(Main.parent); … … 65 66 MapBounds bounds = S57dec.decodeFile(in, types, map); 66 67 67 PanelMain.messageBar.setText("Import done");68 68 in.close(); 69 69 … … 85 85 node.setOsmId(ref, 1); 86 86 data.addPrimitive(node); 87 // out.format(" <node id='%d' lat='%.8f' lon='%.8f' version='1'>%n", -ref, Math.toDegrees(node.lat), Math.toDegrees(node.lon));88 // out.format(" <tag k='seamark:type' v=\"%s\"/>%n", type);89 // if ((feature.type == Obj.SOUNDG) && (node.flg == S57map.Nflag.DPTH))90 // out.format(" <tag k='seamark:sounding:depth' v='%.1f'/>%n", ((Dnode) node).val);91 87 addKeys(node, feature, type); 92 88 done.add(ref); … … 195 191 Main.map.mapView.addLayer(layer); 196 192 Main.map.mapView.zoomTo(new Bounds(bounds.minlat, bounds.minlon, bounds.maxlat, bounds.maxlon)); 193 PanelMain.setStatus("Import done", Color.green); 197 194 } 198 195 … … 203 200 } 204 201 keys.put("seamark:type", type); 202 if (feature.type == Obj.SOUNDG) { 203 Snode snode = map.nodes.get(feature.geom.elems.get(0).id); 204 if (snode.flg == S57map.Nflag.DPTH) { 205 keys.put("seamark:sounding:depth", ((Double)((Dnode)snode).val).toString()); 206 } 207 } 205 208 for (Map.Entry<Att, AttVal<?>> item : feature.atts.entrySet()) { 206 209 String attstr = S57att.stringAttribute(item.getKey()); -
applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java
r30285 r30298 191 191 } else { 192 192 showFrame.setVisible(false); 193 PanelMain. messageBar.setText(tr("Select only one object"));193 PanelMain.setStatus(tr("Select only one object"), Color.orange); 194 194 } 195 195 } … … 198 198 panelMain.clearMark(); 199 199 showFrame.setVisible(false); 200 PanelMain. messageBar.setText(tr("Select a map object"));200 PanelMain.setStatus(tr("Select a map object"), Color.yellow); 201 201 } 202 202 }
Note:
See TracChangeset
for help on using the changeset viewer.