Changeset 17528 in osm for applications/editors/josm


Ignore:
Timestamp:
2009-09-08T23:14:16+02:00 (15 years ago)
Author:
guggis
Message:

Updating to JOSM r2082

Location:
applications/editors/josm/plugins/cadastre-fr
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/build.xml

    r17365 r17528  
    2727                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/FR:JOSM/Fr:Plugin/Cadastre"/>
    2828                <attribute name="Plugin-Mainversion" value="2012"/>
    29                 <attribute name="Plugin-Stage" value="60"/>
     29                <attribute name="Plugin-Stage" value="2082"/>
    3030                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    3131            </manifest>
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java

    r17215 r17528  
    124124        refreshMenu();
    125125
    126         // add a hook at uploading to insert/verify the source=cadastre tag
    127         LinkedList<UploadHook> hooks = ((UploadAction) Main.main.menu.upload).uploadHooks;
    128         hooks.add(0, new CheckSourceUploadHook());
     126        UploadAction.registerUploadHook(new CheckSourceUploadHook());
    129127    }
    130128
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CheckSourceUploadHook.java

    r17365 r17528  
    1616import org.openstreetmap.josm.actions.UploadAction.UploadHook;
    1717import org.openstreetmap.josm.command.ChangePropertyCommand;
     18import org.openstreetmap.josm.data.APIDataSet;
    1819import org.openstreetmap.josm.data.osm.Node;
    1920import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    3536     * Add the tag "source" if it doesn't exist for all new Nodes and Ways before uploading
    3637     */
    37     public boolean checkUpload(Collection<OsmPrimitive> add, Collection<OsmPrimitive> update, Collection<OsmPrimitive> delete)
     38    public boolean checkUpload(APIDataSet apiDataSet)
    3839    {
    39         if (CadastrePlugin.autoSourcing && CadastrePlugin.pluginUsed && !add.isEmpty()) {
     40        if (CadastrePlugin.autoSourcing && CadastrePlugin.pluginUsed && !apiDataSet.getPrimitivesToAdd().isEmpty()) {
    4041            Collection<OsmPrimitive> sel = new HashSet<OsmPrimitive>();
    41             for (OsmPrimitive osm : add) {
     42            for (OsmPrimitive osm : apiDataSet.getPrimitivesToAdd()) {
    4243                if ((osm instanceof Node || osm instanceof Way)
    4344                        && (osm.getKeys() == null || !tagSourceExist(osm))) {
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadSVGBuilding.java

    r17365 r17528  
    143143                        }
    144144                    if (w.getNodesCount() == replaced)
    145                         w.delete(true);
     145                        w.setDeleted(true);
    146146                }
    147                 n.delete(true);
     147                n.setDeleted(true);
    148148            }
    149149
     
    152152        Collection<Command> cmds = new LinkedList<Command>();
    153153        for (Node node : svgDataSet.nodes)
    154             if (!node.deleted)
     154            if (!node.isDeleted())
    155155                cmds.add(new AddCommand(node));
    156156        for (Way way : svgDataSet.ways)
    157             if (!way.deleted)
     157            if (!way.isDeleted())
    158158                cmds.add(new AddCommand(way));
    159159        Main.main.undoRedo.add(new SequenceCommand(tr("Create buildings"), cmds));
     
    191191        double epsilon = 0.05; // smallest distance considering duplicate node
    192192        for (Node n : nodes) {
    193             if (!n.deleted && !n.incomplete) {
     193            if (!n.isDeleted() && !n.incomplete) {
    194194                double dist = n.getEastNorth().distance(nodeToAdd.getEastNorth());
    195195                if (dist < epsilon) {
Note: See TracChangeset for help on using the changeset viewer.