Changeset 34326 in osm
- Timestamp:
- 2018-06-19T23:32:13+02:00 (7 years ago)
- 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 4 4 <property name="commit.message" value="Commit message"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="139 27"/>6 <property name="plugin.main.version" value="13957"/> 7 7 8 8 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ComputeBoundsAction.java
r33830 r34326 25 25 import org.openstreetmap.josm.data.coor.LatLon; 26 26 import org.openstreetmap.josm.data.osm.BBox; 27 import org.openstreetmap.josm.data.osm.IPrimitive; 28 import org.openstreetmap.josm.data.osm.IRelation; 29 import org.openstreetmap.josm.data.osm.IRelationMember; 30 import org.openstreetmap.josm.data.osm.IWay; 27 31 import org.openstreetmap.josm.data.osm.Node; 28 32 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 51 55 protected static final String EIGHT_SP = " "; 52 56 53 private final Set< Relation> multipolygons;54 private final Set< Way> closedWays;57 private final Set<IRelation<?>> multipolygons; 58 private final Set<IWay<?>> closedWays; 55 59 56 60 static { DF.setRoundingMode(RoundingMode.CEILING); } … … 83 87 } 84 88 85 protected void updateOsmPrimitives(Collection<? extends OsmPrimitive> primitives) {89 protected void updateOsmPrimitives(Collection<? extends IPrimitive> primitives) { 86 90 multipolygons.clear(); 87 91 closedWays.clear(); 88 92 // 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; 92 96 if (r.isMultipolygon()) { 93 97 multipolygons.add(r); 94 98 } 95 } else if (value instanceof Way) {96 Way w = (Way) value;99 } else if (value instanceof IWay) { 100 IWay<?> w = (IWay<?>) value; 97 101 if (w.isClosed()) { 98 102 closedWays.add(w); … … 101 105 } 102 106 // 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();) { 104 108 processIterator(it); 105 109 } … … 108 112 } 109 113 110 private void processIterator(Iterator< Way> it) {111 Wayway = it.next();112 for ( Relationmp : multipolygons) {113 for ( RelationMembermb : 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()) { 114 118 if (mb.getMember().equals(way)) { 115 119 it.remove(); … … 125 129 */ 126 130 public final String getXml() { 127 List< OsmPrimitive> primitives = new ArrayList<>();131 List<IPrimitive> primitives = new ArrayList<>(); 128 132 primitives.addAll(multipolygons); 129 133 primitives.addAll(closedWays); -
applications/editors/josm/plugins/imagery-xml-bounds/src/org/openstreetmap/josm/plugins/imageryxmlbounds/actions/ShowBoundsAction.java
r30735 r34326 11 11 import javax.swing.JScrollPane; 12 12 13 import org.openstreetmap.josm.Main; 14 import org.openstreetmap.josm.actions.IPrimitiveAction; 15 import org.openstreetmap.josm.data.osm.IPrimitive; 16 import org.openstreetmap.josm.plugins.imageryxmlbounds.XmlBoundsLayer; 17 13 18 import 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;19 19 20 20 /** … … 22 22 * @author Don-vip 23 23 */ 24 public class ShowBoundsAction extends ComputeBoundsAction implements OsmPrimitiveAction {24 public class ShowBoundsAction extends ComputeBoundsAction implements IPrimitiveAction { 25 25 26 26 /** … … 55 55 56 56 @Override 57 public void setPrimitives(Collection<? extends OsmPrimitive> primitives) {57 public void setPrimitives(Collection<? extends IPrimitive> primitives) { 58 58 updateOsmPrimitives(primitives); 59 59 }
Note:
See TracChangeset
for help on using the changeset viewer.