Ignore:
Timestamp:
2011-04-09T14:10:52+02:00 (14 years ago)
Author:
akks
Message:

Utilsplugin2: Fixed some small issues in recent additions (shortcut mapping, LinkedHashSet->HashSet).

Location:
applications/editors/josm/plugins/utilsplugin2
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/utilsplugin2/build.xml

    r25814 r25817  
    255255    </target>
    256256    <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"/>
    259259        </java>
    260260    </target>
  • applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/AdjacentNodesAction.java

    r25814 r25817  
    99import java.util.Collection;
    1010import java.util.HashSet;
    11 import java.util.LinkedHashSet;
     11import java.util.HashSet;
    1212import java.util.Set;
    1313import org.openstreetmap.josm.actions.JosmAction;
     
    3030    }
    3131
    32     private  Set<Way> activeWays = new LinkedHashSet<Way>();
     32    private  Set<Way> activeWays = new HashSet<Way>();
    3333
    3434    public void actionPerformed(ActionEvent e) {
  • applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/AdjacentWaysAction.java

    r25814 r25817  
    88import java.awt.event.KeyEvent;
    99import java.util.Collection;
    10 import java.util.LinkedHashSet;
     10import java.util.HashSet;
    1111import java.util.Set;
    1212import org.openstreetmap.josm.actions.JosmAction;
     
    3737
    3838        // select ways attached to already selected ways
    39         Set<Way> newWays = new LinkedHashSet<Way>();
     39        Set<Way> newWays = new HashSet<Way>();
    4040        newWays.addAll(selectedWays);
    4141        for (Way w : selectedWays){
  • applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/ConnectedWaysAction.java

    r25814 r25817  
    88import java.awt.event.KeyEvent;
    99import java.util.Collection;
    10 import java.util.LinkedHashSet;
     10import java.util.HashSet;
    1111import java.util.Set;
    1212import org.openstreetmap.josm.actions.JosmAction;
     
    3232        Set<Way> selectedWays = OsmPrimitive.getFilteredSet(getCurrentDataSet().getSelected(), Way.class);
    3333
    34         Set<Way> newWays = new LinkedHashSet<Way>();
     34        Set<Way> newWays = new HashSet<Way>();
    3535
    3636        // selecting ways attached to selected nodes
  • applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/IntersectedWaysAction.java

    r25814 r25817  
    88import java.awt.event.KeyEvent;
    99import java.util.Collection;
    10 import java.util.LinkedHashSet;
     10import java.util.HashSet;
    1111import java.util.Set;
    1212import javax.swing.JOptionPane;
     
    3232        Collection<OsmPrimitive> selection = getCurrentDataSet().getSelected();
    3333        Set<Node> selectedNodes = OsmPrimitive.getFilteredSet(selection, Node.class);
    34         Set<Way> activeWays = new LinkedHashSet<Way>();
     34        Set<Way> activeWays = new HashSet<Way>();
    3535
    3636        Set<Way> selectedWays = OsmPrimitive.getFilteredSet(getCurrentDataSet().getSelected(), Way.class);
     
    3838        // select ways attached to already selected ways
    3939        if (!selectedWays.isEmpty()) {
    40             Set<Way> newWays = new LinkedHashSet<Way>();
     40            Set<Way> newWays = new HashSet<Way>();
    4141            NodeWayUtils.addWaysIntersectingWays(
    4242                    getCurrentDataSet().getWays(),
  • applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/IntersectedWaysRecursiveAction.java

    r25814 r25817  
    88import java.awt.event.KeyEvent;
    99import java.util.Collection;
    10 import java.util.LinkedHashSet;
     10import java.util.HashSet;
    1111import java.util.Set;
    1212import javax.swing.JOptionPane;
     
    2525        super(tr("All intersecting ways"), "intwayall", tr("Select all intersecting ways"),
    2626                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);
    2828        putValue("help", ht("/Action/SelectAllIntersectingWays"));
    2929
     
    3333        Collection<OsmPrimitive> selection = getCurrentDataSet().getSelected();
    3434        Set<Node> selectedNodes = OsmPrimitive.getFilteredSet(selection, Node.class);
    35         Set<Way> activeWays = new LinkedHashSet<Way>();
     35        Set<Way> activeWays = new HashSet<Way>();
    3636
    3737        Set<Way> selectedWays = OsmPrimitive.getFilteredSet(getCurrentDataSet().getSelected(), Way.class);
    3838
    3939        if (!selectedWays.isEmpty()) {
    40             Set<Way> newWays = new LinkedHashSet<Way>();
     40            Set<Way> newWays = new HashSet<Way>();
    4141            NodeWayUtils.addWaysIntersectingWaysRecursively(
    4242                    getCurrentDataSet().getWays(),
  • applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/NodeWayUtils.java

    r25814 r25817  
    33
    44import java.util.Collection;
    5 import java.util.LinkedHashSet;
     5import java.util.HashSet;
    66import java.util.List;
    77import java.util.Set;
     
    2525    static final int maxLevel = Main.pref.getInteger("selection.maxrecursion", 5);
    2626    static final int maxWays = Main.pref.getInteger("selection.maxfoundways", 2000);
    27     static final int maxWays1 = Main.pref.getInteger("selection.maxfoundwaysrec", 200);
     27    static final int maxWays1 = Main.pref.getInteger("selection.maxfoundways.intersection", 500);
    2828
    2929    /**
     
    168168            (Collection<Way> allWays, Collection<Way> initWays, Set<Way> newWays)
    169169    {
    170             Set<Way> foundWays = new LinkedHashSet<Way>();
     170            Set<Way> foundWays = new HashSet<Way>();
    171171            foundWays.addAll(initWays);
    172172            newWays.addAll(initWays);
    173             Set<Way> newFoundWays = new LinkedHashSet<Way>();
     173            Set<Way> newFoundWays = new HashSet<Way>();
    174174
    175175            int level=0,c;
    176176            do {
    177177                 c=0;
    178                  newFoundWays = new LinkedHashSet<Way>();
     178                 newFoundWays = new HashSet<Way>();
    179179                 for (Way w : foundWays){
    180180                      c+=addWaysIntersectingWay(allWays, w, newFoundWays,newWays);
     
    198198            (Collection<Way> initWays, Set<Way> newWays)
    199199    {
     200            //long t = System.currentTimeMillis();
    200201            int level=0,c;
    201202            newWays.addAll(initWays);
    202203            do {
    203204                 c=0;
    204                  Set<Way> foundWays = new LinkedHashSet<Way>();
     205                 Set<Way> foundWays = new HashSet<Way>();
    205206                 foundWays.addAll(newWays);
    206207                 for (Way w : foundWays){
     
    217218                 }
    218219            } while ( c >0 && level < maxLevel );
     220           // System.out.println("time = "+(System.currentTimeMillis()-t)+" ways = "+newWays.size());
    219221            return;
    220222    }
  • applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/UtilsPlugin2.java

    r25814 r25817  
    3131        splitObject = MainMenu.add(Main.main.menu.toolsMenu, new SplitObjectAction());
    3232        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");
    3434
    3535        selectWayNodes = MainMenu.add(m1, new SelectWayNodesAction());
Note: See TracChangeset for help on using the changeset viewer.