Changeset 3479 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2010-08-29T14:55:25+02:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/PurgeAction.java
r3450 r3479 59 59 /* translator note: other expressions for "purge" might be "forget", "clean", "obliterate", "prune" */ 60 60 super(tr("Purge..."), "purge", tr("Forget objects but do not delete them on server when uploading."), 61 Shortcut.registerShortcut("system:purge", tr("Edit: {0}", tr("Purge")), KeyEvent.VK_P, Shortcut.GROUP_MENU, Shortcut.SHIFT_DEFAULT)62 , true);61 Shortcut.registerShortcut("system:purge", tr("Edit: {0}", tr("Purge")), KeyEvent.VK_P, Shortcut.GROUP_MENU, Shortcut.SHIFT_DEFAULT) 62 , true); 63 63 putValue("help", HelpUtil.ht("/Action/Purge")); 64 64 } … … 81 81 */ 82 82 protected List<OsmPrimitive> toPurgeAdditionally; 83 83 84 84 @Override 85 85 public void actionPerformed(ActionEvent e) { … … 99 99 OsmPrimitive osm = toPurge.iterator().next(); 100 100 for (OsmPrimitive parent: osm.getReferrers()) { 101 if (toPurge.contains(parent) || toPurgeChecked.contains(parent)) 101 if (toPurge.contains(parent) || toPurgeChecked.contains(parent)) { 102 102 continue; 103 } 103 104 if (parent instanceof Way || (parent instanceof Relation && osm.isNew())) { 104 105 toPurgeAdditionally.add(parent); … … 118 119 // to-be-purged or of type relation. 119 120 TOP: 120 for (OsmPrimitive child : toPurgeChecked) { 121 if (child.isNew()) 122 continue; 123 for (OsmPrimitive parent : child.getReferrers()) { 124 if (parent instanceof Relation && !toPurgeChecked.contains(parent)) { 125 makeIncomplete.add(child); 126 continue TOP; 127 } 128 } 129 } 121 for (OsmPrimitive child : toPurgeChecked) { 122 if (child.isNew()) { 123 continue; 124 } 125 for (OsmPrimitive parent : child.getReferrers()) { 126 if (parent instanceof Relation && !toPurgeChecked.contains(parent)) { 127 makeIncomplete.add(child); 128 continue TOP; 129 } 130 } 131 } 130 132 131 133 // Add untagged way nodes. Do not add nodes that have other … … 137 139 Way w = (Way) osm; 138 140 NODE: 139 for (Node n : w.getNodes()) { 140 if (n.isTagged() || toPurgeChecked.contains(n)) 141 continue; 142 for (OsmPrimitive ref : n.getReferrers()) { 143 if (ref != w && !toPurgeChecked.contains(ref)) 144 continue NODE; 141 for (Node n : w.getNodes()) { 142 if (n.isTagged() || toPurgeChecked.contains(n)) { 143 continue; 144 } 145 for (OsmPrimitive ref : n.getReferrers()) { 146 if (ref != w && !toPurgeChecked.contains(ref)) { 147 continue NODE; 148 } 149 } 150 wayNodes.add(n); 145 151 } 146 wayNodes.add(n);147 }148 152 } 149 153 } … … 186 190 pnl.add(new JLabel("<html>"+ 187 191 tr("This operation makes JOSM forget the selected objects.<br> " + 188 "They will be removed from the layer, but <i>not</i> deleted<br> " +192 "They will be removed from the layer, but <i>not</i> deleted<br> " + 189 193 "on the server when uploading.")+"</html>", 190 194 ImageProvider.get("purge"), JLabel.LEFT), GBC.eol().fill(GBC.HORIZONTAL)); … … 193 197 pnl.add(new JSeparator(), GBC.eol().fill(GBC.HORIZONTAL).insets(0,5,0,5)); 194 198 pnl.add(new JLabel("<html>"+ 195 tr("The following dependent objects will be purged<br> " +196 "in addition to the selected objects:")+"</html>",197 ImageProvider.get("warning-small"), JLabel.LEFT), GBC.eol().fill(GBC.HORIZONTAL));199 tr("The following dependent objects will be purged<br> " + 200 "in addition to the selected objects:")+"</html>", 201 ImageProvider.get("warning-small"), JLabel.LEFT), GBC.eol().fill(GBC.HORIZONTAL)); 198 202 199 203 Collections.sort(toPurgeAdditionally, new Comparator<OsmPrimitive>() { … … 202 206 if (type != 0) 203 207 return -type; 204 return ( new Long(o1.getUniqueId())).compareTo(o2.getUniqueId());208 return (Long.valueOf(o1.getUniqueId())).compareTo(o2.getUniqueId()); 205 209 } 206 210 }); … … 210 214 @Override 211 215 public Component getListCellRendererComponent(JList list, 212 213 214 215 216 Object value, 217 int index, 218 boolean isSelected, 219 boolean cellHasFocus) { 216 220 return super.getListCellRendererComponent(list, value, index, true, false); 217 221 } … … 240 244 pnl.add(new JLabel("<html>"+tr("Some of the objects are modified.<br> " + 241 245 "Proceed, if these changes should be discarded."+"</html>"), 242 246 ImageProvider.get("warning-small"), JLabel.LEFT), 243 247 GBC.eol().fill(GBC.HORIZONTAL)); 244 248 } -
trunk/src/org/openstreetmap/josm/actions/search/PushbackTokenizer.java
r3385 r3479 70 70 throw new RuntimeException(e.getMessage(), e); 71 71 } 72 }73 74 private long getNumber() {75 long result = 0;76 while (Character.isDigit(c)) {77 result = result * 10 + (c - '0');78 getChar();79 }80 return result;81 72 } 82 73
Note:
See TracChangeset
for help on using the changeset viewer.