Changeset 2682 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2009-12-27T14:33:13+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/UpdateSelectionAction.java
r2626 r2682 87 87 tr("Updates the currently selected objects from the server (re-downloads data)"), 88 88 Shortcut.registerShortcut("file:updateselection", 89 tr("Update Selection"),89 tr("Update selection"), 90 90 KeyEvent.VK_U, 91 91 Shortcut.GROUP_HOTKEY + Shortcut.GROUPS_ALT2), 92 92 true); 93 93 putValue("help", ht("UpdateSelection")); 94 } 95 public UpdateSelectionAction(String name, String iconName, String tooltip, 96 Shortcut shortcut, boolean register) { 97 super(name, iconName, tooltip, shortcut, register); 94 98 } 95 99 … … 99 103 setEnabled(false); 100 104 } else { 101 updateEnabledState(get CurrentDataSet().getSelected());105 updateEnabledState(getData()); 102 106 } 103 107 } … … 114 118 if (! isEnabled()) 115 119 return; 116 Collection<OsmPrimitive> selection = get CurrentDataSet().getSelected();120 Collection<OsmPrimitive> selection = getData(); 117 121 if (selection.size() == 0) { 118 122 JOptionPane.showMessageDialog( … … 126 130 updatePrimitives(selection); 127 131 } 132 133 protected Collection<OsmPrimitive> getData() { 134 return getCurrentDataSet().getSelected(); 135 } 128 136 } -
trunk/src/org/openstreetmap/josm/data/osm/DataSet.java
r2657 r2682 182 182 o.add(osm); 183 183 } 184 return o; 185 } 186 187 /** 188 * @return A collection containing all modified primitives 189 */ 190 public Collection<OsmPrimitive> allModifiedPrimitives() { 191 Collection<OsmPrimitive> o = new LinkedList<OsmPrimitive>(); 192 for (OsmPrimitive osm : allPrimitives()) { 193 if (osm.isVisible() && osm.isModified()) { 194 o.add(osm); 195 } 196 } 184 197 return o; 185 198 } -
trunk/src/org/openstreetmap/josm/gui/MainMenu.java
r2626 r2682 63 63 import org.openstreetmap.josm.actions.UnselectAllAction; 64 64 import org.openstreetmap.josm.actions.UpdateDataAction; 65 import org.openstreetmap.josm.actions.UpdateModifiedAction; 65 66 import org.openstreetmap.josm.actions.UpdateSelectionAction; 66 67 import org.openstreetmap.josm.actions.UploadAction; … … 102 103 public final JosmAction update = new UpdateDataAction(); 103 104 public final JosmAction updateSelection = new UpdateSelectionAction(); 105 public final JosmAction updateModified = new UpdateModifiedAction(); 104 106 public final JosmAction upload = new UploadAction(); 105 107 public final JosmAction uploadSelection = new UploadSelectionAction(); … … 210 212 add(fileMenu, update); 211 213 add(fileMenu, updateSelection); 214 add(fileMenu, updateModified); 212 215 fileMenu.addSeparator(); 213 216 add(fileMenu, upload);
Note:
See TracChangeset
for help on using the changeset viewer.