Changeset 32779 in osm for applications/editors/josm/plugins/CommandLine/src/CommandLine/AnyAction.java
- Timestamp:
- 2016-08-08T00:01:16+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/CommandLine/src/CommandLine/AnyAction.java
r32416 r32779 1 /* 2 * AnyAction.java 3 * 4 * Copyright 2010 Hind <foxhind@gmail.com> 5 * 6 */ 7 1 // License: GPL. For details, see LICENSE file. 8 2 package CommandLine; 9 3 … … 26 20 public class AnyAction extends MapMode implements AWTEventListener { 27 21 private final CommandLine parentPlugin; 28 finalprivate Cursor cursorNormal, cursorActive;22 private final Cursor cursorNormal, cursorActive; 29 23 private Cursor currentCursor; 30 24 private Point mousePos; … … 49 43 Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.KEY_EVENT_MASK); 50 44 } catch (SecurityException ex) { 45 Main.warn(ex); 51 46 } 52 47 } … … 59 54 Toolkit.getDefaultToolkit().removeAWTEventListener(this); 60 55 } catch (SecurityException ex) { 56 Main.warn(ex); 61 57 } 62 58 } … … 99 95 ds.addSelected(nearestPrimitive); 100 96 Main.map.mapView.repaint(); 101 } 102 else 97 } else 103 98 Main.info("Maximum instances!"); 104 99 } … … 124 119 if (!Main.isDisplayingMapView()) 125 120 return; 126 nearestPrimitive = Main.map.mapView.getNearestNodeOrWay(mousePos, OsmPrimitive .isUsablePredicate, false);121 nearestPrimitive = Main.map.mapView.getNearestNodeOrWay(mousePos, OsmPrimitive::isUsable, false); 127 122 if (nearestPrimitive != null) { 128 123 setCursor(cursorActive); 129 } 130 else { 124 } else { 131 125 setCursor(cursorNormal); 132 126 } … … 135 129 136 130 private void processMouseEvent(MouseEvent e) { 137 if (e != null) { mousePos = e.getPoint(); } 131 if (e != null) { 132 mousePos = e.getPoint(); 133 } 138 134 } 139 135 … … 154 150 currentCursor = c; 155 151 } catch (Exception e) { 152 Main.warn(e); 156 153 } 157 154 }
Note:
See TracChangeset
for help on using the changeset viewer.