Changeset 33731 in osm for applications
- Timestamp:
- 2017-10-25T20:45:52+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/FastDraw
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/FastDraw
- Property svn:ignore
-
old new 4 4 checkstyle-josm-FastDraw.xml 5 5 findbugs-josm-FastDraw.xml 6 spotbugs-josm-FastDraw.xml
-
- Property svn:ignore
-
applications/editors/josm/plugins/FastDraw/build.xml
r33583 r33731 4 4 <property name="commit.message" value="[josm_fastdraw] Fix incorrect settings saving-2"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="12 683"/>6 <property name="plugin.main.version" value="12987"/> 7 7 8 8 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FDSettings.java
r32930 r33731 9 9 10 10 import org.openstreetmap.josm.Main; 11 import org.openstreetmap.josm.data.preferences. ColorProperty;11 import org.openstreetmap.josm.data.preferences.NamedColorProperty; 12 12 import org.openstreetmap.josm.gui.util.GuiHelper; 13 import org.openstreetmap.josm.tools.Logging; 13 14 14 15 public class FDSettings { 15 public ColorProperty COLOR_FIXED = newColorProperty("fastdraw.color.delete", Color.red);16 public ColorProperty COLOR_NORMAL = newColorProperty("fastdraw.color.edit", Color.orange);17 public ColorProperty COLOR_DELETE = newColorProperty("fastdraw.color.fixed", Color.green);18 public ColorProperty COLOR_SELECTEDFRAGMENT = newColorProperty("fastdraw.color.normal", Color.red);19 public ColorProperty COLOR_EDITEDFRAGMENT = newColorProperty("fastdraw.color.select", Color.blue);20 public ColorProperty COLOR_SIMPLIFIED = newColorProperty("fastdraw.color.simplified", Color.orange);16 public NamedColorProperty COLOR_FIXED = new NamedColorProperty("fastdraw.color.delete", Color.red); 17 public NamedColorProperty COLOR_NORMAL = new NamedColorProperty("fastdraw.color.edit", Color.orange); 18 public NamedColorProperty COLOR_DELETE = new NamedColorProperty("fastdraw.color.fixed", Color.green); 19 public NamedColorProperty COLOR_SELECTEDFRAGMENT = new NamedColorProperty("fastdraw.color.normal", Color.red); 20 public NamedColorProperty COLOR_EDITEDFRAGMENT = new NamedColorProperty("fastdraw.color.select", Color.blue); 21 public NamedColorProperty COLOR_SIMPLIFIED = new NamedColorProperty("fastdraw.color.simplified", Color.orange); 21 22 22 23 public double maxDist; … … 56 57 simplifiedStroke = GuiHelper.getCustomizedStroke(Main.pref.get("fastdraw.stroke.simplified", "2")); 57 58 58 bigDotSize = Main.pref.getInt eger("fastdraw.point.bigsize", 7);59 dotSize = Main.pref.getInt eger("fastdraw.point.normalsize", 5);59 bigDotSize = Main.pref.getInt("fastdraw.point.bigsize", 7); 60 dotSize = Main.pref.getInt("fastdraw.point.normalsize", 5); 60 61 61 62 maxDist = Main.pref.getDouble("fastdraw.maxdist", 5); … … 65 66 startingEps = Main.pref.getDouble("fastdraw.startingEps", 5); 66 67 maxPointsPerKm = Main.pref.getDouble("fastdraw.maxpkm", 150); 67 pkmBlockSize = Main.pref.getInt eger("fastdraw.pkmblocksize", 10);68 pkmBlockSize = Main.pref.getInt("fastdraw.pkmblocksize", 10); 68 69 drawLastSegment = Main.pref.getBoolean("fastdraw.drawlastsegment", true); 69 70 snapNodes = Main.pref.getBoolean("fastdraw.snapnodes", true); … … 71 72 fixedSpacebar = Main.pref.getBoolean("fastdraw.fixedspacebar", false); 72 73 drawClosed = Main.pref.getBoolean("fastdraw.drawclosed", false); 73 simplifyMode = Main.pref.getInt eger("fastdraw.simplifymode", 0) % 3;74 simplifyMode = Main.pref.getInt("fastdraw.simplifymode", 0) % 3; 74 75 allowEditExistingWays = Main.pref.getBoolean("fastdraw.alloweditexisting", false); 75 76 … … 84 85 Main.pref.putDouble("fastdraw.startingEps", startingEps); 85 86 Main.pref.putDouble("fastdraw.maxpkm", maxPointsPerKm); 86 Main.pref.putInt eger("fastdraw.pkmblocksize", pkmBlockSize);87 Main.pref.put ("fastdraw.drawlastsegment", drawLastSegment);88 Main.pref.put ("fastdraw.snapnodes", snapNodes);89 Main.pref.put ("fastdraw.fixedclick", fixedClick);90 Main.pref.put ("fastdraw.fixedspacebar", fixedSpacebar);91 Main.pref.put ("fastdraw.drawclosed", drawClosed);92 Main.pref.putInt eger("fastdraw.simplifymode", simplifyMode);87 Main.pref.putInt("fastdraw.pkmblocksize", pkmBlockSize); 88 Main.pref.putBoolean("fastdraw.drawlastsegment", drawLastSegment); 89 Main.pref.putBoolean("fastdraw.snapnodes", snapNodes); 90 Main.pref.putBoolean("fastdraw.fixedclick", fixedClick); 91 Main.pref.putBoolean("fastdraw.fixedspacebar", fixedSpacebar); 92 Main.pref.putBoolean("fastdraw.drawclosed", drawClosed); 93 Main.pref.putInt("fastdraw.simplifymode", simplifyMode); 93 94 Main.pref.put("fastdraw.autotags", autoTags); 94 Main.pref.put ("fastdraw.alloweditexisting", allowEditExistingWays);95 Main.pref.putBoolean("fastdraw.alloweditexisting", allowEditExistingWays); 95 96 try { 96 97 Main.pref.save(); 97 98 } catch (IOException e) { 98 System.err.println(tr("Can not save preferences"));99 Logging.error(tr("Can not save preferences")); 99 100 } 100 101 } -
applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FastDrawConfigDialog.java
r33583 r33731 66 66 pasteButton.setToolTipText(tr("Try copying tags from properties table")); 67 67 68 ArrayList<String> history = new ArrayList<>(Main.pref.get Collection("fastdraw.tags-history"));68 ArrayList<String> history = new ArrayList<>(Main.pref.getList("fastdraw.tags-history")); 69 69 while (history.remove("")) { }; 70 70 addTags.setPossibleItems(history); … … 131 131 addTags.addCurrentItemToHistory(); 132 132 } 133 Main.pref.put Collection("fastdraw.tags-history", addTags.getHistory());133 Main.pref.putList("fastdraw.tags-history", addTags.getHistory()); 134 134 settings.savePrefs(); 135 135 } catch (ParseException e) { -
applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FastDrawingMode.java
r33730 r33731 29 29 import org.openstreetmap.josm.data.Bounds; 30 30 import org.openstreetmap.josm.data.coor.LatLon; 31 import org.openstreetmap.josm.data.osm.DataSet; 31 32 import org.openstreetmap.josm.data.osm.Node; 32 33 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 535 536 if (line.isClosed() && n == 3) pts.remove(2); // two-point way can not be closed 536 537 538 DataSet ds = getLayerManager().getEditDataSet(); 537 539 Collection<Command> cmds = new LinkedList<>(); 538 540 int i = 0; … … 559 561 } else { 560 562 nd = new Node(p); 561 cmds.add(new AddCommand( nd));563 cmds.add(new AddCommand(ds, nd)); 562 564 } 563 565 } … … 595 597 } 596 598 oldWay = null; // that is all with this command 597 } else cmds.add(new AddCommand( w));599 } else cmds.add(new AddCommand(ds, w)); 598 600 Command c = new SequenceCommand(tr("Draw the way by mouse"), cmds); 599 if (getLayerManager().getEditLayer() == null) return;600 601 MainApplication.undoRedo.add(c); 601 602 lineWasSaved = true; … … 603 604 if (autoExit) { 604 605 // Select this way and switch drawing mode off 605 getLayerManager().getEditDataSet().setSelected(w);606 ds.setSelected(w); 606 607 MainApplication.getMap().selectSelectTool(false); 607 608 }
Note:
See TracChangeset
for help on using the changeset viewer.