Ignore:
Timestamp:
2009-11-02T08:53:38+01:00 (15 years ago)
Author:
jttt
Message:

Replace Dataset.nodes with getNodes(), etc

Location:
applications/editors/josm/plugins/multipoly
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/multipoly/build.xml

    r18142 r18415  
    4747    <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
    4848    <attribute name="Plugin-Link" value="http://svn.openstreetmap.org/applications/editors/josm/plugins/multipoly/"/>
    49     <attribute name="Plugin-Mainversion" value="2267"/>
     49    <attribute name="Plugin-Mainversion" value="2381"/>
    5050   </manifest>
    5151  </jar>
  • applications/editors/josm/plugins/multipoly/src/multipoly/MultipolyAction.java

    r18079 r18415  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    6 import java.awt.event.*;
    7 import java.util.*;
     6import java.awt.event.ActionEvent;
     7import java.awt.event.KeyEvent;
     8import java.util.ArrayList;
     9import java.util.Collection;
     10import java.util.HashSet;
     11import java.util.LinkedList;
     12import java.util.List;
    813
    914import javax.swing.JOptionPane;
    1015
     16import org.openstreetmap.josm.Main;
    1117import org.openstreetmap.josm.actions.JosmAction;
    12 import org.openstreetmap.josm.Main;
    13 import org.openstreetmap.josm.command.*;
     18import org.openstreetmap.josm.command.AddCommand;
     19import org.openstreetmap.josm.command.Command;
     20import org.openstreetmap.josm.command.SequenceCommand;
    1421import org.openstreetmap.josm.data.coor.EastNorth;
    15 import org.openstreetmap.josm.data.osm.*;
    16 import org.openstreetmap.josm.tools.*;
     22import org.openstreetmap.josm.data.osm.Node;
     23import org.openstreetmap.josm.data.osm.OsmPrimitive;
     24import org.openstreetmap.josm.data.osm.Relation;
     25import org.openstreetmap.josm.data.osm.RelationMember;
     26import org.openstreetmap.josm.data.osm.Way;
     27import org.openstreetmap.josm.tools.Pair;
     28import org.openstreetmap.josm.tools.Shortcut;
    1729
    1830/**
    1931 * Create multipolygon from selected ways automatically.
    20  * 
     32 *
    2133 * New relation with type=multipolygon is created
    22  * 
     34 *
    2335 * If one or more of ways is already in relation with type=multipolygon or the way os not closed,
    2436 * then error is reported and no relation is created
    25  * 
     37 *
    2638 * The "inner" and "outer" roles are guessed automatically.
    2739 * First, bbox is calculated for each way. then the largest area is assumed to be outside
     
    3951  setEnabled(true);
    4052 }
    41  
     53
    4254 /**
    4355  * The action button has been clicked
     
    4860  // Get all ways in some type=multipolygon relation
    4961  HashSet<OsmPrimitive> relationsInMulti = new HashSet<OsmPrimitive>();
    50   for (Relation r : Main.main.getCurrentDataSet().relations) {
     62  for (Relation r : Main.main.getCurrentDataSet().getRelations()) {
    5163   if (!r.isUsable()) continue;
    5264   if (r.get("type")!="multipolygon") continue;
     
    6072
    6173  //List of selected ways
    62   List<Way> selectedWays = new ArrayList<Way>();;
     74  List<Way> selectedWays = new ArrayList<Way>();
    6375  //Area of largest way (in square degrees)
    6476  double maxarea=0;
     
    118130  rel.put("type","multipolygon");
    119131  //Add ways to it
    120   for (int i=0;i<selectedWays.size();i++) { 
     132  for (int i=0;i<selectedWays.size();i++) {
    121133   Way s=selectedWays.get(i);
    122134   String xrole="inner";
Note: See TracChangeset for help on using the changeset viewer.