Changeset 33731 in osm for applications


Ignore:
Timestamp:
2017-10-25T20:45:52+02:00 (7 years ago)
Author:
donvip
Message:

update to JOSM 12987

Location:
applications/editors/josm/plugins/FastDraw
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/FastDraw

    • Property svn:ignore
      •  

        old new  
        44checkstyle-josm-FastDraw.xml
        55findbugs-josm-FastDraw.xml
         6spotbugs-josm-FastDraw.xml
  • applications/editors/josm/plugins/FastDraw/build.xml

    r33583 r33731  
    44    <property name="commit.message" value="[josm_fastdraw] Fix incorrect settings saving-2"/>
    55    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    6     <property name="plugin.main.version" value="12683"/>
     6    <property name="plugin.main.version" value="12987"/>
    77   
    88    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FDSettings.java

    r32930 r33731  
    99
    1010import org.openstreetmap.josm.Main;
    11 import org.openstreetmap.josm.data.preferences.ColorProperty;
     11import org.openstreetmap.josm.data.preferences.NamedColorProperty;
    1212import org.openstreetmap.josm.gui.util.GuiHelper;
     13import org.openstreetmap.josm.tools.Logging;
    1314
    1415public class FDSettings {
    15     public ColorProperty COLOR_FIXED = new ColorProperty("fastdraw.color.delete", Color.red);
    16     public ColorProperty COLOR_NORMAL = new ColorProperty("fastdraw.color.edit", Color.orange);
    17     public ColorProperty COLOR_DELETE = new ColorProperty("fastdraw.color.fixed", Color.green);
    18     public ColorProperty COLOR_SELECTEDFRAGMENT = new ColorProperty("fastdraw.color.normal", Color.red);
    19     public ColorProperty COLOR_EDITEDFRAGMENT = new ColorProperty("fastdraw.color.select", Color.blue);
    20     public ColorProperty COLOR_SIMPLIFIED = new ColorProperty("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);
    2122
    2223    public double maxDist;
     
    5657        simplifiedStroke = GuiHelper.getCustomizedStroke(Main.pref.get("fastdraw.stroke.simplified", "2"));
    5758
    58         bigDotSize = Main.pref.getInteger("fastdraw.point.bigsize", 7);
    59         dotSize = Main.pref.getInteger("fastdraw.point.normalsize", 5);
     59        bigDotSize = Main.pref.getInt("fastdraw.point.bigsize", 7);
     60        dotSize = Main.pref.getInt("fastdraw.point.normalsize", 5);
    6061
    6162        maxDist = Main.pref.getDouble("fastdraw.maxdist", 5);
     
    6566        startingEps = Main.pref.getDouble("fastdraw.startingEps", 5);
    6667        maxPointsPerKm = Main.pref.getDouble("fastdraw.maxpkm", 150);
    67         pkmBlockSize = Main.pref.getInteger("fastdraw.pkmblocksize", 10);
     68        pkmBlockSize = Main.pref.getInt("fastdraw.pkmblocksize", 10);
    6869        drawLastSegment = Main.pref.getBoolean("fastdraw.drawlastsegment", true);
    6970        snapNodes = Main.pref.getBoolean("fastdraw.snapnodes", true);
     
    7172        fixedSpacebar = Main.pref.getBoolean("fastdraw.fixedspacebar", false);
    7273        drawClosed = Main.pref.getBoolean("fastdraw.drawclosed", false);
    73         simplifyMode = Main.pref.getInteger("fastdraw.simplifymode", 0) % 3;
     74        simplifyMode = Main.pref.getInt("fastdraw.simplifymode", 0) % 3;
    7475        allowEditExistingWays = Main.pref.getBoolean("fastdraw.alloweditexisting", false);
    7576
     
    8485        Main.pref.putDouble("fastdraw.startingEps", startingEps);
    8586        Main.pref.putDouble("fastdraw.maxpkm", maxPointsPerKm);
    86         Main.pref.putInteger("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.putInteger("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);
    9394        Main.pref.put("fastdraw.autotags", autoTags);
    94         Main.pref.put("fastdraw.alloweditexisting", allowEditExistingWays);
     95        Main.pref.putBoolean("fastdraw.alloweditexisting", allowEditExistingWays);
    9596        try {
    9697            Main.pref.save();
    9798        } catch (IOException e) {
    98             System.err.println(tr("Can not save preferences"));
     99            Logging.error(tr("Can not save preferences"));
    99100        }
    100101    }
  • applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FastDrawConfigDialog.java

    r33583 r33731  
    6666        pasteButton.setToolTipText(tr("Try copying tags from properties table"));
    6767
    68         ArrayList<String> history = new ArrayList<>(Main.pref.getCollection("fastdraw.tags-history"));
     68        ArrayList<String> history = new ArrayList<>(Main.pref.getList("fastdraw.tags-history"));
    6969        while (history.remove("")) { };
    7070        addTags.setPossibleItems(history);
     
    131131                    addTags.addCurrentItemToHistory();
    132132                }
    133                 Main.pref.putCollection("fastdraw.tags-history", addTags.getHistory());
     133                Main.pref.putList("fastdraw.tags-history", addTags.getHistory());
    134134                settings.savePrefs();
    135135            } catch (ParseException e) {
  • applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FastDrawingMode.java

    r33730 r33731  
    2929import org.openstreetmap.josm.data.Bounds;
    3030import org.openstreetmap.josm.data.coor.LatLon;
     31import org.openstreetmap.josm.data.osm.DataSet;
    3132import org.openstreetmap.josm.data.osm.Node;
    3233import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    535536        if (line.isClosed() && n == 3) pts.remove(2); // two-point way can not be closed
    536537
     538        DataSet ds = getLayerManager().getEditDataSet();
    537539        Collection<Command> cmds = new LinkedList<>();
    538540        int i = 0;
     
    559561                } else {
    560562                    nd = new Node(p);
    561                     cmds.add(new AddCommand(nd));
     563                    cmds.add(new AddCommand(ds, nd));
    562564                }
    563565            }
     
    595597            }
    596598            oldWay = null; // that is all with this command
    597         } else cmds.add(new AddCommand(w));
     599        } else cmds.add(new AddCommand(ds, w));
    598600        Command c = new SequenceCommand(tr("Draw the way by mouse"), cmds);
    599         if (getLayerManager().getEditLayer() == null) return;
    600601        MainApplication.undoRedo.add(c);
    601602        lineWasSaved = true;
     
    603604        if (autoExit) {
    604605            // Select this way and switch drawing mode off
    605             getLayerManager().getEditDataSet().setSelected(w);
     606            ds.setSelected(w);
    606607            MainApplication.getMap().selectSelectTool(false);
    607608        }
Note: See TracChangeset for help on using the changeset viewer.