Changeset 18814 in josm
- Timestamp:
- 2023-08-17T17:42:58+02:00 (18 months ago)
- Location:
- trunk
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/InvertSelectionAction.java
r17062 r18814 23 23 Shortcut.registerShortcut("selection:invertselection", 24 24 tr("Selection: {0}", tr("Invert Selection")), KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), true); 25 25 setHelpId(ht("/Action/InvertSelection")); 26 26 } 27 27 -
trunk/src/org/openstreetmap/josm/data/osm/IPrimitive.java
r18801 r18814 3 3 4 4 import java.time.Instant; 5 import java.util.Collections; 5 6 import java.util.Date; 6 7 import java.util.List; … … 20 21 * Replies <code>true</code> if the object has been modified since it was loaded from 21 22 * the server. In this case, on next upload, this object will be updated. 22 * 23 * <p> 23 24 * Deleted objects are deleted from the server. If the objects are added (id=0), 24 25 * the modified is ignored and the object is added to the server. … … 68 69 /** 69 70 * Sets whether this primitive is deleted or not. 70 * 71 * <p> 71 72 * Also marks this primitive as modified if deleted is true. 72 73 * … … 244 245 /** 245 246 * Sets the id and the version of this primitive if it is known to the OSM API. 246 * 247 * <p> 247 248 * Since we know the id and its version it can't be incomplete anymore. incomplete 248 249 * is set to false. … … 277 278 * @return date of last modification 278 279 * @see #setTimestamp 279 * @deprecated Use {@link #getInstant}280 * @deprecated since 17749, use {@link #getInstant} instead 280 281 */ 281 282 @Deprecated … … 306 307 * @param timestamp date of last modification 307 308 * @see #getTimestamp 308 * @deprecated Use {@link #setInstant}309 * @deprecated since 17749, use {@link #setInstant} instead 309 310 */ 310 311 @Deprecated … … 546 547 } 547 548 } 549 550 /** 551 * Get child primitives that are referred by this primitive. 552 * {@link Relation}: Members of the relation 553 * {@link Way}: Nodes used by the way 554 * {@link Node}: None 555 * @return List of child primitives 556 * @since 18814 557 */ 558 default List<? extends IPrimitive> getChildren() { 559 return Collections.emptyList(); 560 } 548 561 } -
trunk/src/org/openstreetmap/josm/data/osm/IRelation.java
r18413 r18814 116 116 } 117 117 118 @Override 119 default List<? extends IPrimitive> getChildren() { 120 return getMemberPrimitivesList(); 121 } 122 118 123 /** 119 124 * Replies a collection with the incomplete children this relation refers to. -
trunk/src/org/openstreetmap/josm/data/osm/IWay.java
r18019 r18814 61 61 */ 62 62 List<N> getNodes(); 63 64 @Override 65 default List<N> getChildren() { 66 return this.getNodes(); 67 } 63 68 64 69 /** -
trunk/src/org/openstreetmap/josm/data/osm/Relation.java
r18801 r18814 148 148 boolean locked = writeLock(); 149 149 try { 150 List<RelationMember> members = getMembers();151 RelationMember result = members.remove(index);152 setMembers( members);150 List<RelationMember> currentMembers = getMembers(); 151 RelationMember result = currentMembers.remove(index); 152 setMembers(currentMembers); 153 153 return result; 154 154 } finally { … … 390 390 boolean locked = writeLock(); 391 391 try { 392 List<RelationMember> members = getMembers();393 members.removeAll(getMembersFor(primitives));394 setMembers( members);392 List<RelationMember> currentMembers = getMembers(); 393 currentMembers.removeAll(getMembersFor(primitives)); 394 setMembers(currentMembers); 395 395 } finally { 396 396 writeUnlock(locked); … … 428 428 429 429 @Override 430 public List<OsmPrimitive> getChildren() { 431 return getMemberPrimitivesList(); 432 } 433 434 @Override 430 435 public OsmPrimitiveType getType() { 431 436 return OsmPrimitiveType.RELATION; … … 444 449 445 450 BBox box = new BBox(); 446 addToBBox(box, new HashSet< PrimitiveId>());451 addToBBox(box, new HashSet<>()); 447 452 if (getDataSet() == null) { 448 453 return box; … … 494 499 for (RelationMember rm: members) { 495 500 if (rm.getMember().isDeleted()) 496 throw new DataIntegrityProblemException("Deleted member referenced: " + t oString(), null, this, rm.getMember());501 throw new DataIntegrityProblemException("Deleted member referenced: " + this, null, this, rm.getMember()); 497 502 } 498 503 } … … 560 565 public List<? extends OsmPrimitive> findRelationMembers(String role) { 561 566 return IRelation.super.findRelationMembers(role).stream() 562 .filter( m -> m instanceofOsmPrimitive)563 .map( m -> (OsmPrimitive) m).collect(Collectors.toList());567 .filter(OsmPrimitive.class::isInstance) 568 .map(OsmPrimitive.class::cast).collect(Collectors.toList()); 564 569 } 565 570 -
trunk/src/org/openstreetmap/josm/gui/MainMenu.java
r18616 r18814 97 97 import org.openstreetmap.josm.actions.SelectAllAction; 98 98 import org.openstreetmap.josm.actions.SelectNonBranchingWaySequencesAction; 99 import org.openstreetmap.josm.actions.SelectSharedChildObjectsAction; 99 100 import org.openstreetmap.josm.actions.SessionSaveAction; 100 101 import org.openstreetmap.josm.actions.SessionSaveAsAction; … … 143 144 * This is the JOSM main menu bar. It is overwritten to initialize itself and provide all menu 144 145 * entries as member variables (sort of collect them). 145 * 146 * <p> 146 147 * It also provides possibilities to attach new menu entries (used by plugins). 147 148 * … … 320 321 /** Selection / Non-branching way sequences */ 321 322 public final SelectNonBranchingWaySequencesAction nonBranchingWaySequences = new SelectNonBranchingWaySequencesAction(); 323 /** Selection / Shared Child Objects */ 324 public final SelectSharedChildObjectsAction sharedChildObjects = new SelectSharedChildObjectsAction(); 322 325 323 326 /* Audio menu */ … … 471 474 for (int i = 0; i < m.getComponentCount()-1; i++) { 472 475 // hide separator if the next menu item is one as well 473 if (m.getComponent(i) instanceof JSeparator && m.getComponent(i +1) instanceof JSeparator) {474 ((JSeparator)m.getComponent(i)).setVisible(false);476 if (m.getComponent(i) instanceof JSeparator && m.getComponent(i + 1) instanceof JSeparator) { 477 m.getComponent(i).setVisible(false); 475 478 } 476 479 } 477 480 // hide separator at the end of the menu 478 if (m.getComponent(m.getComponentCount() -1) instanceof JSeparator) {479 ((JSeparator)m.getComponent(m.getComponentCount()-1)).setVisible(false);481 if (m.getComponent(m.getComponentCount() - 1) instanceof JSeparator) { 482 m.getComponent(m.getComponentCount() - 1).setVisible(false); 480 483 } 481 484 } … … 493 496 /** 494 497 * Add a JosmAction at the end of a menu. 495 * 498 * <p> 496 499 * This method handles all the shortcut handling. It also makes sure that actions that are 497 500 * handled by the OS are not duplicated on the menu. … … 506 509 /** 507 510 * Add a JosmAction at the end of a menu. 508 * 511 * <p> 509 512 * This method handles all the shortcut handling. It also makes sure that actions that are 510 513 * handled by the OS are not duplicated on the menu. … … 520 523 /** 521 524 * Add a JosmAction at the end of a menu. 522 * 525 * <p> 523 526 * This method handles all the shortcut handling. It also makes sure that actions that are 524 527 * handled by the OS are not duplicated on the menu. … … 552 555 /** 553 556 * Add the JosmAction {@code actionToBeInserted} directly below {@code existingMenuEntryAction}. 554 * 557 * <p> 555 558 * This method handles all the shortcut handling. It also makes sure that actions that are 556 559 * handled by the OS are not duplicated on the menu. … … 575 578 /** 576 579 * Add a JosmAction to a menu. 577 * 580 * <p> 578 581 * This method handles all the shortcut handling. It also makes sure that actions that are 579 582 * handled by the OS are not duplicated on the menu. … … 864 867 add(selectionMenu, invertSelection, true); 865 868 add(selectionMenu, nonBranchingWaySequences); 869 add(selectionMenu, sharedChildObjects, true); 866 870 867 871 add(toolsMenu, splitWay); … … 948 952 public Optional<JCheckBoxMenuItem> findMapModeMenuItem(MapMode mode) { 949 953 return Arrays.stream(modeMenu.getMenuComponents()) 950 .filter( m -> m instanceofJCheckBoxMenuItem)951 .map( m -> (JCheckBoxMenuItem) m)954 .filter(JCheckBoxMenuItem.class::isInstance) 955 .map(JCheckBoxMenuItem.class::cast) 952 956 .filter(m -> Objects.equals(mode, m.getAction())) 953 957 .findFirst();
Note:
See TracChangeset
for help on using the changeset viewer.