Changeset 30298 in osm for applications/editors


Ignore:
Timestamp:
2014-02-19T10:26:43+01:00 (11 years ago)
Author:
malcolmh
Message:

save

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  
    5252
    5353                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");
    5555                out.format("<bounds minlat='%.8f' minlon='%.8f' maxlat='%.8f' maxlon='%.8f'/>%n", bounds.minlat, bounds.minlon, bounds.maxlat, bounds.maxlon);
    5656
  • applications/editors/josm/plugins/smed2/src/messages/Messages.java

    r30285 r30298  
    1414
    1515public class Messages {
    16         private static final String BUNDLE_NAME = "msg.messages";
     16        private static final String BUNDLE_NAME = "resources/msg.messages";
    1717
    1818        private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
  • applications/editors/josm/plugins/smed2/src/panels/PanelMain.java

    r30285 r30298  
    5252                        if (e.getSource() == importButton) {
    5353                                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);
    5555                                int returnVal = ifc.showOpenDialog(Main.parent);
    5656                                if (returnVal == JFileChooser.APPROVE_OPTION) {
     
    6060                                        } catch (IOException e1) {
    6161                                                Smed2Action.panelS57.setVisible(false);
    62                                                 messageBar.setText("IO Exception");
     62                                                setStatus("IO Exception", Color.red);
    6363                                        }
    6464                                } else {
    6565                                        Smed2Action.panelS57.setVisible(false);
    66                                         messageBar.setText("");
     66                                        clrStatus();
    6767                                }
    6868                        }
     
    7676                        if (e.getSource() == exportButton) {
    7777                                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);
    7979        int returnVal = efc.showOpenDialog(Main.parent);
    8080        if (returnVal == JFileChooser.APPROVE_OPTION) {
     
    8383                                        } catch (IOException e1) {
    8484                                                Smed2Action.panelS57.setVisible(false);
    85                                                 messageBar.setText("IO Exception");
     85                                                setStatus("IO Exception", Color.red);
    8686                                        }
    8787         } else {
    8888                                        Smed2Action.panelS57.setVisible(false);
    89                                         messageBar.setText("");
     89                                        clrStatus();
    9090         }
    9191      }
     
    153153                g2.setBackground(new Color(0xb5d0d0));
    154154                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("");
    156166        }
    157167       
  • applications/editors/josm/plugins/smed2/src/panels/PanelS57.java

    r30286 r30298  
    1010package panels;
    1111
     12import java.awt.Color;
    1213import java.awt.Dimension;
    1314import java.io.*;
     
    5152                JFileChooser ifc = new JFileChooser(Main.pref.get("smed2plugin.file"));
    5253                FileInputStream in = new FileInputStream(inf);
    53                 PanelMain.messageBar.setText("Select OSM types file");
     54                PanelMain.setStatus("Select OSM types file", Color.yellow);
    5455                ifc.setCurrentDirectory(inf);
    5556                int returnVal = ifc.showOpenDialog(Main.parent);
     
    6566                MapBounds bounds = S57dec.decodeFile(in, types, map);
    6667
    67                 PanelMain.messageBar.setText("Import done");
    6868                in.close();
    6969               
     
    8585                                                                        node.setOsmId(ref, 1);
    8686                                                                        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);
    9187                                                                        addKeys(node, feature, type);
    9288                                                                        done.add(ref);
     
    195191                Main.map.mapView.addLayer(layer);
    196192                Main.map.mapView.zoomTo(new Bounds(bounds.minlat, bounds.minlon, bounds.maxlat, bounds.maxlon));
     193                PanelMain.setStatus("Import done", Color.green);
    197194        }
    198195
     
    203200                }
    204201                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                }
    205208                for (Map.Entry<Att, AttVal<?>> item : feature.atts.entrySet()) {
    206209                        String attstr = S57att.stringAttribute(item.getKey());
  • applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java

    r30285 r30298  
    191191                                } else {
    192192                                        showFrame.setVisible(false);
    193                                         PanelMain.messageBar.setText(tr("Select only one object"));
     193                                        PanelMain.setStatus(tr("Select only one object"), Color.orange);
    194194                                }
    195195                        }
     
    198198                                panelMain.clearMark();
    199199                                showFrame.setVisible(false);
    200                                 PanelMain.messageBar.setText(tr("Select a map object"));
     200                                PanelMain.setStatus(tr("Select a map object"), Color.yellow);
    201201                        }
    202202                }
Note: See TracChangeset for help on using the changeset viewer.