Changeset 7534 in josm for trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
- Timestamp:
- 2014-09-14T17:11:14+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java
r7052 r7534 48 48 49 49 /** 50 * Join Areas (i.e. closed ways and multipolygons) 50 * Join Areas (i.e. closed ways and multipolygons). 51 * @since 2575 51 52 */ 52 53 public class JoinAreasAction extends JosmAction { … … 57 58 58 59 /** 59 * This helper class describes join are s action result.60 * This helper class describes join areas action result. 60 61 * @author viesturs 61 *62 62 */ 63 63 public static class JoinAreasResult { … … 394 394 395 395 /** 396 * Gets called whenever the shortcut is pressed or the menu entry is selected 397 * Checks whether the selected objects are suitable to join and joins them if so 396 * Gets called whenever the shortcut is pressed or the menu entry is selected. 397 * Checks whether the selected objects are suitable to join and joins them if so. 398 398 */ 399 399 @Override 400 400 public void actionPerformed(ActionEvent e) { 401 LinkedList<Way> ways = new LinkedList<>(Main.main.getCurrentDataSet().getSelectedWays()); 401 join(Main.main.getCurrentDataSet().getSelectedWays()); 402 } 403 404 /** 405 * Joins the given ways. 406 * @param ways Ways to join 407 * @since 7534 408 */ 409 public void join(Collection<Way> ways) { 402 410 addedRelations.clear(); 403 411 … … 471 479 } 472 480 DataSet ds = Main.main.getCurrentDataSet(); 473 ds.setSelected(allWays); 474 Main.map.mapView.repaint(); 481 if (ds != null) { 482 ds.setSelected(allWays); 483 Main.map.mapView.repaint(); 484 } 475 485 } else { 476 486 new Notification( … … 479 489 .show(); 480 490 } 481 } 482 catch (UserCancelException exception) { 491 } catch (UserCancelException exception) { 483 492 //revert changes 484 493 //FIXME: this is dirty hack … … 915 924 /** 916 925 * This is a method splits way into smaller parts, using the prepared nodes list as split points. 917 * Uses SplitWayAction.splitWayfor the heavy lifting.926 * Uses {@link SplitWayAction#splitWay} for the heavy lifting. 918 927 * @return list of split ways (or original ways if no splitting is done). 919 928 */ … … 924 933 925 934 if (chunks.size() > 1) { 926 SplitWayResult split = SplitWayAction.splitWay( Main.main.getEditLayer(), way, chunks, Collections.<OsmPrimitive>emptyList());935 SplitWayResult split = SplitWayAction.splitWay(getEditLayer(), way, chunks, Collections.<OsmPrimitive>emptyList()); 927 936 928 937 //execute the command, we need the results … … 1254 1263 * @return list of polygons, or null if too complex relation encountered. 1255 1264 */ 1256 private List<Multipolygon> collectMultipolygons( List<Way> selectedWays) {1265 private List<Multipolygon> collectMultipolygons(Collection<Way> selectedWays) { 1257 1266 1258 1267 List<Multipolygon> result = new ArrayList<>(); … … 1380 1389 1381 1390 /** 1382 * Removes a given OsmPrimitive from all relations 1391 * Removes a given OsmPrimitive from all relations. 1383 1392 * @param osm Element to remove from all relations 1384 1393 * @return List of relations with roles the primitives was part of
Note:
See TracChangeset
for help on using the changeset viewer.