Changeset 142 in josm for src/org/openstreetmap
- Timestamp:
- 2006-09-24T11:15:39+02:00 (18 years ago)
- Location:
- src/org/openstreetmap/josm
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/Main.java
r138 r142 32 32 import org.openstreetmap.josm.actions.DownloadAction; 33 33 import org.openstreetmap.josm.actions.ExitAction; 34 import org.openstreetmap.josm.actions.ExternalToolsAction; 34 35 import org.openstreetmap.josm.actions.GpxExportAction; 35 36 import org.openstreetmap.josm.actions.OpenAction; … … 204 205 mainMenu.add(editMenu); 205 206 207 JMenu externalMenu = ExternalToolsAction.buildMenu(); 208 if (externalMenu != null) 209 mainMenu.add(externalMenu); 210 206 211 mainMenu.add(new JSeparator()); 207 212 final JMenu helpMenu = new JMenu(tr("Help")); -
src/org/openstreetmap/josm/actions/SaveAction.java
r139 r142 43 43 44 44 save(file); 45 Main.main.editLayer().name = file.getName(); 46 Main.main.editLayer().associatedFile = file; 47 Main.parent.repaint(); 45 48 } 46 49 -
src/org/openstreetmap/josm/data/coor/LatLon.java
r86 r142 1 1 package org.openstreetmap.josm.data.coor; 2 2 3 import org.openstreetmap.josm.data.Bounds; 3 4 import org.openstreetmap.josm.data.projection.Projection; 4 5 … … 42 43 } 43 44 45 /** 46 * @return <code>true</code> if this is within the given bounding box. 47 */ 48 public boolean isWithin(Bounds b) { 49 return lat() >= b.min.lat() && lat() <= b.max.lat() && lon() > b.min.lon() && lon() < b.max.lon(); 50 } 51 44 52 @Override public String toString() { 45 53 return "LatLon[lat="+lat()+",lon="+lon()+"]"; -
src/org/openstreetmap/josm/data/osm/DataSet.java
r94 r142 5 5 import java.util.Collections; 6 6 import java.util.HashSet; 7 import java.util.Iterator; 7 8 import java.util.LinkedList; 8 9 … … 43 44 44 45 /** 45 46 47 46 * A list of listeners to selection changed events. 47 */ 48 transient Collection<SelectionChangedListener> listeners = new LinkedList<SelectionChangedListener>(); 48 49 49 50 /** … … 106 107 fireSelectionChanged(Arrays.asList(new OsmPrimitive[]{osm})); 107 108 } 108 109 109 110 /** 110 111 * Remove the selection from every value in the collection. … … 133 134 134 135 /** 135 136 137 138 136 * Remember to fire an selection changed event. A call to this will not fire 137 * the event immediately. For more, @see SelectionChangedListener 138 */ 139 public void fireSelectionChanged(Collection<? extends OsmPrimitive> sel) { 139 140 for (SelectionChangedListener l : listeners) 140 141 l.selectionChanged(sel); 141 142 } 142 143 143 144 /** 144 145 146 147 148 149 150 151 145 * Add a listener to the selection changed listener list. If <code>null</code> 146 * is passed, nothing happens. 147 * @param listener The listener to add to the list. 148 */ 149 public void addSelectionChangedListener(SelectionChangedListener listener) { 150 if (listener != null) 151 listeners.add(listener); 152 } 152 153 153 154 /** 154 155 156 157 158 159 160 161 155 * Remove a listener from the selection changed listener list. 156 * If <code>null</code> is passed, nothing happens. 157 * @param listener The listener to remove from the list. 158 */ 159 public void removeSelectionChangedListener(SelectionChangedListener listener) { 160 if (listener != null) 161 listeners.remove(listener); 162 } 162 163 163 164 public void addAllSelectionListener(DataSet ds) { 164 165 listeners.addAll(ds.listeners); 165 } 166 } 167 168 /** 169 * Compares this and the parameter dataset and return <code>true</code> if both 170 * contain the same data primitives (ignoring the selection) 171 */ 172 public boolean realEqual(Collection<OsmPrimitive> other) { 173 Collection<OsmPrimitive> my = allPrimitives(); 174 175 if (my.size() != other.size()) 176 return false; 177 178 Iterator<OsmPrimitive> it = other.iterator(); 179 for (OsmPrimitive osm : my) 180 if (!osm.realEqual(it.next())) 181 return false; 182 183 return true; 184 } 166 185 } -
src/org/openstreetmap/josm/data/osm/visitor/AddVisitor.java
r86 r142 18 18 19 19 private final DataSet ds; 20 private final boolean includeReferences; 21 22 public AddVisitor(DataSet ds, boolean includeReferences) { 23 this.ds = ds; 24 this.includeReferences = includeReferences; 25 } 20 26 21 27 public AddVisitor(DataSet ds) { 22 this .ds = ds;28 this(ds, false); 23 29 } 24 30 25 31 public void visit(Node n) { 26 ds.nodes.add(n); 32 if (!includeReferences || !ds.nodes.contains(n)) 33 ds.nodes.add(n); 27 34 } 28 public void visit(Segment ls) { 29 ds.segments.add(ls); 35 public void visit(Segment s) { 36 ds.segments.add(s); 37 if (includeReferences && !s.incomplete) { 38 if (!ds.nodes.contains(s.from)) 39 s.from.visit(this); 40 if (!ds.nodes.contains(s.to)) 41 s.to.visit(this); 42 } 30 43 } 31 public void visit(Way t) { 32 ds.ways.add(t); 44 public void visit(Way w) { 45 ds.ways.add(w); 46 if (includeReferences) 47 for (Segment s : w.segments) 48 if (!ds.segments.contains(s)) 49 s.visit(this); 33 50 } 34 51 } -
src/org/openstreetmap/josm/gui/MapStatus.java
r113 r142 174 174 } 175 175 } catch (ConcurrentModificationException x) { 176 } catch (NullPointerException x) { 176 177 } 177 178 } -
src/org/openstreetmap/josm/tools/SearchCompiler.java
r102 r142 78 78 if (value == null) 79 79 return notValue; 80 return (value. indexOf(this.value) != -1) != notValue;80 return (value.toLowerCase().indexOf(this.value.toLowerCase()) != -1) != notValue; 81 81 } 82 82 @Override public String toString() {return key+"="+(notValue?"!":"")+value;} … … 90 90 return s.equals(""); 91 91 for (Entry<String, String> e : osm.keys.entrySet()) 92 if (e.getKey().indexOf(s) != -1 || e.getValue().indexOf(s) != -1) 92 if (e.getKey().toLowerCase().indexOf(s.toLowerCase()) != -1 93 || e.getValue().toLowerCase().indexOf(s.toLowerCase()) != -1) 93 94 return true; 94 95 return false; … … 111 112 @Override public String toString() {return "type="+type;} 112 113 } 113 114 114 115 private static class Modified extends Match { 115 116 @Override public boolean match(OsmPrimitive osm) {
Note:
See TracChangeset
for help on using the changeset viewer.