Changeset 26455 in osm for applications/editors/josm/plugins/FastDraw/src
- Timestamp:
- 2011-08-05T10:05:38+02:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FDSettings.java
r26311 r26455 23 23 public double maxPointsPerKm; 24 24 public int pkmBlockSize; 25 public boolean drawLastSegment; 25 26 26 27 public void loadPrefs() { … … 37 38 maxPointsPerKm = Main.pref.getDouble("fastdraw.maxpkm", 20); 38 39 pkmBlockSize = Main.pref.getInteger("fastdraw.pkmblocksize", 10); 40 drawLastSegment = Main.pref.getBoolean("fastdraw.drawlastsegment", true); 39 41 } 40 42 … … 52 54 Main.pref.putDouble("fastdraw.maxpkm",maxPointsPerKm); 53 55 Main.pref.putInteger("fastdraw.pkmblocksize",pkmBlockSize); 56 Main.pref.put("fastdraw.drawlastsegment",drawLastSegment); 54 57 try {Main.pref.save();} catch (IOException e) { 55 58 System.err.println(tr("Can not save preferences")); -
applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FastDrawingMode.java
r26448 r26455 83 83 private List<Node> oldNodes; 84 84 85 private final TreeSet set = new TreeSet();85 private final TreeSet<Integer> set = new TreeSet<Integer>(); 86 86 private Timer timer; 87 87 … … 242 242 } 243 243 } 244 if (settings.drawLastSegment && !drawing && !shift && !line.wasSimplified()) { 245 // draw line to current point 246 g.setColor(lineColor); 247 Point lp=line.getLastPoint(); 248 Point mp=Main.map.mapView.getMousePosition(); 249 g.drawLine(lp.x,lp.y,mp.x,mp.y); 250 } 244 251 } 245 252 } … … 363 370 int nearestIdx2=line.findClosestPoint(e.getPoint(),settings.maxDist); 364 371 if (nearestIdx != nearestIdx2) {nearestIdx=nearestIdx2; updateCursor();needRepaint=true;} 372 if (settings.drawLastSegment) needRepaint=true; 365 373 366 374 if (!drawing) { … … 433 441 // more details 434 442 e.consume(); 435 changeEpsilon(settings.epsilonMult); 443 if (line.wasSimplified()) changeEpsilon(settings.epsilonMult); 444 else changeDelta(1/1.1); 436 445 break; 437 446 case KeyEvent.VK_UP: 438 447 // less details 439 448 e.consume(); 440 changeEpsilon(1/settings.epsilonMult); 449 if (line.wasSimplified()) changeEpsilon(1/settings.epsilonMult); 450 else changeDelta(1.1); 441 451 break; 442 452 case KeyEvent.VK_ESCAPE: … … 576 586 } 577 587 588 void changeDelta(double k) { 589 settings.minPixelsBetweenPoints*=k; 590 setStatusLine(tr("min distance={0} pixes",(int)settings.minPixelsBetweenPoints)); 591 592 } 593 578 594 private void setStatusLine(String tr) { 579 595 statusText=tr;
Note:
See TracChangeset
for help on using the changeset viewer.