Changeset 30737 in osm for applications/editors/josm/plugins/utilsplugin2/src/org
- Timestamp:
- 2014-10-18T23:07:52+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2
- Files:
-
- 36 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/AddIntersectionsAction.java
r30177 r30737 47 47 } 48 48 49 LinkedList<Command> cmds = new LinkedList< Command>();49 LinkedList<Command> cmds = new LinkedList<>(); 50 50 Geometry.addIntersections(ways, false, cmds); 51 51 if (!cmds.isEmpty()) { 52 52 Main.main.undoRedo.add(new SequenceCommand(tr("Add nodes at intersections"),cmds)); 53 Set<Node> nodes = new HashSet< Node>(10);53 Set<Node> nodes = new HashSet<>(10); 54 54 // find and select newly added nodes 55 55 for (Command cmd: cmds) if (cmd instanceof AddCommand){ -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/AlignWayNodesAction.java
r30177 r30737 45 45 int firstNodePos = findFirstNode(way, selectedNodes); 46 46 int lastNodePos = way.isClosed() ? firstNodePos : way.getNodesCount(); 47 List<Node> nodes = new ArrayList< Node>();47 List<Node> nodes = new ArrayList<>(); 48 48 int i = firstNodePos; 49 49 boolean iterated = false; … … 75 75 // Now, we have an ordered list of nodes, of which idx 0 and N-1 serve as guides 76 76 // and 1..N-2 should be aligned with them 77 List<Command> commands = new ArrayList< Command>();77 List<Command> commands = new ArrayList<>(); 78 78 double ax = nodes.get(0).getEastNorth().east(); 79 79 double ay = nodes.get(0).getEastNorth().north(); … … 134 134 List<Way> referrers = OsmPrimitive.getFilteredList(n.getReferrers(), Way.class); 135 135 if( ways == null ) 136 ways = new HashSet< Way>(referrers);136 ways = new HashSet<>(referrers); 137 137 else { 138 138 ways.retainAll(referrers); … … 143 143 144 144 private Set<Node> filterNodes( Collection<? extends OsmPrimitive> selection ) { 145 Set<Node> result = new HashSet< Node>();145 Set<Node> result = new HashSet<>(); 146 146 if( selection != null ) { 147 147 for( OsmPrimitive p : selection ) -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/ExtractPointAction.java
r30177 r30737 49 49 Node nd = selectedNodes.get(0); 50 50 Node ndCopy = new Node(nd.getCoor()); 51 List<Command> cmds = new LinkedList< Command>();51 List<Command> cmds = new LinkedList<>(); 52 52 53 53 Point p = Main.map.mapView.getMousePosition(); -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/PasteRelationsAction.java
r30391 r30737 30 30 return; 31 31 32 Map<Relation, String> relations = new HashMap< Relation, String>();32 Map<Relation, String> relations = new HashMap<>(); 33 33 for( PrimitiveData pdata : Main.pasteBuffer.getDirectlyAdded() ) { 34 34 OsmPrimitive p = getCurrentDataSet().getPrimitiveById(pdata.getUniqueId(), pdata.getType()); … … 50 50 } 51 51 52 List<Command> commands = new ArrayList< Command>();52 List<Command> commands = new ArrayList<>(); 53 53 for( Relation rel : relations.keySet() ) { 54 54 Relation r = new Relation(rel); -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SplitObjectAction.java
r30177 r30737 92 92 // is exactly one way that all nodes are part of. 93 93 if (selectedWay == null && !selectedNodes.isEmpty()) { 94 Map<Way, Integer> wayOccurenceCounter = new HashMap< Way, Integer>();94 Map<Way, Integer> wayOccurenceCounter = new HashMap<>(); 95 95 for (Node n : selectedNodes) { 96 96 for (Way w : OsmPrimitive.getFilteredList(n.getReferrers(), Way.class)) { … … 148 148 return; 149 149 } 150 HashSet<Node> nds = new HashSet< Node>(selectedNodes);150 HashSet<Node> nds = new HashSet<>(selectedNodes); 151 151 nds.removeAll(selectedWay.getNodes()); 152 152 if (!nds.isEmpty()) { -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SplitOnIntersectionsAction.java
r30177 r30737 33 33 @Override 34 34 public void actionPerformed( ActionEvent e ) { 35 List<Command> list = new ArrayList< Command>();35 List<Command> list = new ArrayList<>(); 36 36 List<Way> selectedWays = OsmPrimitive.getFilteredList(getCurrentDataSet().getSelected(), Way.class); 37 Map<Way, List<Node>> splitWays = new HashMap< Way, List<Node>>();37 Map<Way, List<Node>> splitWays = new HashMap<>(); 38 38 39 39 for( Way way : selectedWays ) { … … 61 61 splitWays.get(refs.get(0)).add(node); 62 62 else { 63 List<Node> nodes = new ArrayList< Node>(1);63 List<Node> nodes = new ArrayList<>(1); 64 64 nodes.add(node); 65 65 splitWays.put(refs.get(0), nodes); … … 77 77 List<List<Node>> wayChunks = SplitWayAction.buildSplitChunks(splitWay, splitWays.get(splitWay)); 78 78 if( wayChunks != null ) { 79 List<OsmPrimitive> sel = new ArrayList< OsmPrimitive>(selectedWays.size());79 List<OsmPrimitive> sel = new ArrayList<>(selectedWays.size()); 80 80 sel.addAll(selectedWays); 81 81 SplitWayAction.SplitWayResult result = SplitWayAction.splitWay(getEditLayer(), splitWay, wayChunks, sel); -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SymmetryAction.java
r30177 r30737 45 45 public void actionPerformed(ActionEvent e) { 46 46 Collection<OsmPrimitive> sel = getCurrentDataSet().getSelected(); 47 HashSet<Node> nodes = new HashSet< Node>();47 HashSet<Node> nodes = new HashSet<>(); 48 48 EastNorth p1=null,p2=null; 49 49 … … 74 74 ne /= l; nn /= l; // normal unit vector 75 75 76 Collection<Command> cmds = new LinkedList< Command>();76 Collection<Command> cmds = new LinkedList<>(); 77 77 78 78 for (Node n : nodes) { -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/TagBufferAction.java
r29769 r30737 18 18 public class TagBufferAction extends JosmAction { 19 19 private static final String TITLE = tr("Copy tags from previous selection"); 20 private Map<String, String> tags = new HashMap< String, String>();21 private Map<String, String> currentTags = new HashMap< String, String>();22 private Set<OsmPrimitive> selectionBuf = new HashSet< OsmPrimitive>();20 private Map<String, String> tags = new HashMap<>(); 21 private Map<String, String> currentTags = new HashMap<>(); 22 private Set<OsmPrimitive> selectionBuf = new HashSet<>(); 23 23 24 24 public TagBufferAction() { … … 34 34 return; 35 35 36 List<Command> commands = new ArrayList< Command>();36 List<Command> commands = new ArrayList<>(); 37 37 for( String key : tags.keySet() ) { 38 38 String value = tags.get(key); … … 92 92 private void rememberSelectionTags() { 93 93 // Fix #8350 - only care about tagged objects 94 Collection<OsmPrimitive> selectedTaggedObjects = new ArrayList< OsmPrimitive>(getCurrentDataSet().getSelected());94 Collection<OsmPrimitive> selectedTaggedObjects = new ArrayList<>(getCurrentDataSet().getSelected()); 95 95 for (Iterator<OsmPrimitive> it = selectedTaggedObjects.iterator(); it.hasNext(); ) { 96 96 if (!it.next().isTagged()) { … … 100 100 if( !selectedTaggedObjects.isEmpty() ) { 101 101 currentTags.clear(); 102 Set<String> bad = new HashSet< String>();102 Set<String> bad = new HashSet<>(); 103 103 for( OsmPrimitive p : selectedTaggedObjects ) { 104 104 if( currentTags.isEmpty() ) { -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/TagSourceAction.java
r29769 r30737 19 19 private static final String TITLE = tr("Add Source Tag"); 20 20 private String source; 21 private Set<OsmPrimitive> selectionBuf = new HashSet< OsmPrimitive>();21 private Set<OsmPrimitive> selectionBuf = new HashSet<>(); 22 22 private boolean clickedTwice = false; 23 23 -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/UnGlueRelationAction.java
r29769 r30737 49 49 public void actionPerformed(ActionEvent e) { 50 50 51 LinkedList<Command> cmds = new LinkedList< Command>();52 List<OsmPrimitive> newPrimitives = new LinkedList< OsmPrimitive>();51 LinkedList<Command> cmds = new LinkedList<>(); 52 List<OsmPrimitive> newPrimitives = new LinkedList<>(); 53 53 Collection<OsmPrimitive> selection = getCurrentDataSet().getSelected(); 54 54 -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/command/ChangeRelationMemberCommand.java
r29391 r30737 34 34 return; 35 35 } 36 LinkedList<RelationMember> newrms = new LinkedList< RelationMember>();36 LinkedList<RelationMember> newrms = new LinkedList<>(); 37 37 for (RelationMember rm : relation.getMembers()) { 38 38 if (rm.getMember() == oldP) { -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/curves/CircleArcMaker.java
r30701 r30737 23 23 public class CircleArcMaker { 24 24 public static Collection<Command> doCircleArc(List<Node> selectedNodes, List<Way> selectedWays, int angleSeparation) { 25 Collection<Command> cmds = new LinkedList< Command>();25 Collection<Command> cmds = new LinkedList<>(); 26 26 27 27 //// Decides which nodes to use as anchors based on selection … … 61 61 } 62 62 63 Set<Way> targetWays = new HashSet< Way>();63 Set<Way> targetWays = new HashSet<>(); 64 64 65 65 boolean nodesHaveBeenChoosen = false; … … 127 127 128 128 // // Calculate the new points in the arc 129 ReturnValue<Integer> p2Index = new ReturnValue< Integer>();129 ReturnValue<Integer> p2Index = new ReturnValue<>(); 130 130 List<EastNorth> points = circleArcPoints(p1, p2, p3, angleSeparation, false, p2Index); 131 131 132 132 //// Create the new arc nodes. Insert anchor nodes at correct positions. 133 List<Node> arcNodes = new ArrayList< Node>(points.size());133 List<Node> arcNodes = new ArrayList<>(points.size()); 134 134 arcNodes.add(n1); 135 135 { … … 269 269 int numberOfNodesInArc = Math.max((int) Math.ceil((radialLength / Math.PI) * 180 / angleSeparation)+1, 270 270 3); 271 List<EastNorth> points = new ArrayList< EastNorth>(numberOfNodesInArc);271 List<EastNorth> points = new ArrayList<>(numberOfNodesInArc); 272 272 273 273 // Calculate the circle points in order -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/curves/CurveAction.java
r28028 r30737 53 53 updatePreferences(); 54 54 55 List<Node> selectedNodes = new ArrayList< Node>(getCurrentDataSet().getSelectedNodes());56 List<Way> selectedWays = new ArrayList< Way>(getCurrentDataSet().getSelectedWays());55 List<Node> selectedNodes = new ArrayList<>(getCurrentDataSet().getSelectedNodes()); 56 List<Way> selectedWays = new ArrayList<>(getCurrentDataSet().getSelectedWays()); 57 57 58 58 // Collection<Command> cmds = doSpline(selectedNodes, selectedWays); -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/URLList.java
r30343 r30737 23 23 } 24 24 public static List<String> resetURLList() { 25 List<String> items=new ArrayList< String>();25 List<String> items=new ArrayList<>(); 26 26 items.add("Wikipedia"); 27 27 items.add("https://en.wikipedia.org/w/index.php?search={name}&fulltext=Search"); … … 60 60 61 61 public static List<String> loadURLList() { 62 ArrayList<String> items=new ArrayList< String>();62 ArrayList<String> items=new ArrayList<>(); 63 63 BufferedReader fr=null; 64 64 try { -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/UtilsPluginPreferences.java
r30459 r30737 134 134 TableModel model = (table.getModel()); 135 135 String v; 136 ArrayList<String> lst=new ArrayList< String>();136 ArrayList<String> lst=new ArrayList<>(); 137 137 int n=model.getRowCount(); 138 138 for (int i=0;i<n;i++) { -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/latlon/LatLonAction.java
r29769 r30737 59 59 60 60 // we create a list of commands that will modify the map in the way we want. 61 Collection<Command> cmds = new LinkedList< Command>();61 Collection<Command> cmds = new LinkedList<>(); 62 62 // first we create all the nodes, then we do extra stuff based on what geometry type we need. 63 LinkedList<Node> nodes = new LinkedList< Node>();63 LinkedList<Node> nodes = new LinkedList<>(); 64 64 65 65 for (LatLon ll : coordinates) { -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/latlon/LatLonDialog.java
r30002 r30737 309 309 private static LatLon[] parseLatLons(final String text) { 310 310 String lines[] = text.split("\\r?\\n"); 311 List<LatLon> latLons = new ArrayList< LatLon>();311 List<LatLon> latLons = new ArrayList<>(); 312 312 for (String line : lines) { 313 313 latLons.add(parseLatLon(line)); … … 320 320 321 321 final StringBuilder sb = new StringBuilder(); 322 final List<Object> list = new ArrayList< Object>();322 final List<Object> list = new ArrayList<>(); 323 323 324 324 while (m.find()) { -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/multitagger/MultiTagDialog.java
r30701 r30737 145 145 146 146 private void loadHistory() { 147 List<String> cmtHistory = new LinkedList< String>(147 List<String> cmtHistory = new LinkedList<>( 148 148 Main.pref.getCollection(HISTORY_KEY, Arrays.asList(defaultHistory))); 149 149 Collections.reverse(cmtHistory); … … 197 197 198 198 public List<OsmPrimitive> getSelectedPrimitives() { 199 ArrayList<OsmPrimitive> sel = new ArrayList< OsmPrimitive>(100);199 ArrayList<OsmPrimitive> sel = new ArrayList<>(100); 200 200 for (int idx: tbl.getSelectedRows()) { 201 201 sel.add(tableModel.getPrimitiveAt(tbl.convertRowIndexToModel(idx))); -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/multitagger/MultiTaggerTableModel.java
r30701 r30737 29 29 public class MultiTaggerTableModel extends AbstractTableModel implements SelectionChangedListener { 30 30 31 ArrayList<OsmPrimitive> list = new ArrayList< OsmPrimitive>(50);31 ArrayList<OsmPrimitive> list = new ArrayList<>(50); 32 32 String mainTags[] = new String[]{}; 33 33 boolean isSpecialTag[] = new boolean[]{}; 34 Set<OsmPrimitiveType> shownTypes = new HashSet< OsmPrimitiveType>();34 Set<OsmPrimitiveType> shownTypes = new HashSet<>(); 35 35 private boolean autoCommit = true; 36 List<Command> cmds = new ArrayList< Command>();36 List<Command> cmds = new ArrayList<>(); 37 37 private boolean watchSelection = true; 38 38 private JTable table; -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryAction.java
r30177 r30737 35 35 36 36 // There must be two ways selected: one with id > 0 and one new. 37 List<OsmPrimitive> selection = new ArrayList< OsmPrimitive>(getCurrentDataSet().getSelected());37 List<OsmPrimitive> selection = new ArrayList<>(getCurrentDataSet().getSelected()); 38 38 if (selection.size() != 2) { 39 39 new Notification( -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryUtils.java
r30532 r30737 116 116 } 117 117 // FIXME: handle different layers 118 List<Command> commands = new ArrayList< Command>();118 List<Command> commands = new ArrayList<>(); 119 119 commands.add(MergeNodesAction.mergeNodes(Main.main.getEditLayer(), Arrays.asList(subjectNode, referenceNode), referenceNode)); 120 120 … … 143 143 if (!subjectNode.isNew()) { 144 144 // Prepare a list of nodes that are not important 145 Collection<Node> nodePool = new HashSet< Node>();145 Collection<Node> nodePool = new HashSet<>(); 146 146 if (referenceObject instanceof Way) { 147 147 nodePool.addAll(getUnimportantNodes((Way) referenceObject)); … … 161 161 } 162 162 163 List<Command> commands = new ArrayList< Command>();163 List<Command> commands = new ArrayList<>(); 164 164 AbstractMap<String, String> nodeTags = (AbstractMap<String, String>) subjectNode.getKeys(); 165 165 … … 248 248 } 249 249 250 List<Command> commands = new ArrayList< Command>();250 List<Command> commands = new ArrayList<>(); 251 251 252 252 // merge tags … … 262 262 263 263 // And the same for geometry, list nodes that can be freely deleted 264 List<Node> geometryPool = new LinkedList< Node>();264 List<Node> geometryPool = new LinkedList<>(); 265 265 for( Node node : referenceWay.getNodes() ) { 266 266 List<OsmPrimitive> referrers = node.getReferrers(); … … 275 275 // Find new nodes that are closest to the old ones, remove matching old ones from the pool 276 276 // Assign node moves with least overall distance moved 277 Map<Node, Node> nodeAssoc = new HashMap< Node, Node>();277 Map<Node, Node> nodeAssoc = new HashMap<>(); 278 278 if (geometryPool.size() > 0 && nodePool.size() > 0) { 279 279 if (useRobust) { // use robust, but slower assignment … … 319 319 tr("Exceeded iteration limit for robust method, using simpler method.") 320 320 ).setIcon(JOptionPane.WARNING_MESSAGE).show(); 321 nodeAssoc = new HashMap< Node, Node>();321 nodeAssoc = new HashMap<>(); 322 322 } 323 323 } … … 375 375 */ 376 376 protected static List<Node> getUnimportantNodes(Way way) { 377 List<Node> nodePool = new LinkedList< Node>();377 List<Node> nodePool = new LinkedList<>(); 378 378 for (Node n : way.getNodes()) { 379 379 List<OsmPrimitive> referrers = n.getReferrers(); -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/ConnectedMatch.java
r30202 r30737 29 29 */ 30 30 private void init(boolean all) { 31 Collection<Way> matchedWays = new HashSet< Way>();32 Set<Node> matchedNodes = new HashSet< Node>();31 Collection<Way> matchedWays = new HashSet<>(); 32 Set<Node> matchedNodes = new HashSet<>(); 33 33 // find all ways that match the expression 34 34 Collection<Way> allWays = Main.main.getCurrentDataSet().getWays(); … … 45 45 } 46 46 } 47 Set<Way> newWays = new HashSet< Way>();47 Set<Way> newWays = new HashSet<>(); 48 48 if (all) { 49 49 NodeWayUtils.addWaysConnectedToNodes(matchedNodes, newWays); -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/InsideMatch.java
r30202 r30737 30 30 */ 31 31 private void init() { 32 Collection<OsmPrimitive> matchedAreas = new HashSet< OsmPrimitive>();32 Collection<OsmPrimitive> matchedAreas = new HashSet<>(); 33 33 // find all ways that match the expression 34 34 Collection<Way> ways = Main.main.getCurrentDataSet().getWays(); -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/search/IntersectingMatch.java
r30202 r30737 28 28 */ 29 29 private void init(boolean all) { 30 Collection<Way> matchedWays = new HashSet< Way>();30 Collection<Way> matchedWays = new HashSet<>(); 31 31 // find all ways that match the expression 32 32 Collection<Way> allWays = Main.main.getCurrentDataSet().getWays(); … … 36 36 } 37 37 } 38 Set<Way> newWays = new HashSet< Way>();38 Set<Way> newWays = new HashSet<>(); 39 39 if (all) { 40 40 NodeWayUtils.addWaysIntersectingWaysRecursively(allWays, matchedWays, newWays); -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/AdjacentNodesAction.java
r29769 r30737 29 29 } 30 30 31 private Set<Way> activeWays = new HashSet< Way>();31 private Set<Way> activeWays = new HashSet<>(); 32 32 33 33 @Override … … 58 58 // selecting nodes of selected ways 59 59 if(selectedNodes.isEmpty()) { 60 HashSet<Node> newNodes = new HashSet< Node>();60 HashSet<Node> newNodes = new HashSet<>(); 61 61 NodeWayUtils.addNodesConnectedToWays(selectedWays, newNodes); 62 62 activeWays.clear(); … … 69 69 } 70 70 71 Set<Node> newNodes = new HashSet < Node>();71 Set<Node> newNodes = new HashSet <>(); 72 72 for (Node node: selectedNodes) { 73 73 for (Way w: activeWays) { -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/AdjacentWaysAction.java
r29769 r30737 38 38 39 39 // select ways attached to already selected ways 40 Set<Way> newWays = new HashSet< Way>();40 Set<Way> newWays = new HashSet<>(); 41 41 NodeWayUtils.addWaysConnectedToWays(selectedWays, newWays); 42 42 newWays.addAll(selectedWays); -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/ConnectedWaysAction.java
r29769 r30737 33 33 Set<Way> selectedWays = OsmPrimitive.getFilteredSet(getCurrentDataSet().getSelected(), Way.class); 34 34 35 Set<Way> newWays = new HashSet< Way>();35 Set<Way> newWays = new HashSet<>(); 36 36 37 37 // selecting ways attached to selected nodes -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/IntersectedWaysAction.java
r30701 r30737 37 37 // select ways attached to already selected ways 38 38 if (!selectedWays.isEmpty()) { 39 Set<Way> newWays = new HashSet< Way>();39 Set<Way> newWays = new HashSet<>(); 40 40 NodeWayUtils.addWaysIntersectingWays( 41 41 getCurrentDataSet().getWays(), -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/IntersectedWaysRecursiveAction.java
r30701 r30737 38 38 39 39 if (!selectedWays.isEmpty()) { 40 Set<Way> newWays = new HashSet< Way>();40 Set<Way> newWays = new HashSet<>(); 41 41 NodeWayUtils.addWaysIntersectingWaysRecursively( 42 42 getCurrentDataSet().getWays(), -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/MiddleNodesAction.java
r30701 r30737 46 46 } 47 47 48 Set<Node> newNodes = new HashSet < Node>();48 Set<Node> newNodes = new HashSet <>(); 49 49 NodeWayUtils.addMiddle(selectedNodes, newNodes); 50 50 -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/NodeWayUtils.java
r30421 r30737 187 187 public static void addWaysIntersectingWaysRecursively 188 188 (Collection<Way> allWays, Collection<Way> initWays, Set<Way> newWays) { 189 Set<Way> foundWays = new HashSet< Way>();189 Set<Way> foundWays = new HashSet<>(); 190 190 foundWays.addAll(initWays); 191 191 newWays.addAll(initWays); … … 195 195 do { 196 196 c=0; 197 newFoundWays = new HashSet< Way>();197 newFoundWays = new HashSet<>(); 198 198 for (Way w : foundWays){ 199 199 c+=addWaysIntersectingWay(allWays, w, newFoundWays,newWays); … … 220 220 do { 221 221 c=0; 222 Set<Way> foundWays = new HashSet< Way>();222 Set<Way> foundWays = new HashSet<>(); 223 223 foundWays.addAll(newWays); 224 224 for (Way w : foundWays){ … … 241 241 Node n1 = it.next(); 242 242 Node n2 = it.next(); 243 Set<Way> ways=new HashSet< Way>();243 Set<Way> ways=new HashSet<>(); 244 244 ways.addAll(OsmPrimitive.getFilteredList(n1.getReferrers(), Way.class)); 245 245 for (Way w: ways) { … … 280 280 Node curNode = w.lastNode(); 281 281 Node prevNode = w.getNode(w.getNodes().size()-2); 282 Set<Way> newestWays = new HashSet< Way>();282 Set<Way> newestWays = new HashSet<>(); 283 283 while(true) { 284 284 … … 361 361 362 362 List<Node> searchNodes = data.searchNodes(box); 363 Set<Node> newestNodes = new HashSet< Node>();364 Set<Way> newestWays = new HashSet< Way>();363 Set<Node> newestNodes = new HashSet<>(); 364 Set<Way> newestWays = new HashSet<>(); 365 365 for (Node n : searchNodes) { 366 366 //if (Geometry.nodeInsidePolygon(n, polyNodes)) { … … 391 391 392 392 List<Node> searchNodes = data.searchNodes(box); 393 Set<Node> newestNodes = new HashSet< Node>();394 Set<Way> newestWays = new HashSet< Way>();393 Set<Node> newestNodes = new HashSet<>(); 394 Set<Way> newestWays = new HashSet<>(); 395 395 for (Node n : searchNodes) { 396 396 //if (Geometry.nodeInsidePolygon(n, polyNodes)) { … … 483 483 } 484 484 485 Set<Way> newWays = new HashSet< Way>();486 Set<Node> newNodes = new HashSet< Node>();485 Set<Way> newWays = new HashSet<>(); 486 Set<Node> newNodes = new HashSet<>(); 487 487 // select nodes and ways inside slexcted ways and multipolygons 488 488 if (!selectedWays.isEmpty()) { … … 503 503 } 504 504 505 Set<OsmPrimitive> insideSelection = new HashSet< OsmPrimitive>();505 Set<OsmPrimitive> insideSelection = new HashSet<>(); 506 506 if (!newWays.isEmpty() || !newNodes.isEmpty()) { 507 507 insideSelection.addAll(newWays); … … 512 512 513 513 private static List<EastNorth> buildPointList(Iterable<Way> ways) { 514 ArrayList<EastNorth> points = new ArrayList< EastNorth>(1000);514 ArrayList<EastNorth> points = new ArrayList<>(1000); 515 515 for (Way way: ways) { 516 516 for (EastNorth en: getWayPoints(way)) { -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectHighwayAction.java
r30701 r30737 54 54 55 55 private Set<Way> selectNamedRoad( Way firstWay ) { 56 Set<Way> newWays = new HashSet< Way>();56 Set<Way> newWays = new HashSet<>(); 57 57 String key = firstWay.hasKey("name") ? "name" : "ref"; 58 58 if( firstWay.hasKey(key) ) { 59 59 String value = firstWay.get(key); 60 Queue<Node> nodeQueue = new LinkedList< Node>();60 Queue<Node> nodeQueue = new LinkedList<>(); 61 61 nodeQueue.add(firstWay.firstNode()); 62 62 while( !nodeQueue.isEmpty() ) { … … 83 83 intersection = firstTree.getIntersection(secondTree); 84 84 } 85 Set<Way> newWays = new HashSet< Way>();85 Set<Way> newWays = new HashSet<>(); 86 86 newWays.addAll(firstTree.getPath(intersection)); 87 87 newWays.addAll(secondTree.getPath(intersection)); … … 142 142 143 143 public HighwayTree( Way from, int minHighwayRank ) { 144 tree = new ArrayList< Way>(1);145 refs = new ArrayList< Integer>(1);144 tree = new ArrayList<>(1); 145 refs = new ArrayList<>(1); 146 146 tree.add(from); 147 147 refs.add(Integer.valueOf(-1)); 148 148 this.minHighwayRank = minHighwayRank; 149 nodesToCheck = new ArrayList< Node>(2);150 nodeRefs = new ArrayList< Integer>(2);149 nodesToCheck = new ArrayList<>(2); 150 nodeRefs = new ArrayList<>(2); 151 151 nodesToCheck.add(from.firstNode()); 152 152 nodesToCheck.add(from.lastNode()); … … 156 156 157 157 public void processNextLevel() { 158 List<Node> newNodes = new ArrayList< Node>();159 List<Integer> newIdx = new ArrayList< Integer>();158 List<Node> newNodes = new ArrayList<>(); 159 List<Integer> newIdx = new ArrayList<>(); 160 160 for( int i = 0; i < nodesToCheck.size(); i++ ) { 161 161 Node node = nodesToCheck.get(i); … … 197 197 if( pos < 0 ) 198 198 throw new ArrayIndexOutOfBoundsException("Way " + to + " is not in the tree."); 199 List<Way> result = new ArrayList< Way>(1);199 List<Way> result = new ArrayList<>(1); 200 200 while( pos >= 0 ) { 201 201 result.add(tree.get(pos)); -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectModNodesAction.java
r29769 r30737 52 52 } 53 53 54 Set<Node> nodes = new HashSet< Node>(10);54 Set<Node> nodes = new HashSet<>(10); 55 55 do { // select next history element 56 56 if (idx>0) idx--; else idx=num-1; -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectModWaysAction.java
r29769 r30737 52 52 } 53 53 54 Set<Way> ways = new HashSet< Way>(10);54 Set<Way> ways = new HashSet<>(10); 55 55 do { // select next history element 56 56 if (idx>0) idx--; else idx=num-1; -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectWayNodesAction.java
r30002 r30737 54 54 Node n = (Node) p; 55 55 if (selectedNodes == null) { 56 selectedNodes = new ArrayList< Node>();56 selectedNodes = new ArrayList<>(); 57 57 } 58 58 selectedNodes.add(n); … … 68 68 for (Node n : w.getNodes()) { 69 69 if (selectedNodes == null) { 70 selectedNodes = new ArrayList< Node>();70 selectedNodes = new ArrayList<>(); 71 71 } 72 72 selectedNodes.add(n); -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/UndoSelectionAction.java
r29769 r30737 48 48 } 49 49 int k=0; 50 Set<OsmPrimitive> newsel = new HashSet< OsmPrimitive>();50 Set<OsmPrimitive> newsel = new HashSet<>(); 51 51 do { 52 52 if (index+1<history.size()) index++; else index=0;
Note:
See TracChangeset
for help on using the changeset viewer.