Changeset 25817 in osm for applications/editors/josm/plugins
- Timestamp:
- 2011-04-09T14:10:52+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/utilsplugin2
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/utilsplugin2/build.xml
r25814 r25817 255 255 </target> 256 256 <target name="runjosm" depends="install"> 257 <java jar="${josm}" > 258 <arg line="../../data_nodist/neubrandenburg.osm"/> 257 <java jar="${josm}" fork="true"> 258 <arg line="../../core/data_nodist/neubrandenburg.osm"/> 259 259 </java> 260 260 </target> -
applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/AdjacentNodesAction.java
r25814 r25817 9 9 import java.util.Collection; 10 10 import java.util.HashSet; 11 import java.util. LinkedHashSet;11 import java.util.HashSet; 12 12 import java.util.Set; 13 13 import org.openstreetmap.josm.actions.JosmAction; … … 30 30 } 31 31 32 private Set<Way> activeWays = new LinkedHashSet<Way>();32 private Set<Way> activeWays = new HashSet<Way>(); 33 33 34 34 public void actionPerformed(ActionEvent e) { -
applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/AdjacentWaysAction.java
r25814 r25817 8 8 import java.awt.event.KeyEvent; 9 9 import java.util.Collection; 10 import java.util. LinkedHashSet;10 import java.util.HashSet; 11 11 import java.util.Set; 12 12 import org.openstreetmap.josm.actions.JosmAction; … … 37 37 38 38 // select ways attached to already selected ways 39 Set<Way> newWays = new LinkedHashSet<Way>();39 Set<Way> newWays = new HashSet<Way>(); 40 40 newWays.addAll(selectedWays); 41 41 for (Way w : selectedWays){ -
applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/ConnectedWaysAction.java
r25814 r25817 8 8 import java.awt.event.KeyEvent; 9 9 import java.util.Collection; 10 import java.util. LinkedHashSet;10 import java.util.HashSet; 11 11 import java.util.Set; 12 12 import org.openstreetmap.josm.actions.JosmAction; … … 32 32 Set<Way> selectedWays = OsmPrimitive.getFilteredSet(getCurrentDataSet().getSelected(), Way.class); 33 33 34 Set<Way> newWays = new LinkedHashSet<Way>();34 Set<Way> newWays = new HashSet<Way>(); 35 35 36 36 // selecting ways attached to selected nodes -
applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/IntersectedWaysAction.java
r25814 r25817 8 8 import java.awt.event.KeyEvent; 9 9 import java.util.Collection; 10 import java.util. LinkedHashSet;10 import java.util.HashSet; 11 11 import java.util.Set; 12 12 import javax.swing.JOptionPane; … … 32 32 Collection<OsmPrimitive> selection = getCurrentDataSet().getSelected(); 33 33 Set<Node> selectedNodes = OsmPrimitive.getFilteredSet(selection, Node.class); 34 Set<Way> activeWays = new LinkedHashSet<Way>();34 Set<Way> activeWays = new HashSet<Way>(); 35 35 36 36 Set<Way> selectedWays = OsmPrimitive.getFilteredSet(getCurrentDataSet().getSelected(), Way.class); … … 38 38 // select ways attached to already selected ways 39 39 if (!selectedWays.isEmpty()) { 40 Set<Way> newWays = new LinkedHashSet<Way>();40 Set<Way> newWays = new HashSet<Way>(); 41 41 NodeWayUtils.addWaysIntersectingWays( 42 42 getCurrentDataSet().getWays(), -
applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/IntersectedWaysRecursiveAction.java
r25814 r25817 8 8 import java.awt.event.KeyEvent; 9 9 import java.util.Collection; 10 import java.util. LinkedHashSet;10 import java.util.HashSet; 11 11 import java.util.Set; 12 12 import javax.swing.JOptionPane; … … 25 25 super(tr("All intersecting ways"), "intwayall", tr("Select all intersecting ways"), 26 26 Shortcut.registerShortcut("tools:intwayall", tr("Tool: {0}","All intersecting ways"), 27 KeyEvent.VK_I, Shortcut.GROUP_MENU), true); 27 KeyEvent.VK_I, Shortcut.GROUP_MENU, KeyEvent.SHIFT_DOWN_MASK|KeyEvent.CTRL_DOWN_MASK), true); 28 28 putValue("help", ht("/Action/SelectAllIntersectingWays")); 29 29 … … 33 33 Collection<OsmPrimitive> selection = getCurrentDataSet().getSelected(); 34 34 Set<Node> selectedNodes = OsmPrimitive.getFilteredSet(selection, Node.class); 35 Set<Way> activeWays = new LinkedHashSet<Way>();35 Set<Way> activeWays = new HashSet<Way>(); 36 36 37 37 Set<Way> selectedWays = OsmPrimitive.getFilteredSet(getCurrentDataSet().getSelected(), Way.class); 38 38 39 39 if (!selectedWays.isEmpty()) { 40 Set<Way> newWays = new LinkedHashSet<Way>();40 Set<Way> newWays = new HashSet<Way>(); 41 41 NodeWayUtils.addWaysIntersectingWaysRecursively( 42 42 getCurrentDataSet().getWays(), -
applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/NodeWayUtils.java
r25814 r25817 3 3 4 4 import java.util.Collection; 5 import java.util. LinkedHashSet;5 import java.util.HashSet; 6 6 import java.util.List; 7 7 import java.util.Set; … … 25 25 static final int maxLevel = Main.pref.getInteger("selection.maxrecursion", 5); 26 26 static final int maxWays = Main.pref.getInteger("selection.maxfoundways", 2000); 27 static final int maxWays1 = Main.pref.getInteger("selection.maxfoundways rec", 200);27 static final int maxWays1 = Main.pref.getInteger("selection.maxfoundways.intersection", 500); 28 28 29 29 /** … … 168 168 (Collection<Way> allWays, Collection<Way> initWays, Set<Way> newWays) 169 169 { 170 Set<Way> foundWays = new LinkedHashSet<Way>();170 Set<Way> foundWays = new HashSet<Way>(); 171 171 foundWays.addAll(initWays); 172 172 newWays.addAll(initWays); 173 Set<Way> newFoundWays = new LinkedHashSet<Way>();173 Set<Way> newFoundWays = new HashSet<Way>(); 174 174 175 175 int level=0,c; 176 176 do { 177 177 c=0; 178 newFoundWays = new LinkedHashSet<Way>();178 newFoundWays = new HashSet<Way>(); 179 179 for (Way w : foundWays){ 180 180 c+=addWaysIntersectingWay(allWays, w, newFoundWays,newWays); … … 198 198 (Collection<Way> initWays, Set<Way> newWays) 199 199 { 200 //long t = System.currentTimeMillis(); 200 201 int level=0,c; 201 202 newWays.addAll(initWays); 202 203 do { 203 204 c=0; 204 Set<Way> foundWays = new LinkedHashSet<Way>();205 Set<Way> foundWays = new HashSet<Way>(); 205 206 foundWays.addAll(newWays); 206 207 for (Way w : foundWays){ … … 217 218 } 218 219 } while ( c >0 && level < maxLevel ); 220 // System.out.println("time = "+(System.currentTimeMillis()-t)+" ways = "+newWays.size()); 219 221 return; 220 222 } -
applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/UtilsPlugin2.java
r25814 r25817 31 31 splitObject = MainMenu.add(Main.main.menu.toolsMenu, new SplitObjectAction()); 32 32 Main.main.menu.toolsMenu.addSeparator(); 33 JMenu m1 = Main.main.menu.addMenu(marktr("Selection"), KeyEvent.VK_ S, Main.main.menu.defaultMenuPos, "help");33 JMenu m1 = Main.main.menu.addMenu(marktr("Selection"), KeyEvent.VK_N, Main.main.menu.defaultMenuPos, "help"); 34 34 35 35 selectWayNodes = MainMenu.add(m1, new SelectWayNodesAction());
Note:
See TracChangeset
for help on using the changeset viewer.