Changeset 38 in josm for src/org/openstreetmap/josm/gui


Ignore:
Timestamp:
2006-01-02T21:57:25+01:00 (18 years ago)
Author:
imi
Message:

Added support for CSV import (well, CSV without "" specification)

Location:
src/org/openstreetmap/josm/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/org/openstreetmap/josm/gui/PreferenceDialog.java

    r33 r38  
    5959                        if (Main.pref.osmDataPassword == "")
    6060                                Main.pref.osmDataPassword = null;
     61                        Main.pref.csvImportString = csvImportString.getText();
    6162                        Main.pref.setDrawRawGpsLines(drawRawGpsLines.isSelected());
    6263                        Main.pref.setForceRawGpsLines(forceRawGpsLines.isSelected());
     
    116117         */
    117118        JPasswordField osmDataPassword = new JPasswordField(20);
     119        /**
     120         * Comma seperated import string specifier or <code>null</code> if the first
     121         * data line should be interpreted as one.
     122         */
     123        JTextField csvImportString = new JTextField(20);
    118124        /**
    119125         * The checkbox stating whether nodes should be merged together.
     
    188194                osmDataUsername.setToolTipText("Login name (email) to the OSM account.");
    189195                osmDataPassword.setToolTipText("Login password to the OSM account. Leave blank to not store any password.");
     196                csvImportString.setToolTipText("<html>Import string specification. Currently, only lat/lon pairs are imported.<br>" +
     197                                "<b>lat</b>: The latitude coordinate<br>" +
     198                                "<b>lon</b>: The longitude coordinate<br>" +
     199                                "<b>ignore</b>: Skip this field<br>" +
     200                                "An example: \"ignore ignore lat lon\" will use ' ' as delimiter, skip the first two values and read then lat/lon.<br>" +
     201                                "Other example: \"lat,lon\" will just read lat/lon values comma seperated.</html>");
    190202                drawRawGpsLines.setToolTipText("If your gps device draw to few lines, select this to draw lines along your track.");
    191203                drawRawGpsLines.setSelected(Main.pref.isDrawRawGpsLines());
     
    197209                osmDataUsername.setText(Main.pref.osmDataUsername);
    198210                osmDataPassword.setText(Main.pref.osmDataPassword);
     211                csvImportString.setText(Main.pref.csvImportString);
    199212
    200213                // Display tab
     
    221234                warning.setFont(warning.getFont().deriveFont(Font.ITALIC));
    222235                con.add(warning, GBC.eop().fill(GBC.HORIZONTAL));
    223 
     236                con.add(new JLabel("CSV import specification (empty: read from first line in data)"), GBC.eol());
     237                con.add(csvImportString, GBC.eop().fill(GBC.HORIZONTAL));
    224238               
    225239                // Map tab
  • src/org/openstreetmap/josm/gui/layer/RawGpsDataLayer.java

    r23 r38  
    4242                                }
    4343                                if (evt.getPropertyName().equals("drawRawGpsLines") ||
    44                                                 evt.getPropertyName().equals("drawRawGpsLines"))
     44                                                evt.getPropertyName().equals("forceRawGpsLines"))
    4545                                        Main.main.getMapFrame().repaint();
    4646                        }
     
    6767                        for (GeoPoint p : c) {
    6868                                Point screen = mv.getScreenPoint(p);
    69                                 if (Main.pref.isDrawRawGpsLines() && old != null) {
     69                                if (Main.pref.isDrawRawGpsLines() && old != null)
    7070                                        g.drawLine(old.x, old.y, screen.x, screen.y);
    71                                 } else {
     71                                else
    7272                                        g.drawRect(screen.x, screen.y, 0, 0);
    73                                         old = screen;
    74                                 }
     73                                old = screen;
    7574                        }
    7675                }
Note: See TracChangeset for help on using the changeset viewer.