Ignore:
Timestamp:
2011-04-20T19:55:10+02:00 (13 years ago)
Author:
zverik
Message:

dumbutils. Also, moved selection actions to a separate folder, but since NetBeans is dumb, in svn it looks like delete/add for every java file :(

Location:
applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2
Files:
7 added
1 edited
8 moved

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/UtilsPlugin2.java

    r25836 r25876  
    55import javax.swing.JMenu;
    66import javax.swing.JMenuItem;
     7import utilsplugin2.selection.*;
     8import utilsplugin2.dumbutils.*;
    79
    810import org.openstreetmap.josm.Main;
     
    2527    JMenuItem intWaysR;
    2628
     29    JMenuItem replaceGeometry;
     30    JMenuItem tagBuffer;
     31    JMenuItem sourceTag;
     32    JMenuItem pasteRelations;
     33    JMenuItem alignWayNodes;
     34
    2735    public UtilsPlugin2(PluginInformation info) {
    2836        super(info);
    29         Main.main.menu.toolsMenu.addSeparator();
    30         unglueRelation = MainMenu.add(Main.main.menu.toolsMenu, new UnGlueRelationAction());
    31         addIntersections = MainMenu.add(Main.main.menu.toolsMenu, new AddIntersectionsAction());
    32         splitObject = MainMenu.add(Main.main.menu.toolsMenu, new SplitObjectAction());
    33         Main.main.menu.toolsMenu.addSeparator();
    34         JMenu m1 = Main.main.menu.addMenu(marktr("Selection"), KeyEvent.VK_N, Main.main.menu.defaultMenuPos, "help");
    3537
    36         selectWayNodes = MainMenu.add(m1, new SelectWayNodesAction());
    37         adjNodes = MainMenu.add(m1, new AdjacentNodesAction());
    38         unsNodes = MainMenu.add(m1, new UnselectNodesAction());
    39         adjWays = MainMenu.add(m1, new AdjacentWaysAction());
    40         adjWaysAll = MainMenu.add(m1, new ConnectedWaysAction());
    41         intWays = MainMenu.add(m1, new IntersectedWaysAction());
    42         intWaysR = MainMenu.add(m1, new IntersectedWaysRecursiveAction());
     38        JMenu toolsMenu = Main.main.menu.addMenu(marktr("More tools"), KeyEvent.VK_M, 4, "help");
     39        unglueRelation = MainMenu.add(toolsMenu, new UnGlueRelationAction());
     40        addIntersections = MainMenu.add(toolsMenu, new AddIntersectionsAction());
     41        splitObject = MainMenu.add(toolsMenu, new SplitObjectAction());
     42
     43        toolsMenu.addSeparator();
     44        replaceGeometry = MainMenu.add(toolsMenu, new ReplaceGeometryAction());
     45        tagBuffer = MainMenu.add(toolsMenu, new TagBufferAction());
     46        sourceTag = MainMenu.add(toolsMenu, new TagSourceAction());
     47        pasteRelations = MainMenu.add(toolsMenu, new PasteRelationsAction());
     48        alignWayNodes = MainMenu.add(toolsMenu, new AlignWayNodesAction());
     49
     50        JMenu selectionMenu = Main.main.menu.addMenu(marktr("Selection"), KeyEvent.VK_N, Main.main.menu.defaultMenuPos, "help");
     51        selectWayNodes = MainMenu.add(selectionMenu, new SelectWayNodesAction());
     52        adjNodes = MainMenu.add(selectionMenu, new AdjacentNodesAction());
     53        unsNodes = MainMenu.add(selectionMenu, new UnselectNodesAction());
     54        adjWays = MainMenu.add(selectionMenu, new AdjacentWaysAction());
     55        adjWaysAll = MainMenu.add(selectionMenu, new ConnectedWaysAction());
     56        intWays = MainMenu.add(selectionMenu, new IntersectedWaysAction());
     57        intWaysR = MainMenu.add(selectionMenu, new IntersectedWaysRecursiveAction());
    4358    }
    4459
     
    5065        addIntersections.setEnabled(enabled);
    5166        splitObject.setEnabled(enabled);
     67
     68        replaceGeometry.setEnabled(enabled);
     69        tagBuffer.setEnabled(enabled);
     70        sourceTag.setEnabled(enabled);
     71        pasteRelations.setEnabled(enabled);
     72        alignWayNodes.setEnabled(enabled);
     73
    5274        selectWayNodes.setEnabled(enabled);
    5375        adjNodes.setEnabled(enabled);
  • applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/selection/AdjacentNodesAction.java

    r25874 r25876  
    11// License: GPL. Copyright 2011 by Alexei Kasatkin and others
    2 package utilsplugin2;
     2package utilsplugin2.selection;
    33
    44import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
     
    88import java.awt.event.KeyEvent;
    99import java.util.Collection;
    10 import java.util.HashSet;
    1110import java.util.HashSet;
    1211import java.util.Set;
     
    1918 *    Extends current selection
    2019 */
    21 class AdjacentNodesAction extends JosmAction {
     20public class AdjacentNodesAction extends JosmAction {
    2221
    2322    public static final boolean treeMode = false;
  • applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/selection/AdjacentWaysAction.java

    r25874 r25876  
    11// License: GPL. Copyright 2011 by Alexei Kasatkin
    2 package utilsplugin2;
     2package utilsplugin2.selection;
    33
    44import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
     
    1818 *    Extends current selection
    1919 */
    20 class AdjacentWaysAction extends JosmAction {
     20public class AdjacentWaysAction extends JosmAction {
    2121
    2222    public static final boolean treeMode = false;
  • applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/selection/ConnectedWaysAction.java

    r25874 r25876  
    11// License: GPL. Copyright 2011 by Alexei Kasatkin
    2 package utilsplugin2;
     2package utilsplugin2.selection;
    33
    44import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
     
    1818 *    Extends current selection by selecting nodes on all touched ways
    1919 */
    20 class ConnectedWaysAction extends JosmAction {
     20public class ConnectedWaysAction extends JosmAction {
    2121
    2222    public ConnectedWaysAction() {
  • applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/selection/IntersectedWaysAction.java

    r25874 r25876  
    11// License: GPL. Copyright 2011 by Alexei Kasatkin
    2 package utilsplugin2;
     2package utilsplugin2.selection;
    33
    44import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
     
    2020 *    Extends current selection by selecting nodes on all touched ways
    2121 */
    22 class IntersectedWaysAction extends JosmAction {
     22public class IntersectedWaysAction extends JosmAction {
    2323
    2424    public IntersectedWaysAction() {
  • applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/selection/IntersectedWaysRecursiveAction.java

    r25874 r25876  
    11// License: GPL. Copyright 2011 by Alexei Kasatkin ond others
    2 package utilsplugin2;
     2package utilsplugin2.selection;
    33
    44import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
     
    2020 *    Extends current selection by selecting nodes on all touched ways
    2121 */
    22 class IntersectedWaysRecursiveAction extends JosmAction {
     22public class IntersectedWaysRecursiveAction extends JosmAction {
    2323   
    2424    public IntersectedWaysRecursiveAction() {
  • applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/selection/NodeWayUtils.java

    r25874 r25876  
    11// License: GPL. Copyright 2011 by Alexei Kasatkin
    2 package utilsplugin2;
     2package utilsplugin2.selection;
    33
    44import java.util.Collection;
  • applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/selection/SelectWayNodesAction.java

    r25874 r25876  
    11// License: GPL. Copyright 2010 by Hanno Hecker
    2 package utilsplugin2;
     2package utilsplugin2.selection;
    33
    44import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
    55import static org.openstreetmap.josm.tools.I18n.tr;
    6 import static org.openstreetmap.josm.tools.I18n.trn;
    76
    87import java.awt.event.ActionEvent;
     
    109import java.util.ArrayList;
    1110import java.util.Collection;
    12 import java.util.Collections;
    13 import java.util.HashSet;
    14 import java.util.LinkedList;
    15 import java.util.List;
    1611
    17 import javax.swing.JOptionPane;
    18 import javax.swing.JPanel;
    19 
    20 import org.openstreetmap.josm.Main;
    2112import org.openstreetmap.josm.actions.JosmAction;
    22 import org.openstreetmap.josm.command.AddCommand;
    23 import org.openstreetmap.josm.command.ChangeCommand;
    24 import org.openstreetmap.josm.command.Command;
    25 import org.openstreetmap.josm.command.SequenceCommand;
    2613import org.openstreetmap.josm.data.osm.Node;
    2714import org.openstreetmap.josm.data.osm.OsmPrimitive;
    28 import org.openstreetmap.josm.data.osm.Relation;
    29 import org.openstreetmap.josm.data.osm.RelationMember;
    3015import org.openstreetmap.josm.data.osm.Way;
    31 import org.openstreetmap.josm.gui.MapView;
    3216import org.openstreetmap.josm.tools.Shortcut;
    3317
  • applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/selection/UnselectNodesAction.java

    r25874 r25876  
    11// License: GPL. Copyright 2011 by Alexei Kasatkin and Martin Ždila
    2 package utilsplugin2;
     2package utilsplugin2.selection;
    33
    44import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
     
    1717 *    Unselects all nodes
    1818 */
    19 class UnselectNodesAction extends JosmAction {
     19public class UnselectNodesAction extends JosmAction {
    2020
    2121   
Note: See TracChangeset for help on using the changeset viewer.