Changeset 2655 in josm for trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
- Timestamp:
- 2009-12-19T10:47:49+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r2558 r2655 30 30 import java.util.Map; 31 31 import java.util.Set; 32 import java.util.logging.Logger;33 32 34 33 import javax.swing.JComponent; … … 62 61 */ 63 62 public class DrawAction extends MapMode implements MapViewPaintable, SelectionChangedListener, AWTEventListener { 64 static private final Logger logger = Logger.getLogger(DrawAction.class.getName());63 //static private final Logger logger = Logger.getLogger(DrawAction.class.getName()); 65 64 66 65 final private Cursor cursorCrosshair; … … 70 69 private Cursors currCursor = Cursors.crosshair; 71 70 72 private staticNode lastUsedNode = null;71 private Node lastUsedNode = null; 73 72 private double PHI=Math.toRadians(90); 74 73 … … 119 118 if(currCursor.equals(c) || (!drawTargetCursor && currCursor.equals(Cursors.crosshair))) 120 119 return; 121 try { 122 // We invoke this to prevent strange things from happening 123 EventQueue.invokeLater(new Runnable() { 124 public void run() { 125 // Don't change cursor when mode has changed already 126 if(!(Main.map.mapMode instanceof DrawAction)) 127 return; 128 switch(c) { 129 case way: 130 Main.map.mapView.setCursor(cursorJoinWay); 131 break; 132 case node: 133 Main.map.mapView.setCursor(cursorJoinNode); 134 break; 135 default: 136 Main.map.mapView.setCursor(cursorCrosshair); 137 break; 138 } 139 } 140 }); 141 currCursor = c; 142 } catch(Exception e) {} 120 // We invoke this to prevent strange things from happening 121 EventQueue.invokeLater(new Runnable() { 122 public void run() { 123 // Don't change cursor when mode has changed already 124 if(!(Main.map.mapMode instanceof DrawAction)) 125 return; 126 switch(c) { 127 case way: 128 Main.map.mapView.setCursor(cursorJoinWay); 129 break; 130 case node: 131 Main.map.mapView.setCursor(cursorJoinNode); 132 break; 133 default: 134 Main.map.mapView.setCursor(cursorCrosshair); 135 break; 136 } 137 } 138 }); 139 currCursor = c; 143 140 } 144 141 … … 975 972 */ 976 973 if (getCurrentDataSet() != null && getCurrentDataSet().getSelectedWays().size() > 0 && !wayIsFinished && !alt) { 977 Way w = (Way)getCurrentDataSet().getSelectedWays().iterator().next();974 Way w = getCurrentDataSet().getSelectedWays().iterator().next(); 978 975 for (Node m : w.getNodes()) { 979 976 if (m.equals(mouseOnExistingNode) || mouseOnExistingWays.contains(w)) {
Note:
See TracChangeset
for help on using the changeset viewer.