Changeset 18415 in osm


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
Files:
6 added
9 edited

Legend:

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

    r17538 r18415  
    5757                <attribute name="Plugin-Description" value="Visualizes routing information as a routing graph."/>
    5858                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/Graphview"/>
    59                 <attribute name="Plugin-Mainversion" value="2082"/>
     59                <attribute name="Plugin-Mainversion" value="2381"/>
    6060                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    6161            </manifest>
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/data/JOSMDataSource.java

    r17538 r18415  
    5050
    5151        public Iterable<Node> getNodes() {
    52                 return new FilteredOsmPrimitiveIterable<Node>(Main.main.getCurrentDataSet().nodes);
     52                return new FilteredOsmPrimitiveIterable<Node>(Main.main.getCurrentDataSet().getNodes());
    5353        }
    5454
    5555        public Iterable<Relation> getRelations() {
    56                 return new FilteredRelationIterable(Main.main.getCurrentDataSet().relations);
     56                return new FilteredRelationIterable(Main.main.getCurrentDataSet().getRelations());
    5757        }
    5858
    5959        public Iterable<Way> getWays() {
    60                 return new FilteredOsmPrimitiveIterable<Way>(Main.main.getCurrentDataSet().ways);
     60                return new FilteredOsmPrimitiveIterable<Way>(Main.main.getCurrentDataSet().getWays());
    6161        }
    6262
  • 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";
  • applications/editors/josm/plugins/routing/build.xml

    r18404 r18415  
    4444                <attribute name="Plugin-Description" value="Provides routing capabilities."/>
    4545                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/Routing"/>
    46                 <attribute name="Plugin-Mainversion" value="2323"/>
     46                <attribute name="Plugin-Mainversion" value="2381"/>
    4747                <attribute name="Plugin-Stage" value="50"/>
    4848                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
  • applications/editors/josm/plugins/routing/src/com/innovant/josm/jrt/core/RoutingGraph.java

    r17544 r18415  
    130130        rgDelegator.setRouteType(this.routeType);
    131131        // iterate all ways and segments for all nodes:
    132         for (Way way : data.ways) {
     132        for (Way way : data.getWays()) {
    133133            if (way != null && !way.isDeleted() && this.isvalidWay(way)) {
    134134                Node from = null;
  • applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingLayer.java

    r17544 r18415  
    133133        Node nearest = null;
    134134        double minDist = 0;
    135         for (Way w : dataLayer.data.ways) {
     135        for (Way w : dataLayer.data.getWays()) {
    136136            if (w.isDeleted() || w.incomplete || w.get("highway")==null) continue;
    137137            for (Node n : w.getNodes()) {
  • applications/editors/josm/plugins/utilsplugin/build.xml

    r18387 r18415  
    2525                <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
    2626                <attribute name="Plugin-Description" value="Several utilities that make your life easier: e.g. simplify way, join areas, jump to position."/>
    27                 <attribute name="Plugin-Mainversion" value="2355"/>
     27                <attribute name="Plugin-Mainversion" value="2381"/>
    2828                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
    2929            </manifest>
  • applications/editors/josm/plugins/utilsplugin/src/UtilsPlugin/JoinAreasAction.java

    r18387 r18415  
    443443    private ArrayList<RelationRole> removeFromRelations(OsmPrimitive osm) {
    444444        ArrayList<RelationRole> result = new ArrayList<RelationRole>();
    445         for (Relation r : Main.main.getCurrentDataSet().relations) {
     445        for (Relation r : Main.main.getCurrentDataSet().getRelations()) {
    446446            if (r.isDeleted() || r.incomplete) continue;
    447447            for (RelationMember rm : r.getMembers()) {
Note: See TracChangeset for help on using the changeset viewer.