Ignore:
Timestamp:
2017-04-08T00:59:43+02:00 (8 years ago)
Author:
donvip
Message:

update to JOSM 11851

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/sds/src/org/openstreetmap/hot/sds/SeparateDataStorePlugin.java

    r32705 r33217  
    44import java.util.ArrayList;
    55import java.util.HashMap;
     6import java.util.List;
     7import java.util.Map;
    68
    79import org.openstreetmap.josm.Main;
     
    2830public class SeparateDataStorePlugin extends Plugin {
    2931
    30     public HashMap<Long, IPrimitive> originalNodes = new HashMap<>();
    31     public HashMap<Long, IPrimitive> originalWays = new HashMap<>();
    32     public HashMap<Long, IPrimitive> originalRelations = new HashMap<>();
     32    public final Map<Long, IPrimitive> originalNodes = new HashMap<>();
     33    public final Map<Long, IPrimitive> originalWays = new HashMap<>();
     34    public final Map<Long, IPrimitive> originalRelations = new HashMap<>();
    3335
    34     public ArrayList<QueueItem> uploadQueue = new ArrayList<>();
     36    public List<QueueItem> uploadQueue = new ArrayList<>();
    3537
    3638    private PrimitiveVisitor learnVisitor = new PrimitiveVisitor() {
     
    5254
    5355    static class QueueItem {
    54         public IPrimitive primitive;
    55         public HashMap<String, String> tags;
    56         public boolean sdsOnly;
     56        public final IPrimitive primitive;
     57        public final Map<String, String> tags;
     58        public final boolean sdsOnly;
    5759        public boolean processed;
    5860        QueueItem(IPrimitive p, HashMap<String, String> t, boolean s) {
     
    6971    public SeparateDataStorePlugin(PluginInformation info) {
    7072        super(info);
    71         System.out.println("initializing SDS plugin");
    7273
    73         // this lets us see what JOSM load from the server, and augment it with our data:
     74        // this lets us see what JOSM load from the server, and augment it with our data
    7475        OsmReader.registerPostprocessor(new ReadPostprocessor(this));
    7576
    76         // this makes sure that our data is never written to the OSM server on a low level;
    77         OsmWriterFactory.theFactory = new SdsOsmWriterFactory(this);
     77        // this makes sure that our data is never written to the OSM server on a low level
     78        OsmWriterFactory.setDefaultFactory(new SdsOsmWriterFactory(this));
    7879
    79         // this lets us see what JOSM is planning to upload, and prepare our own uploads
    80         // accordingly
     80        // this lets us see what JOSM is planning to upload, and prepare our own uploads accordingly
    8181        UploadAction.registerUploadHook(new DetermineSdsModificationsUploadHook(this));
    8282
    83         // this lets us perform our own uploads after JOSM has succeeded:
     83        // this lets us perform our own uploads after JOSM has succeeded
    8484        OsmServerWriter.registerPostprocessor(new WritePostprocessor(this));
    8585
     
    141141        return new SdsPluginPreferences();
    142142    }
    143 
    144143}
    145 
Note: See TracChangeset for help on using the changeset viewer.