Changeset 26455 in osm
- Timestamp:
- 2011-08-05T10:05:38+02:00 (13 years ago)
- Location:
- applications/editors/josm/plugins/FastDraw
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/FastDraw/build.xml
r26448 r26455 30 30 <project name="FastDraw" default="dist" basedir="."> 31 31 <!-- enter the SVN commit message --> 32 <property name="commit.message" value="FastDraw: better linux compatibility"/>32 <property name="commit.message" value="FastDraw: draw last line segment, up/down=change minDelta"/> 33 33 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 34 34 <property name="plugin.main.version" value="4201"/> -
applications/editors/josm/plugins/FastDraw/nbproject
-
Property svn:ignore
set to
private
-
Property svn:ignore
set to
-
applications/editors/josm/plugins/FastDraw/nbproject/project.xml
r26448 r26455 16 16 <ide-actions> 17 17 <action name="build"> 18 <target> dist</target>18 <target>compile</target> 19 19 </action> 20 20 <action name="clean"> … … 26 26 <action name="rebuild"> 27 27 <target>clean</target> 28 <target>dist</target> 28 <target>compile</target> 29 </action> 30 <action name="debug"> 31 <script>nbproject/ide-targets.xml</script> 32 <target>debug-nb</target> 29 33 </action> 30 34 </ide-actions> 35 <export> 36 <type>jar</type> 37 <location>../../dist/FastDraw.jar</location> 38 <build-target>compile</build-target> 39 </export> 31 40 <view> 32 41 <items> … … 44 53 <ide-action name="clean"/> 45 54 <ide-action name="run"/> 55 <ide-action name="debug"/> 46 56 </context-menu> 47 57 </view> … … 51 61 <package-root>src</package-root> 52 62 <classpath mode="compile">../../core/src</classpath> 63 <built-to>../../dist/FastDraw.jar</built-to> 53 64 <source-level>1.6</source-level> 54 65 </compilation-unit> -
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.