Changeset 30710 in osm for applications/editors/josm/plugins/FastDraw/src/org/openstreetmap
- Timestamp:
- 2014-10-11T19:13:13+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/DrawnPolyLine.java
r29532 r30710 96 96 fixed.add(coor); 97 97 } 98 99 public Set<LatLon> getFixedPoints() { 100 return fixed; 101 } 102 98 103 void addLast(LatLon coor) { 99 104 if (closedFlag && lastIdx>points.size()-1) return; -
applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FastDrawConfigDialog.java
r30709 r30710 8 8 import java.text.ParseException; 9 9 import java.util.ArrayList; 10 import java.util.Collection;11 import java.util.Collections;12 10 13 11 import javax.swing.AbstractAction; … … 30 28 public class FastDrawConfigDialog extends ExtendedDialog { 31 29 30 private final JLabel label1=new JLabel(tr("Epsilon multiplier")); 31 private final JLabel label2=new JLabel(tr("Starting Epsilon")); 32 private final JLabel label3=new JLabel(tr("Max points count per 1 km")); 33 private final JLabel label4=new JLabel(/* I18n: Combobox to select what a press to return key does */ tr("Enter key mode")); 34 private final JLabel label5=new JLabel(tr("Auto add tags")); 35 private final JFormattedTextField text1=new JFormattedTextField(NumberFormat.getInstance()); 36 private final JFormattedTextField text2=new JFormattedTextField(NumberFormat.getInstance()); 37 private final JFormattedTextField text3=new JFormattedTextField(NumberFormat.getInstance()); 38 private final JComboBox<String> combo1=new JComboBox<>(new String[]{tr("Autosimplify"), 39 tr("Simplify with initial epsilon"),tr("Save as is")}); 40 private final JCheckBox snapCb=new JCheckBox(tr("Snap to nodes")); 41 private final JCheckBox fixedClickCb = new JCheckBox(tr("Add fixed points on click")); 42 private final JCheckBox fixedSpaceCb = new JCheckBox(tr("Add fixed points on spacebar")); 43 private final JCheckBox drawClosedCb = new JCheckBox(tr("Draw closed polygons only")); 44 private final HistoryComboBox addTags = new HistoryComboBox(); 45 private final FDSettings settings; 46 32 47 public FastDrawConfigDialog(FDSettings settings) { 33 48 super(Main.parent,tr("FastDraw configuration"),new String[] {tr("Ok"), tr("Cancel")}); 49 this.settings = settings; 50 34 51 JPanel all = new JPanel(); 35 52 GridBagLayout layout = new GridBagLayout(); 36 53 all.setLayout(layout); 37 38 JLabel label1=new JLabel(tr("Epsilon multiplier"));39 JLabel label2=new JLabel(tr("Starting Epsilon"));40 JLabel label3=new JLabel(tr("Max points count per 1 km"));41 JLabel label4=new JLabel(/* I18n: Combobox to select what a press to return key does */ tr("Enter key mode"));42 JLabel label5=new JLabel(tr("Auto add tags"));43 JFormattedTextField text1=new JFormattedTextField(NumberFormat.getInstance());44 JFormattedTextField text2=new JFormattedTextField(NumberFormat.getInstance());45 JFormattedTextField text3=new JFormattedTextField(NumberFormat.getInstance());46 // JComboBox combo1=new JComboBox(new String[]{tr("Autosimplify and wait"),47 // tr("Autosimplify and save"),tr("Simplify and wait"),tr("Simplify and save"),48 // tr("Save as is")});49 JComboBox<String> combo1=new JComboBox<>(new String[]{tr("Autosimplify"),50 tr("Simplify with initial epsilon"),tr("Save as is")});51 JCheckBox snapCb=new JCheckBox(tr("Snap to nodes"));52 JCheckBox fixedClickCb = new JCheckBox(tr("Add fixed points on click"));53 JCheckBox fixedSpaceCb = new JCheckBox(tr("Add fixed points on spacebar"));54 JCheckBox drawClosedCb = new JCheckBox(tr("Draw closed polygons only"));55 final HistoryComboBox addTags = new HistoryComboBox();56 54 JButton pasteButton = new JButton(new AbstractAction(tr("Paste"), ImageProvider.get("apply")) { 57 55 @Override … … 64 62 }); 65 63 pasteButton.setToolTipText(tr("Try copying tags from properties table")); 64 66 65 ArrayList<String> history = new ArrayList<>(Main.pref.getCollection("fastdraw.tags-history")); 67 66 while (history.remove("")) { }; … … 98 97 combo1.setSelectedIndex(settings.simplifyMode); 99 98 100 ExtendedDialog dialog = new ExtendedDialog(Main.parent,101 tr("FastDraw settings"),102 new String[] {tr("Ok"), tr("Cancel")}103 );104 99 setContent(all, false); 105 100 setButtonIcons(new String[] {"ok.png", "cancel.png"}); … … 110 105 setDefaultButton(1); 111 106 //configureContextsensitiveHelp("/Action/DownloadObject", true /* show help button */); 112 showDialog(); 113 if (dialog.getValue() == 0) { 107 } 108 109 @Override 110 public ExtendedDialog showDialog() { 111 ExtendedDialog result = super.showDialog(); 112 if (getValue() == 0) { 114 113 try { 115 settings.epsilonMult=NumberFormat.getInstance().parse(text1.getText()).doubleValue();116 settings.startingEps=NumberFormat.getInstance().parse(text2.getText()).doubleValue();117 settings.maxPointsPerKm=NumberFormat.getInstance().parse(text3.getText()).doubleValue();118 settings.snapNodes=snapCb.isSelected();119 settings.fixedClick=fixedClickCb.isSelected();120 settings.fixedSpacebar=fixedSpaceCb.isSelected();121 settings.drawClosed=drawClosedCb.isSelected();122 settings.simplifyMode=combo1.getSelectedIndex();123 settings.autoTags=addTags.getText();124 if (!settings.autoTags.isEmpty()) {125 addTags.addCurrentItemToHistory();126 }127 Main.pref.putCollection("fastdraw.tags-history", addTags.getHistory());128 settings.savePrefs();114 settings.epsilonMult=NumberFormat.getInstance().parse(text1.getText()).doubleValue(); 115 settings.startingEps=NumberFormat.getInstance().parse(text2.getText()).doubleValue(); 116 settings.maxPointsPerKm=NumberFormat.getInstance().parse(text3.getText()).doubleValue(); 117 settings.snapNodes=snapCb.isSelected(); 118 settings.fixedClick=fixedClickCb.isSelected(); 119 settings.fixedSpacebar=fixedSpaceCb.isSelected(); 120 settings.drawClosed=drawClosedCb.isSelected(); 121 settings.simplifyMode=combo1.getSelectedIndex(); 122 settings.autoTags=addTags.getText(); 123 if (!settings.autoTags.isEmpty()) { 124 addTags.addCurrentItemToHistory(); 125 } 126 Main.pref.putCollection("fastdraw.tags-history", addTags.getHistory()); 127 settings.savePrefs(); 129 128 } catch (ParseException e) { 130 129 JOptionPane.showMessageDialog(Main.parent, … … 132 131 } 133 132 } 134 133 return result; 134 135 135 } 136 136 -
applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FastDrawingMode.java
r30709 r30710 7 7 package org.openstreetmap.josm.plugins.fastdraw; 8 8 9 import java.awt.AWTEvent;10 9 import java.awt.Color; 11 import java.awt.Component;12 10 import java.awt.Cursor; 13 11 import java.awt.Graphics2D; 14 import java.awt.KeyboardFocusManager;15 12 import java.awt.Point; 16 import java.awt.Toolkit; 17 import java.awt.event.*; 18 import java.util.*; 19 import javax.swing.JFrame; 13 import java.awt.event.KeyEvent; 14 import java.awt.event.MouseEvent; 15 import java.util.ArrayList; 16 import java.util.Collection; 17 import java.util.HashSet; 18 import java.util.Iterator; 19 import java.util.LinkedList; 20 import java.util.List; 21 import java.util.Map; 22 import java.util.Set; 20 23 import javax.swing.JOptionPane; 21 import javax.swing.SwingUtilities;22 import javax.swing.Timer;23 24 24 25 import org.openstreetmap.josm.Main; … … 31 32 import org.openstreetmap.josm.data.Bounds; 32 33 import org.openstreetmap.josm.data.coor.LatLon; 33 import org.openstreetmap.josm.data.osm.Tag;34 34 import org.openstreetmap.josm.data.osm.Node; 35 35 import org.openstreetmap.josm.data.osm.OsmPrimitive; 36 import org.openstreetmap.josm.data.osm.Tag; 36 37 import org.openstreetmap.josm.data.osm.Way; 37 38 import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil; … … 41 42 import org.openstreetmap.josm.gui.layer.MapViewPaintable; 42 43 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 44 import org.openstreetmap.josm.gui.util.KeyPressReleaseListener; 45 import org.openstreetmap.josm.gui.util.ModifierListener; 46 import static org.openstreetmap.josm.tools.I18n.tr; 43 47 import org.openstreetmap.josm.tools.ImageProvider; 44 48 import org.openstreetmap.josm.tools.Shortcut; 45 49 import org.openstreetmap.josm.tools.TextTagParser; 46 50 47 import static org.openstreetmap.josm.tools.I18n.tr;48 49 51 class FastDrawingMode extends MapMode implements MapViewPaintable, 50 AWTEventListener {52 KeyPressReleaseListener, ModifierListener { 51 53 private static final String SIMPLIFYMODE_MESSAGE= 52 54 tr("Q=Options, Enter=save, Ctrl-Enter=save with tags, Up/Down=tune"); … … 56 58 private FDSettings settings; 57 59 58 private DrawnPolyLine line;60 private final DrawnPolyLine line; 59 61 private MapView mv; 60 62 private String statusText; 61 63 private boolean drawing; 62 private boolean ctrl;63 private boolean shift;64 64 private double eps; 65 65 private final Cursor cursorDraw; … … 70 70 private final Cursor cursorDrawing; 71 71 private boolean nearSomeNode; 72 private LatLon highlighted ;73 private int nearest Idx;72 private LatLon highlightedFragmentStart; 73 private int nearestPointIndex; 74 74 private int dragNode=-1; 75 75 private SequenceCommand delCmd; 76 76 private List<Node> oldNodes; 77 77 78 private final TreeSet<Integer> set = new TreeSet<Integer>();79 private Timer timer;80 81 private KeyEvent releaseEvent;82 78 private boolean lineWasSaved; 83 79 private boolean deltaChanged; 84 /**85 * used for skipping keyboard AWTTevents while dialogs are active86 */87 private boolean listenKeys = false;88 80 89 81 FastDrawingMode(MapFrame mapFrame) { … … 121 113 Main.map.mapView.addMouseMotionListener(this); 122 114 Main.map.mapView.addTemporaryLayer(this); 123 124 //tryToLoadWay(); 125 126 timer = new Timer(0, new ActionListener() { 127 @Override 128 public void actionPerformed(ActionEvent ae) { 129 timer.stop(); 130 if (set.remove(releaseEvent.getKeyCode())) { 131 doKeyReleaseEvent(releaseEvent); 132 } 133 } 134 }); 135 136 listenKeys = true; 137 try { 138 Toolkit.getDefaultToolkit().addAWTEventListener(this, 139 AWTEvent.KEY_EVENT_MASK); 140 } catch (SecurityException ex) { 141 } 115 116 Main.map.keyDetector.addKeyListener(this); 117 Main.map.keyDetector.addModifierListener(this); 142 118 } 143 119 … … 151 127 152 128 Main.map.mapView.removeTemporaryLayer(this); 153 154 try { 155 Toolkit.getDefaultToolkit().removeAWTEventListener(this); 156 } catch (SecurityException ex) { 157 } 129 130 Main.map.keyDetector.removeKeyListener(this); 131 Main.map.keyDetector.removeModifierListener(this); 132 158 133 settings.savePrefs(); 159 134 Main.map.mapView.setCursor(cursorDraw); … … 171 146 } 172 147 148 private final ArrayList<Point> fixedPoints =new ArrayList<>(3000); // tamporyrary storate for paint 149 173 150 ////////// Event listener methods 174 175 151 @Override 176 152 public void paint(Graphics2D g, MapView mv, Bounds bbox) { … … 198 174 dp=line.wasSimplified() ? settings.bigDotSize : settings.dotSize; rp=dp/2; 199 175 if (pts.size() > 1) { 200 Iterator<LatLon> it1,it2; 201 it1=pts.listIterator(0); 202 it2=pts.listIterator(1); 203 for (int i = 0; i < pts.size() - 1; i++) { 176 Iterator<LatLon> it1,it2; 177 it1=pts.listIterator(0); 178 it2=pts.listIterator(1); 179 fixedPoints.clear(); 180 for (int i = 0; i < pts.size() - 1; i++) { 204 181 pp1 = it1.next(); 205 182 p1 = line.getPoint(pp1); 206 183 pp2 = it2.next(); 207 184 p2 = line.getPoint(pp2); 208 if (shift && highlighted ==pp1 && nearestIdx<0) {lineColor=settings.COLOR_SELECTEDFRAGMENT;}185 if (shift && highlightedFragmentStart==pp1 && nearestPointIndex<0) {lineColor=settings.COLOR_SELECTEDFRAGMENT;} 209 186 if (!shift && line.isLastPoint(i)) { lineColor=settings.COLOR_EDITEDFRAGMENT; } 210 187 g.setColor(lineColor); 211 188 g.drawLine(p1.x, p1.y, p2.x, p2.y); 212 if (line.isFixed(pp2)) { 189 if (line.isFixed(pp2)) { 213 190 lineColor=initLineColor; 214 g.setColor(settings.COLOR_FIXED); 215 g.fillOval(p2.x - bigDotSize/2, p2.y - bigDotSize/2, bigDotSize, bigDotSize); 191 fixedPoints.add(p2); 216 192 } else { 217 193 g.fillRect(p2.x - rp, p2.y - rp, dp, dp); 218 194 } 219 195 if (!drawing) { 220 if (!line.wasSimplified() && nearest Idx==i+1 ) {196 if (!line.wasSimplified() && nearestPointIndex==i+1 ) { 221 197 if (shift) { 222 198 // highlight node to delete … … 236 212 } 237 213 } 214 g.setColor(settings.COLOR_FIXED); 215 for (Point p: fixedPoints) { 216 g.fillOval(p.x - bigDotSize/2, p.y - bigDotSize/2, bigDotSize, bigDotSize); 217 } 238 218 } 239 219 if (settings.drawLastSegment && !drawing && dragNode<0 && !shift && 240 nearest Idx<=0 && !line.wasSimplified()) {220 nearestPointIndex<=0 && !line.wasSimplified()) { 241 221 // draw line to current point 242 222 g.setColor(lineColor); … … 253 233 } 254 234 255 @Override256 public void eventDispatched(AWTEvent event) {257 if (!listenKeys || Main.map == null || Main.map.mapView == null258 || !Main.map.mapView.isActiveLayerDrawable()) {259 return;260 }261 updateKeyModifiers((InputEvent) event);262 if (event instanceof KeyEvent) {263 KeyEvent e=(KeyEvent) event;264 265 if (event.getID() == KeyEvent.KEY_PRESSED) {266 if (timer.isRunning()) {267 timer.stop();268 } else {269 set.add((e.getKeyCode()));270 }271 // check if key press is done in main window, not in dialogs272 Component focused = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();273 if (SwingUtilities.getWindowAncestor(focused) instanceof JFrame) {274 doKeyEvent((KeyEvent) event);275 }276 }277 if (event.getID() == KeyEvent.KEY_RELEASED) {278 if (timer.isRunning()) {279 timer.stop();280 if (set.remove(e.getKeyCode())) {281 doKeyReleaseEvent(e);282 }283 } else {284 releaseEvent = e;285 timer.restart();286 }287 }288 }289 }290 235 291 236 @Override … … 293 238 if (!isEnabled()) return; 294 239 if (e.getButton() != MouseEvent.BUTTON1) return; 240 updateKeyModifiers(e); 295 241 296 242 requestFocusInMapView(); … … 309 255 if (ctrl && shift) {newDrawing();repaint();return;} 310 256 if (!ctrl && shift) { 311 if (idx>=0) {line.deleteNode(idx); nearest Idx=-1;}257 if (idx>=0) {line.deleteNode(idx); nearestPointIndex=-1;} 312 258 else line.tryToDeleteSegment(e.getPoint()); 313 259 return; … … 364 310 dragNode = -1; 365 311 drawing = false; 366 highlighted =null;312 highlightedFragmentStart=null; 367 313 if (!line.isClosed()) setStatusLine(DRAWINGMODE_MESSAGE); 368 314 updateCursor(); … … 378 324 public void mouseMoved(MouseEvent e) { 379 325 if (!isEnabled()) return; 326 updateKeyModifiers(e); 380 327 deltaChanged=false; 381 328 Node nd1 = getNearestNode(e.getPoint(), settings.maxDist); 382 329 boolean nearSomeNode2=nd1!=null; 383 330 boolean needRepaint=false; 384 if (nearSomeNode!=nearSomeNode2) {nearSomeNode=nearSomeNode2;updateCursor();needRepaint=true;} 331 if (nearSomeNode!=nearSomeNode2) { 332 nearSomeNode=nearSomeNode2; 333 updateCursor(); 334 needRepaint=true; 335 } 385 336 386 337 int nearestIdx2=line.findClosestPoint(e.getPoint(),settings.maxDist); 387 if (nearestIdx != nearestIdx2) {nearestIdx=nearestIdx2; updateCursor();needRepaint=true;} 388 if (settings.drawLastSegment) needRepaint=true; 338 if (nearestPointIndex != nearestIdx2) { 339 nearestPointIndex=nearestIdx2; 340 updateCursor(); 341 needRepaint=true; 342 } 343 if (settings.drawLastSegment) { 344 needRepaint=true; 345 } 389 346 390 347 if (!drawing) { … … 395 352 } 396 353 397 if (shift ) {354 if (shift && nearestPointIndex == -1) { 398 355 // find line fragment to highlight 399 356 LatLon h2=line.findBigSegment(e.getPoint()); 400 if (highlighted!=h2) { highlighted=h2; repaint(); } 401 } else if (needRepaint) { 357 if (highlightedFragmentStart!=h2) { 358 highlightedFragmentStart=h2; 359 needRepaint=true; 360 } 361 } 362 363 if (needRepaint) { 402 364 repaint(); 403 365 } … … 407 369 408 370 // do not draw points close to existing points - we do not want self-intersections 409 if (nearest Idx>=0) { return; }371 if (nearestPointIndex>=0) { return; } 410 372 411 373 Point lastP = line.getLastPoint(); // last point of line fragment being edited … … 428 390 } 429 391 430 private void doKeyEvent(KeyEvent e) { 392 @Override 393 public void doKeyPressed(KeyEvent e) { 431 394 if (getShortcut().isEvent(e)) { // repeated press 432 395 tryToLoadWay(); … … 486 449 if (lastPoint==null || lastPoint.equals(line.getLastPoint())) { 487 450 if (line.getPoints().size()>5) { 488 // no key events while the dialog is active!489 listenKeys = false;490 451 boolean answer = ConditionalOptionPaneUtil.showConfirmationDialog( 491 452 "delete_drawn_line", Main.parent, … … 493 454 line.getPoints().size()), tr("Delete confirmation"), 494 455 JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, JOptionPane.YES_OPTION ); 495 listenKeys = true;496 456 if(!answer) break; 497 457 } … … 503 463 504 464 case KeyEvent.VK_I: 505 listenKeys = false;506 465 JOptionPane.showMessageDialog(Main.parent, 507 tr("{0} m - length of the line\n{1} nodes\n{2} points per km (maximum)\n{3} points per km (average)", 508 line.getLength(),line.getPoints().size(),line.getNodesPerKm(settings.pkmBlockSize), 509 line.getNodesPerKm(1000000)), 510 tr("Line information"),JOptionPane.INFORMATION_MESSAGE); 511 listenKeys = true; 466 tr("{0} m - length of the line\n{1} nodes\n{2} points per km (maximum)\n{3} points per km (average)", 467 line.getLength(),line.getPoints().size(),line.getNodesPerKm(settings.pkmBlockSize), 468 line.getNodesPerKm(1000000)), 469 tr("Line information"),JOptionPane.INFORMATION_MESSAGE); 512 470 break; 513 471 case KeyEvent.VK_Q: 514 472 // less details 515 473 e.consume(); 516 try { 517 listenKeys = false; 518 new FastDrawConfigDialog(settings); 519 if (line.wasSimplified()) { 474 new FastDrawConfigDialog(settings).showDialog(); 475 if (line.wasSimplified()) { 520 476 eps = line.autoSimplify(settings.startingEps, settings.epsilonMult, settings.pkmBlockSize,settings.maxPointsPerKm); 521 477 showSimplifyHint(); 522 } 523 //System.out.println("final eps="+eps); 524 listenKeys = true; 525 } catch (SecurityException ex) { } 478 } 526 479 repaint(); 527 480 break; … … 536 489 } 537 490 538 private void doKeyReleaseEvent(KeyEvent keyEvent) { 539 //System.out.println("released "+keyEvent); 540 if (keyEvent.getKeyCode()==KeyEvent.VK_SPACE) stopDrawing(); 541 updateCursor(); 542 } 543 /** 544 * Updates shift and ctrl key states 545 */ 546 protected void updateKeyModifiers(InputEvent e) { 547 ctrl = (e.getModifiers() & ActionEvent.CTRL_MASK) != 0; 548 shift = (e.getModifiers() & ActionEvent.SHIFT_MASK) != 0; 491 @Override 492 public void doKeyReleased(KeyEvent keyEvent) { 493 //System.out.println("released "+keyEvent); 494 if (keyEvent.getKeyCode()==KeyEvent.VK_SPACE) stopDrawing(); 549 495 updateCursor(); 550 496 } 551 497 498 @Override 499 public void modifiersChanged(int modifiers) { 500 updateKeyModifiers(modifiers); 501 updateCursor(); 502 } 503 552 504 @Override 553 505 protected void updateStatusLine() { … … 572 524 if (line.isClosed() && n==3) pts.remove(2); // two-point way can not be closed 573 525 574 Collection<Command> cmds = new LinkedList< Command>();526 Collection<Command> cmds = new LinkedList<>(); 575 527 int i = 0; 576 528 Way w = new Way(); … … 579 531 580 532 for (LatLon p : pts) { 581 Node nd=null; 582 583 nd = Main.map.mapView.getNearestNode(line.getPoint(p), OsmPrimitive.isSelectablePredicate); 533 Node nd = Main.map.mapView.getNearestNode(line.getPoint(p), OsmPrimitive.isSelectablePredicate); 584 534 // there may be a node with the same coords! 585 535 586 536 if (nd!=null && p.greatCircleDistance(nd.getCoor())>0.01) nd=null; 587 537 if (nd==null) { 588 if (i>0 && p.equals(first)) nd=firstNode; else { 538 if (i>0 && p.equals(first)) { 539 nd=firstNode; 540 } else { 589 541 nd = new Node(p); 590 542 cmds.add(new AddCommand(nd)); … … 596 548 return; 597 549 } 598 if (i==0) firstNode=nd; 550 if (i==0) { 551 firstNode=nd; 552 } 599 553 w.addNode(nd); 600 554 i++; … … 602 556 if (ctrl) { 603 557 // paste tags - from ctrl-shift-v 604 Set <OsmPrimitive> ts = new HashSet< OsmPrimitive>();558 Set <OsmPrimitive> ts = new HashSet<>(); 605 559 ts.add(w); 606 560 TagPaster tp = new TagPaster(Main.pasteBuffer.getDirectlyAdded(), ts); … … 684 638 685 639 private void loadFromWay(Way w) { 686 Collection<Command> cmds = new LinkedList< Command>();640 Collection<Command> cmds = new LinkedList<>(); 687 641 688 642 Object[] nodes = w.getNodes().toArray(); … … 695 649 if (w.isClosed()) line.closeLine(); 696 650 oldNodes = w.getNodes(); 697 List <OsmPrimitive> wl = new ArrayList< OsmPrimitive>(); wl.add(w);651 List <OsmPrimitive> wl = new ArrayList<>(); wl.add(w); 698 652 699 653 Command c = DeleteCommand.delete(getEditLayer(), wl, false); … … 716 670 private void updateCursor() { 717 671 if (shift) Main.map.mapView.setCursor(cursorShift); else 718 if (line.isClosed() || (nearest Idx==0)) Main.map.mapView.setCursor(cursorReady); else672 if (line.isClosed() || (nearestPointIndex==0)) Main.map.mapView.setCursor(cursorReady); else 719 673 if (ctrl) Main.map.mapView.setCursor(cursorCtrl); else 720 674 if (nearSomeNode && settings.snapNodes) Main.map.mapView.setCursor(cursorCtrl); else
Note:
See TracChangeset
for help on using the changeset viewer.