Changeset 34326 in osm


Ignore:
Timestamp:
2018-06-19T23:32:13+02:00 (7 years ago)
Author:
donvip
Message:

update to JOSM 13957

Location:
applications/editors/josm/plugins/imagery-xml-bounds
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/imagery-xml-bounds/build.xml

    r34306 r34326  
    44    <property name="commit.message" value="Commit message"/>
    55    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    6     <property name="plugin.main.version" value="13927"/>
     6    <property name="plugin.main.version" value="13957"/>
    77   
    88    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ComputeBoundsAction.java

    r33830 r34326  
    2525import org.openstreetmap.josm.data.coor.LatLon;
    2626import org.openstreetmap.josm.data.osm.BBox;
     27import org.openstreetmap.josm.data.osm.IPrimitive;
     28import org.openstreetmap.josm.data.osm.IRelation;
     29import org.openstreetmap.josm.data.osm.IRelationMember;
     30import org.openstreetmap.josm.data.osm.IWay;
    2731import org.openstreetmap.josm.data.osm.Node;
    2832import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    5155    protected static final String EIGHT_SP = "        ";
    5256
    53     private final Set<Relation> multipolygons;
    54     private final Set<Way> closedWays;
     57    private final Set<IRelation<?>> multipolygons;
     58    private final Set<IWay<?>> closedWays;
    5559
    5660    static { DF.setRoundingMode(RoundingMode.CEILING); }
     
    8387    }
    8488
    85     protected void updateOsmPrimitives(Collection<? extends OsmPrimitive> primitives) {
     89    protected void updateOsmPrimitives(Collection<? extends IPrimitive> primitives) {
    8690        multipolygons.clear();
    8791        closedWays.clear();
    8892        // Store selected multipolygons and closed ways
    89         for (OsmPrimitive value : primitives) {
    90             if (value instanceof Relation) {
    91                 Relation r = (Relation) value;
     93        for (IPrimitive value : primitives) {
     94            if (value instanceof IRelation) {
     95                IRelation<?> r = (IRelation<?>) value;
    9296                if (r.isMultipolygon()) {
    9397                    multipolygons.add(r);
    9498                }
    95             } else if (value instanceof Way) {
    96                 Way w = (Way) value;
     99            } else if (value instanceof IWay) {
     100                IWay<?> w = (IWay<?>) value;
    97101                if (w.isClosed()) {
    98102                    closedWays.add(w);
     
    101105        }
    102106        // Remove closed ways already inside a selected multipolygon
    103         for (Iterator<Way> it = closedWays.iterator(); it.hasNext();) {
     107        for (Iterator<IWay<?>> it = closedWays.iterator(); it.hasNext();) {
    104108            processIterator(it);
    105109        }
     
    108112    }
    109113
    110     private void processIterator(Iterator<Way> it) {
    111         Way way = it.next();
    112         for (Relation mp : multipolygons) {
    113             for (RelationMember mb : mp.getMembers()) {
     114    private void processIterator(Iterator<IWay<?>> it) {
     115        IWay<?> way = it.next();
     116        for (IRelation<?> mp : multipolygons) {
     117            for (IRelationMember<?> mb : mp.getMembers()) {
    114118                if (mb.getMember().equals(way)) {
    115119                    it.remove();
     
    125129     */
    126130    public final String getXml() {
    127         List<OsmPrimitive> primitives = new ArrayList<>();
     131        List<IPrimitive> primitives = new ArrayList<>();
    128132        primitives.addAll(multipolygons);
    129133        primitives.addAll(closedWays);
  • applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ShowBoundsAction.java

    r30735 r34326  
    1111import javax.swing.JScrollPane;
    1212
     13import org.openstreetmap.josm.Main;
     14import org.openstreetmap.josm.actions.IPrimitiveAction;
     15import org.openstreetmap.josm.data.osm.IPrimitive;
     16import org.openstreetmap.josm.plugins.imageryxmlbounds.XmlBoundsLayer;
     17
    1318import net.boplicity.xmleditor.XmlTextPane;
    14 
    15 import org.openstreetmap.josm.Main;
    16 import org.openstreetmap.josm.actions.OsmPrimitiveAction;
    17 import org.openstreetmap.josm.data.osm.OsmPrimitive;
    18 import org.openstreetmap.josm.plugins.imageryxmlbounds.XmlBoundsLayer;
    1919
    2020/**
     
    2222 * @author Don-vip
    2323 */
    24 public class ShowBoundsAction extends ComputeBoundsAction implements OsmPrimitiveAction {
     24public class ShowBoundsAction extends ComputeBoundsAction implements IPrimitiveAction {
    2525
    2626    /**
     
    5555
    5656    @Override
    57     public void setPrimitives(Collection<? extends OsmPrimitive> primitives) {
     57    public void setPrimitives(Collection<? extends IPrimitive> primitives) {
    5858        updateOsmPrimitives(primitives);
    5959    }
Note: See TracChangeset for help on using the changeset viewer.