Changeset 5979 in osm for applications/editors/josm/plugins/lakewalker
- Timestamp:
- 2007-12-09T13:41:19+01:00 (17 years ago)
- Location:
- applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/BooleanConfigurer.java
r4209 r5979 2 2 * $Id: BooleanConfigurer.java 705 2005-09-15 13:24:50 +0000 (Thu, 15 Sep 2005) rodneykinney $ 3 3 * 4 * Copyright (c) 2000-200 3 by Rodney Kinney4 * Copyright (c) 2000-2007 by Rodney Kinney, Brent Easton 5 5 * 6 6 * This library is free software; you can redistribute it and/or -
applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/Configurer.java
r4095 r5979 2 2 * $Id: Configurer.java 2175 2007-06-04 04:19:59 +0000 (Mon, 04 Jun 2007) rodneykinney $ 3 3 * 4 * Copyright (c) 2000-200 3 by Rodney Kinney4 * Copyright (c) 2000-2007 by Rodney Kinney, Brent Easton 5 5 * 6 6 * This library is free software; you can redistribute it and/or -
applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/DoubleConfigurer.java
r4209 r5979 2 2 * $Id: DoubleConfigurer.java 5 2003-10-02 15:11:38 +0000 (Thu, 02 Oct 2003) rodneykinney $ 3 3 * 4 * Copyright (c) 2000-200 3 by Rodney Kinney4 * Copyright (c) 2000-2007 by Rodney Kinney, Brent Easton 5 5 * 6 6 * This library is free software; you can redistribute it and/or -
applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/IntConfigurer.java
r4095 r5979 2 2 * $Id: IntConfigurer.java 874 2006-03-15 14:20:56 +0000 (Wed, 15 Mar 2006) rodneykinney $ 3 3 * 4 * Copyright (c) 2000-200 3 by Rodney Kinney4 * Copyright (c) 2000-2007 by Rodney Kinney, Brent Easton 5 5 * 6 6 * This library is free software; you can redistribute it and/or -
applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerAction.java
r4209 r5979 12 12 import java.io.File; 13 13 import java.io.InputStreamReader; 14 import java.nio.channels.ClosedByInterruptException;15 14 import java.util.ArrayList; 16 import java.util.Collection;17 import java.util.LinkedList;18 15 import java.util.List; 19 16 20 17 import javax.swing.JOptionPane; 21 import javax.swing.ProgressMonitor;22 18 23 19 import org.openstreetmap.josm.Main; 24 20 import org.openstreetmap.josm.actions.JosmAction; 25 import org.openstreetmap.josm.command.AddCommand;26 import org.openstreetmap.josm.command.Command;27 import org.openstreetmap.josm.command.SequenceCommand;28 21 import org.openstreetmap.josm.data.coor.LatLon; 29 22 import org.openstreetmap.josm.data.osm.Node; 30 23 import org.openstreetmap.josm.data.osm.OsmPrimitive; 31 import org.openstreetmap.josm.data.osm.Segment;32 import org.openstreetmap.josm.data.osm.Way;33 24 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 34 25 import org.openstreetmap.josm.tools.ImageProvider; … … 109 100 target += " --landsat-res=" + Main.pref.get(LakewalkerPreferences.PREF_LANDSAT_RES, "4000"); 110 101 target += " --tilesize=" + Main.pref.get(LakewalkerPreferences.PREF_LANDSAT_SIZE, "2000"); 102 target += " --startdir=" + Main.pref.get(LakewalkerPreferences.PREF_START_DIR, "east"); 111 103 target += " --josm"; 112 104 -
applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerPlugin.java
r4095 r5979 17 17 public class LakewalkerPlugin extends Plugin { 18 18 19 public static final String VERSION = "0. 3";19 public static final String VERSION = "0.4"; 20 20 21 21 protected String name; -
applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerPreferences.java
r4209 r5979 13 13 public class LakewalkerPreferences implements PreferenceSetting { 14 14 15 public static final String[] DIRECTIONS = new String[] {"east", "northeast", "north", "northwest", "west", "southwest", "south", "southeast"}; 16 15 17 public static final String PREF_PYTHON = "lakewalker.python"; 16 18 public static final String PREF_MAX_SEG = "lakewalker.max_segs_in_way"; … … 22 24 public static final String PREF_EAST_OFFSET = "lakewalker.east_offset"; 23 25 public static final String PREF_NORTH_OFFSET = "lakewalker.north_offset"; 24 26 public static final String PREF_START_DIR = "lakewalker.startdir"; 27 25 28 protected StringConfigurer pythonConfig = new StringConfigurer(); 26 29 protected JLabel pythonLabel = new JLabel(tr("Python executable")); … … 41 44 protected DoubleConfigurer northOffsetConfig = new DoubleConfigurer(); 42 45 protected JLabel northOffsetLabel = new JLabel(tr("Shift all traces to north (degrees)")); 46 protected StringEnumConfigurer startDirConfig = new StringEnumConfigurer(DIRECTIONS); 47 protected JLabel startDirLabel = new JLabel(tr("Direction to search for land")); 43 48 44 49 public void addGui(PreferenceDialog gui) { … … 52 57 eastOffsetConfig.setToolTipText(tr("Offset all points in East direction (degrees). Default 0.")); 53 58 northOffsetConfig.setToolTipText(tr("Offset all points in North direction (degrees). Default 0.")); 59 startDirConfig.setToolTipText(tr("Direction to search for land. Default east.")); 54 60 55 61 String description = tr("An interlude to the Lakewalker Python module to trace water bodies on Landsat imagery.<br><br>Version: {0}", LakewalkerPlugin.VERSION); … … 66 72 eastOffsetConfig.setValue(Main.pref.get(PREF_EAST_OFFSET, "0.0")); 67 73 northOffsetConfig.setValue(Main.pref.get(PREF_NORTH_OFFSET, "0.0")); 74 startDirConfig.setValue(Main.pref.get(PREF_START_DIR, "east")); 68 75 } 69 76 … … 90 97 prefPanel.add(northOffsetLabel, labelConstraints); 91 98 prefPanel.add(northOffsetConfig.getControls(), dataConstraints); 99 prefPanel.add(startDirLabel, labelConstraints); 100 prefPanel.add(startDirConfig.getControls(), dataConstraints); 92 101 } 93 102 … … 105 114 Main.pref.put(PREF_EAST_OFFSET, eastOffsetConfig.getValueString()); 106 115 Main.pref.put(PREF_NORTH_OFFSET, northOffsetConfig.getValueString()); 116 Main.pref.put(PREF_START_DIR, startDirConfig.getValueString()); 107 117 } 108 118 -
applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerReader.java
r4209 r5979 19 19 import org.openstreetmap.josm.data.coor.LatLon; 20 20 import org.openstreetmap.josm.data.osm.Node; 21 import org.openstreetmap.josm.data.osm.Segment;22 21 import org.openstreetmap.josm.data.osm.Way; 23 22 … … 45 44 46 45 Way way = new Way(); 47 Node lastNode = null;48 Node firstNode = null;49 46 String line; 50 47 setStatus("Initializing"); … … 58 55 59 56 } 60 57 char option = ' '; 58 61 59 try { 62 60 while ((line = input.readLine()) != null) { … … 65 63 } 66 64 System.out.println(line); 67 charoption = line.charAt(0);65 option = line.charAt(0); 68 66 switch (option) { 69 67 case 'n': … … 73 71 Node n = new Node(ll); 74 72 commands.add(new AddCommand(n)); 75 if (lastNode != null) { 76 Segment s = new Segment(lastNode, n); 77 commands.add(new AddCommand(s)); 78 way.segments.add(s); 79 } 80 else { 81 firstNode = n; 82 } 83 lastNode = n; 73 way.nodes.add(n); 84 74 } 85 75 catch (Exception ex) { … … 93 83 94 84 case 'x': 95 Segment s = new Segment(lastNode, firstNode);96 commands.add(new AddCommand(s));97 way.segments.add(s);98 85 way.put("created_by", "Dshpak_landsat_lakes"); 99 86 commands.add(new AddCommand(way)); 87 break; 88 89 case 'e': 90 String error = line.substring(2); 91 cancel = true; 100 92 break; 101 93 } -
applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/StringConfigurer.java
r4095 r5979 2 2 * $Id: StringConfigurer.java 2073 2007-05-10 14:34:31 +0000 (Thu, 10 May 2007) rodneykinney $ 3 3 * 4 * Copyright (c) 2000-200 3 by Rodney Kinney4 * Copyright (c) 2000-2007 by Rodney Kinney, Brent Easton 5 5 * 6 6 * This library is free software; you can redistribute it and/or
Note:
See TracChangeset
for help on using the changeset viewer.