Ignore:
Timestamp:
2013-07-24T18:01:58+02:00 (12 years ago)
Author:
akks
Message:

[josm_utilsplugin2. josm_commandline, josm_livegps, josm_reverter, josm_opendata, josm_videomapping]:
rearrange menu items and change menu accelerators, add Netbeans projects, fix some syntax warnings

Location:
applications/editors/josm/plugins/CommandLine/src/CommandLine
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/CommandLine/src/CommandLine/AnyAction.java

    r29505 r29769  
    107107    }
    108108
     109        @Override
    109110        public void eventDispatched(AWTEvent arg0) {
    110                 if (!(arg0 instanceof KeyEvent))
    111                         return;
    112                 KeyEvent ev = (KeyEvent) arg0;
     111        if (!(arg0 instanceof KeyEvent))
     112                return;
     113        KeyEvent ev = (KeyEvent) arg0;
    113114        isCtrlDown = (ev.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0;
    114115        if (ev.getKeyCode() == KeyEvent.VK_ESCAPE && ev.getID() == KeyEvent.KEY_PRESSED) {
     
    142143            // We invoke this to prevent strange things from happening
    143144            EventQueue.invokeLater(new Runnable() {
     145                @Override
    144146                public void run() {
    145147                    // Don't change cursor when mode has changed already
  • applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLine.java

    r29566 r29769  
    190190
    191191        if ( Main.main.menu != null ) {
    192             commandMenu = Main.main.menu.addMenu(marktr("Commands") , KeyEvent.VK_M, Main.main.menu.defaultMenuPos, ht("/Plugin/CommandLine"));
    193             MainMenu.add(Main.main.menu.toolsMenu, new CommandLineAction(this));
     192            boolean oldMenu = org.openstreetmap.josm.data.Version.getInstance().getVersion() < 6082;
     193            commandMenu = Main.main.menu.addMenu(marktr("Commands") , oldMenu?KeyEvent.VK_M : KeyEvent.VK_O, Main.main.menu.defaultMenuPos, ht("/Plugin/CommandLine"));
     194            MainMenu.add(commandMenu, new CommandLineAction(this));
    194195        }
    195196        loadCommands();
  • applications/editors/josm/plugins/CommandLine/src/CommandLine/DummyAction.java

    r29505 r29769  
    1818
    1919public class DummyAction extends MapMode implements AWTEventListener {
    20         private CommandLine parentPlugin;
     20    private CommandLine parentPlugin;
    2121
    22         public DummyAction(MapFrame mapFrame, CommandLine parentPlugin) {
    23                 super(null, "addsegment.png", null, mapFrame, ImageProvider.getCursor("normal", null));
    24                 this.parentPlugin = parentPlugin;
    25         }
     22    public DummyAction(MapFrame mapFrame, CommandLine parentPlugin) {
     23            super(null, "addsegment.png", null, mapFrame, ImageProvider.getCursor("normal", null));
     24            this.parentPlugin = parentPlugin;
     25    }
    2626
    27         public void eventDispatched(AWTEvent arg0) {
    28                 if (!(arg0 instanceof KeyEvent))
    29                         return;
    30                 KeyEvent ev = (KeyEvent) arg0;
     27    @Override
     28    public void eventDispatched(AWTEvent arg0) {
     29        if (!(arg0 instanceof KeyEvent))
     30                return;
     31        KeyEvent ev = (KeyEvent) arg0;
    3132        if (ev.getKeyCode() == KeyEvent.VK_ESCAPE && ev.getID() == KeyEvent.KEY_PRESSED) {
    3233            ev.consume();
  • applications/editors/josm/plugins/CommandLine/src/CommandLine/Loader.java

    r29505 r29769  
    6767        }
    6868
     69        @Override
    6970        public void startElement(String namespaceURI, String localName, String rawName, Attributes attrs) {
    7071                int len = attrs.getLength();
     
    125126        }
    126127
     128        @Override
    127129        public void characters(char ch[], int start, int length)
    128130        {
     
    165167        }
    166168
     169        @Override
    167170        public void warning(SAXParseException ex) {
    168171          System.err.println("Warning in command xml file " + currentFile + ": " + ex.getMessage());
    169172        }
    170173
     174        @Override
    171175        public void error(SAXParseException ex) {
    172176          System.err.println("Error in command xml file " + currentFile + ": " + ex.getMessage());
    173177        }
    174178
     179        @Override
    175180        public void fatalError(SAXParseException ex) throws SAXException {
    176181          System.err.println("Error in command xml file " + currentFile + ": " + ex.getMessage());
  • applications/editors/josm/plugins/CommandLine/src/CommandLine/NodeAction.java

    r29505 r29769  
    109109    }
    110110
     111        @Override
    111112        public void eventDispatched(AWTEvent arg0) {
    112                 if (!(arg0 instanceof KeyEvent))
    113                         return;
    114                 KeyEvent ev = (KeyEvent) arg0;
     113        if (!(arg0 instanceof KeyEvent))
     114                return;
     115        KeyEvent ev = (KeyEvent) arg0;
    115116        isCtrlDown = (ev.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0;
    116117        if (ev.getKeyCode() == KeyEvent.VK_ESCAPE && ev.getID() == KeyEvent.KEY_PRESSED) {
     
    144145            // We invoke this to prevent strange things from happening
    145146            EventQueue.invokeLater(new Runnable() {
     147                @Override
    146148                public void run() {
    147149                    // Don't change cursor when mode has changed already
  • applications/editors/josm/plugins/CommandLine/src/CommandLine/PointAction.java

    r29505 r29769  
    120120        }
    121121
     122        @Override
    122123        public void eventDispatched(AWTEvent arg0) {
    123124                if (!(arg0 instanceof KeyEvent))
     
    157158                        // We invoke this to prevent strange things from happening
    158159                        EventQueue.invokeLater(new Runnable() {
     160                                @Override
    159161                                public void run() {
    160162                                        // Don't change cursor when mode has changed already
  • applications/editors/josm/plugins/CommandLine/src/CommandLine/RelationAction.java

    r29505 r29769  
    2525        }
    2626
     27        @Override
    2728        public void eventDispatched(AWTEvent arg0) {
    2829                if (!(arg0 instanceof KeyEvent))
  • applications/editors/josm/plugins/CommandLine/src/CommandLine/WayAction.java

    r29505 r29769  
    130130    }
    131131
     132        @Override
    132133        public void eventDispatched(AWTEvent arg0) {
    133                 if (!(arg0 instanceof KeyEvent))
    134                         return;
    135                 KeyEvent ev = (KeyEvent) arg0;
     134        if (!(arg0 instanceof KeyEvent))
     135                return;
     136        KeyEvent ev = (KeyEvent) arg0;
    136137        isCtrlDown = (ev.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0;
    137138        if (ev.getKeyCode() == KeyEvent.VK_ESCAPE && ev.getID() == KeyEvent.KEY_PRESSED) {
     
    143144    private void updCursor() {
    144145        if (mousePos != null) {
    145                         if (!Main.isDisplayingMapView())
    146                                 return;
    147                         nearestWay = Main.map.mapView.getNearestWay(mousePos, OsmPrimitive.isUsablePredicate);
    148                         if (nearestWay != null) {
    149                                 setCursor(cursorActive);
    150                         }
    151                         else {
    152                                 setCursor(cursorNormal);
    153                         }
    154                 }
     146            if (!Main.isDisplayingMapView())
     147                    return;
     148            nearestWay = Main.map.mapView.getNearestWay(mousePos, OsmPrimitive.isUsablePredicate);
     149            if (nearestWay != null) {
     150                setCursor(cursorActive);
     151            }
     152            else {
     153                setCursor(cursorNormal);
     154            }
     155        }
    155156    }
    156157
    157         private void processMouseEvent(MouseEvent e) {
    158                 if (e != null) { mousePos = e.getPoint(); }
    159         }
     158    private void processMouseEvent(MouseEvent e) {
     159        if (e != null) { mousePos = e.getPoint(); }
     160    }
    160161
    161162    private void setCursor(final Cursor c) {
     
    165166            // We invoke this to prevent strange things from happening
    166167            EventQueue.invokeLater(new Runnable() {
     168                @Override
    167169                public void run() {
    168170                    // Don't change cursor when mode has changed already
Note: See TracChangeset for help on using the changeset viewer.