Changeset 5724 in josm for trunk/src/org
- Timestamp:
- 2013-02-17T15:01:13+01:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/ReverseWayAction.java
r4982 r5724 19 19 import org.openstreetmap.josm.command.Command; 20 20 import org.openstreetmap.josm.command.SequenceCommand; 21 import org.openstreetmap.josm.corrector.ReverseWayNoTagCorrector; 21 22 import org.openstreetmap.josm.corrector.ReverseWayTagCorrector; 22 23 import org.openstreetmap.josm.corrector.UserCancelException; … … 109 110 * @param w the way 110 111 * @return the reverse command and the tag correction commands 112 * @throws UserCancelException if user cancels a reverse warning dialog 111 113 */ 112 114 public static ReverseWayResult reverseWay(Way w) throws UserCancelException { 115 ReverseWayNoTagCorrector.checkAndConfirmReverseWay(w); 113 116 Way wnew = new Way(w); 114 117 List<Node> nodesCopy = wnew.getNodes(); -
trunk/src/org/openstreetmap/josm/data/osm/TagCollection.java
r5266 r5724 24 24 * A TagCollection can be created: 25 25 * <ul> 26 * <li>from the tags managed by a specific {@link OsmPrimitive} with {@link #from( OsmPrimitive)}</li>26 * <li>from the tags managed by a specific {@link OsmPrimitive} with {@link #from(Tagged)}</li> 27 27 * <li>from the union of all tags managed by a collection of {@link OsmPrimitive}s with {@link #unionOfAllPrimitives(Collection)}</li> 28 28 * <li>from the union of all tags managed by a {@link DataSet} with {@link #unionOfAllPrimitives(DataSet)}</li> … … 51 51 public static TagCollection from(Tagged primitive) { 52 52 TagCollection tags = new TagCollection(); 53 for (String key: primitive.keySet()) { 54 tags.add(new Tag(key, primitive.get(key))); 53 if (primitive != null) { 54 for (String key: primitive.keySet()) { 55 tags.add(new Tag(key, primitive.get(key))); 56 } 55 57 } 56 58 return tags; … … 158 160 159 161 /** 162 * Creates a tag collection from <code>tags</code>. 163 * @param tags the collection of tags 164 * @since 5724 165 */ 166 public TagCollection(Collection<Tag> tags) { 167 add(tags); 168 } 169 170 /** 160 171 * Replies the number of tags in this tag collection 161 172 * … … 637 648 * Does nothing if primitives is null 638 649 * 639 * @param primitive 650 * @param primitives the collection of primitives 640 651 * @throws IllegalStateException thrown if this tag collection can't be applied 641 652 * because there are keys with multiple values … … 657 668 */ 658 669 public TagCollection intersect(TagCollection other) { 659 if (other == null) { 660 other = new TagCollection(); 661 } 662 TagCollection ret = new TagCollection(this); 663 for (Tag tag: tags) { 664 if (other.contains(tag)) { 665 ret.add(tag); 670 TagCollection ret = new TagCollection(); 671 if (other != null) { 672 for (Tag tag: tags) { 673 if (other.contains(tag)) { 674 ret.add(tag); 675 } 666 676 } 667 677 } -
trunk/src/org/openstreetmap/josm/gui/ConditionalOptionPaneUtil.java
r5266 r5724 98 98 * @param messageType the message type 99 99 * @param options a list of options 100 * @param defaultOption the default option 100 * @param defaultOption the default option; only meaningful if options is used; can be null 101 101 * 102 102 * @return the option selected by user. {@link JOptionPane#CLOSED_OPTION} if the dialog was closed. -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r5614 r5724 31 31 import java.util.Set; 32 32 33 import javax.swing.*; 33 import javax.swing.AbstractAction; 34 import javax.swing.BorderFactory; 35 import javax.swing.InputMap; 36 import javax.swing.JComponent; 37 import javax.swing.JLabel; 38 import javax.swing.JMenu; 39 import javax.swing.JMenuItem; 40 import javax.swing.JOptionPane; 41 import javax.swing.JPanel; 42 import javax.swing.JScrollPane; 43 import javax.swing.JSplitPane; 44 import javax.swing.JTabbedPane; 45 import javax.swing.JToolBar; 46 import javax.swing.KeyStroke; 47 import javax.swing.SwingUtilities; 34 48 import javax.swing.event.ChangeEvent; 35 49 import javax.swing.event.ChangeListener; … … 59 73 import org.openstreetmap.josm.gui.DefaultNameFormatter; 60 74 import org.openstreetmap.josm.gui.HelpAwareOptionPane; 75 import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec; 61 76 import org.openstreetmap.josm.gui.MainMenu; 62 77 import org.openstreetmap.josm.gui.SideButton; 63 import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;64 import org.openstreetmap.josm.gui.dialogs.properties.PresetListPanel;65 78 import org.openstreetmap.josm.gui.dialogs.properties.PresetListPanel.PresetHandler; 66 79 import org.openstreetmap.josm.gui.help.ContextSensitiveHelpAction; … … 697 710 } 698 711 699 static boolean confirmAddingPrim tive(OsmPrimitive primitive) throws AddAbortException {712 static boolean confirmAddingPrimitive(OsmPrimitive primitive) throws AddAbortException { 700 713 String msg = tr("<html>This relation already has one or more members referring to<br>" 701 714 + "the object ''{0}''<br>" … … 747 760 continue; 748 761 } else if (MemberTableModel.hasMembersReferringTo(relation.getMembers(), Collections.singleton(p)) 749 && !confirmAddingPrim tive(p)) {762 && !confirmAddingPrimitive(p)) { 750 763 continue; 751 764 } … … 776 789 } 777 790 if (isPotentialDuplicate(primitive)) { 778 if (confirmAddingPrim tive(primitive)) {791 if (confirmAddingPrimitive(primitive)) { 779 792 ret.add(primitive); 780 793 }
Note:
See TracChangeset
for help on using the changeset viewer.