Changeset 6127 in osm
- Timestamp:
- 2007-12-21T03:27:11+01:00 (17 years ago)
- Location:
- applications/editors/josm/plugins/lakewalker
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/lakewalker/build.xml
r6100 r6127 28 28 <target name="compile" depends="init"> 29 29 <mkdir dir="build"></mkdir> 30 <javac srcdir="src" classpath="${josm}" destdir="build" debug="true"> 31 <include name="**/*.java" /> 32 </javac> 30 33 <mkdir dir="build/images"></mkdir> 31 34 <copy todir="build"> -
applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerPreferences.java
r5979 r6127 14 14 15 15 public static final String[] DIRECTIONS = new String[] {"east", "northeast", "north", "northwest", "west", "southwest", "south", "southeast"}; 16 public static final String[] WAYTYPES = new String[] {"water", "coastline", "land", "none"}; 16 17 17 18 public static final String PREF_PYTHON = "lakewalker.python"; … … 25 26 public static final String PREF_NORTH_OFFSET = "lakewalker.north_offset"; 26 27 public static final String PREF_START_DIR = "lakewalker.startdir"; 28 public static final String PREF_WAYTYPE = "lakewalker.waytype"; 27 29 28 30 protected StringConfigurer pythonConfig = new StringConfigurer(); … … 45 47 protected JLabel northOffsetLabel = new JLabel(tr("Shift all traces to north (degrees)")); 46 48 protected StringEnumConfigurer startDirConfig = new StringEnumConfigurer(DIRECTIONS); 47 protected JLabel startDirLabel = new JLabel(tr("Direction to search for land")); 49 protected JLabel startDirLabel = new JLabel(tr("Direction to search for land")); 50 protected StringEnumConfigurer lakeTypeConfig = new StringEnumConfigurer(WAYTYPES); 51 protected JLabel lakeTypeLabel = new JLabel(tr("Tag ways as")); 48 52 49 53 public void addGui(PreferenceDialog gui) { … … 57 61 eastOffsetConfig.setToolTipText(tr("Offset all points in East direction (degrees). Default 0.")); 58 62 northOffsetConfig.setToolTipText(tr("Offset all points in North direction (degrees). Default 0.")); 59 startDirConfig.setToolTipText(tr("Direction to search for land. Default east.")); 63 startDirConfig.setToolTipText(tr("Direction to search for land. Default east.")); 64 lakeTypeConfig.setToolTipText(tr("Tag ways as water, coastline, land or nothing. Default is water.")); 60 65 61 66 String description = tr("An interlude to the Lakewalker Python module to trace water bodies on Landsat imagery.<br><br>Version: {0}", LakewalkerPlugin.VERSION); … … 73 78 northOffsetConfig.setValue(Main.pref.get(PREF_NORTH_OFFSET, "0.0")); 74 79 startDirConfig.setValue(Main.pref.get(PREF_START_DIR, "east")); 80 lakeTypeConfig.setValue(Main.pref.get(PREF_WAYTYPE, "water")); 75 81 } 76 82 … … 98 104 prefPanel.add(northOffsetConfig.getControls(), dataConstraints); 99 105 prefPanel.add(startDirLabel, labelConstraints); 100 prefPanel.add(startDirConfig.getControls(), dataConstraints); 106 prefPanel.add(startDirConfig.getControls(), dataConstraints); 107 prefPanel.add(lakeTypeLabel, labelConstraints); 108 prefPanel.add(lakeTypeConfig.getControls(), dataConstraints); 101 109 } 102 110 … … 115 123 Main.pref.put(PREF_NORTH_OFFSET, northOffsetConfig.getValueString()); 116 124 Main.pref.put(PREF_START_DIR, startDirConfig.getValueString()); 125 Main.pref.put(PREF_WAYTYPE, lakeTypeConfig.getValueString()); 117 126 } 118 127 -
applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/LakewalkerReader.java
r5979 r6127 58 58 59 59 try { 60 61 Node fn = null; //new Node(new LatLon(0,0)); 62 60 63 while ((line = input.readLine()) != null) { 61 64 if (cancel) { … … 72 75 commands.add(new AddCommand(n)); 73 76 way.nodes.add(n); 77 if(fn==null){ 78 fn = n; 79 } 74 80 } 75 81 catch (Exception ex) { … … 83 89 84 90 case 'x': 91 String waytype = Main.pref.get(LakewalkerPreferences.PREF_WAYTYPE, "water"); 92 93 if(!waytype.equals("none")){ 94 way.put("natural",waytype); 95 } 96 85 97 way.put("created_by", "Dshpak_landsat_lakes"); 86 98 commands.add(new AddCommand(way)); 99 87 100 break; 88 101 … … 94 107 } 95 108 input.close(); 109 way.nodes.add(fn); 96 110 } 97 111
Note:
See TracChangeset
for help on using the changeset viewer.