Changeset 29769 in osm for applications/editors/josm/plugins/CommandLine/src
- Timestamp:
- 2013-07-24T18:01:58+02:00 (12 years ago)
- 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 107 107 } 108 108 109 @Override 109 110 public void eventDispatched(AWTEvent arg0) { 110 111 112 111 if (!(arg0 instanceof KeyEvent)) 112 return; 113 KeyEvent ev = (KeyEvent) arg0; 113 114 isCtrlDown = (ev.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0; 114 115 if (ev.getKeyCode() == KeyEvent.VK_ESCAPE && ev.getID() == KeyEvent.KEY_PRESSED) { … … 142 143 // We invoke this to prevent strange things from happening 143 144 EventQueue.invokeLater(new Runnable() { 145 @Override 144 146 public void run() { 145 147 // Don't change cursor when mode has changed already -
applications/editors/josm/plugins/CommandLine/src/CommandLine/CommandLine.java
r29566 r29769 190 190 191 191 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)); 194 195 } 195 196 loadCommands(); -
applications/editors/josm/plugins/CommandLine/src/CommandLine/DummyAction.java
r29505 r29769 18 18 19 19 public class DummyAction extends MapMode implements AWTEventListener { 20 20 private CommandLine parentPlugin; 21 21 22 23 24 25 22 public DummyAction(MapFrame mapFrame, CommandLine parentPlugin) { 23 super(null, "addsegment.png", null, mapFrame, ImageProvider.getCursor("normal", null)); 24 this.parentPlugin = parentPlugin; 25 } 26 26 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; 31 32 if (ev.getKeyCode() == KeyEvent.VK_ESCAPE && ev.getID() == KeyEvent.KEY_PRESSED) { 32 33 ev.consume(); -
applications/editors/josm/plugins/CommandLine/src/CommandLine/Loader.java
r29505 r29769 67 67 } 68 68 69 @Override 69 70 public void startElement(String namespaceURI, String localName, String rawName, Attributes attrs) { 70 71 int len = attrs.getLength(); … … 125 126 } 126 127 128 @Override 127 129 public void characters(char ch[], int start, int length) 128 130 { … … 165 167 } 166 168 169 @Override 167 170 public void warning(SAXParseException ex) { 168 171 System.err.println("Warning in command xml file " + currentFile + ": " + ex.getMessage()); 169 172 } 170 173 174 @Override 171 175 public void error(SAXParseException ex) { 172 176 System.err.println("Error in command xml file " + currentFile + ": " + ex.getMessage()); 173 177 } 174 178 179 @Override 175 180 public void fatalError(SAXParseException ex) throws SAXException { 176 181 System.err.println("Error in command xml file " + currentFile + ": " + ex.getMessage()); -
applications/editors/josm/plugins/CommandLine/src/CommandLine/NodeAction.java
r29505 r29769 109 109 } 110 110 111 @Override 111 112 public void eventDispatched(AWTEvent arg0) { 112 113 114 113 if (!(arg0 instanceof KeyEvent)) 114 return; 115 KeyEvent ev = (KeyEvent) arg0; 115 116 isCtrlDown = (ev.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0; 116 117 if (ev.getKeyCode() == KeyEvent.VK_ESCAPE && ev.getID() == KeyEvent.KEY_PRESSED) { … … 144 145 // We invoke this to prevent strange things from happening 145 146 EventQueue.invokeLater(new Runnable() { 147 @Override 146 148 public void run() { 147 149 // Don't change cursor when mode has changed already -
applications/editors/josm/plugins/CommandLine/src/CommandLine/PointAction.java
r29505 r29769 120 120 } 121 121 122 @Override 122 123 public void eventDispatched(AWTEvent arg0) { 123 124 if (!(arg0 instanceof KeyEvent)) … … 157 158 // We invoke this to prevent strange things from happening 158 159 EventQueue.invokeLater(new Runnable() { 160 @Override 159 161 public void run() { 160 162 // Don't change cursor when mode has changed already -
applications/editors/josm/plugins/CommandLine/src/CommandLine/RelationAction.java
r29505 r29769 25 25 } 26 26 27 @Override 27 28 public void eventDispatched(AWTEvent arg0) { 28 29 if (!(arg0 instanceof KeyEvent)) -
applications/editors/josm/plugins/CommandLine/src/CommandLine/WayAction.java
r29505 r29769 130 130 } 131 131 132 @Override 132 133 public void eventDispatched(AWTEvent arg0) { 133 134 135 134 if (!(arg0 instanceof KeyEvent)) 135 return; 136 KeyEvent ev = (KeyEvent) arg0; 136 137 isCtrlDown = (ev.getModifiersEx() & KeyEvent.CTRL_DOWN_MASK) != 0; 137 138 if (ev.getKeyCode() == KeyEvent.VK_ESCAPE && ev.getID() == KeyEvent.KEY_PRESSED) { … … 143 144 private void updCursor() { 144 145 if (mousePos != null) { 145 146 147 148 149 150 151 152 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 } 155 156 } 156 157 157 158 159 158 private void processMouseEvent(MouseEvent e) { 159 if (e != null) { mousePos = e.getPoint(); } 160 } 160 161 161 162 private void setCursor(final Cursor c) { … … 165 166 // We invoke this to prevent strange things from happening 166 167 EventQueue.invokeLater(new Runnable() { 168 @Override 167 169 public void run() { 168 170 // Don't change cursor when mode has changed already
Note:
See TracChangeset
for help on using the changeset viewer.