Changeset 4096 in josm for trunk/src/org
- Timestamp:
- 2011-05-25T17:39:03+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/DownloadPrimitiveAction.java
r4081 r4096 4 4 import static org.openstreetmap.josm.gui.help.HelpUtil.ht; 5 5 import static org.openstreetmap.josm.tools.I18n.tr; 6 import static org.openstreetmap.josm.tools.I18n.trc; 6 7 import static org.openstreetmap.josm.tools.I18n.trn; 7 8 … … 57 58 58 59 public void actionPerformed(ActionEvent e) { 59 60 60 61 JPanel all = new JPanel(); 61 62 GroupLayout layout = new GroupLayout(all); … … 63 64 layout.setAutoCreateGaps(true); 64 65 layout.setAutoCreateContainerGaps(true); 65 66 66 67 JLabel lbl1 = new JLabel(tr("Object type:")); 67 68 OsmPrimitiveTypesComboBox cbType = new OsmPrimitiveTypesComboBox(); 68 cbType.addItem(new SimpleListItem("mixed", tr ("mixed")));69 cbType.addItem(new SimpleListItem("mixed", trc("osm object types", "mixed"))); 69 70 cbType.setToolTipText(tr("Choose the OSM object type")); 70 71 JLabel lbl2 = new JLabel(tr("Object ID:")); … … 83 84 + " In mixed mode, specify objects like this: <b>w123, n110, w12, r15</b><br/>")); 84 85 help.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED)); 85 86 86 87 layout.setVerticalGroup(layout.createSequentialGroup() 87 88 .addGroup(layout.createParallelGroup() … … 95 96 .addComponent(help) 96 97 ); 97 98 98 99 layout.setHorizontalGroup(layout.createParallelGroup() 99 100 .addGroup(layout.createSequentialGroup() … … 110 111 .addComponent(help) 111 112 ); 112 113 113 114 ExtendedDialog dialog = new ExtendedDialog(Main.parent, 114 115 tr("Download object"), … … 144 145 processItems(layer.isSelected(), cbType.getType(), tfId.getIds(), referrers.isSelected()); 145 146 } 146 147 void processItems(boolean newLayer, OsmPrimitiveType type, 147 148 void processItems(boolean newLayer, OsmPrimitiveType type, 148 149 final List<PrimitiveId> ids, 149 150 boolean downloadReferrers) { … … 155 156 final DownloadPrimitivesTask task = new DownloadPrimitivesTask(layer, ids); 156 157 Main.worker.submit(task); 157 158 158 159 if (downloadReferrers) { 159 160 for (PrimitiveId id : ids) { … … 161 162 } 162 163 } 163 164 164 165 Runnable showErrorsAndWarnings = new Runnable() { 165 166 @Override … … 169 170 final ExtendedDialog dlg = reportProblemDialog(errs, 170 171 trn("Object could not be downloaded", "Some objects could not be downloaded", errs.size()), 171 trn("One object could not be downloaded.<br>", 172 trn("One object could not be downloaded.<br>", 172 173 "{0} objects could not be downloaded.<br>", 173 174 errs.size(), 174 175 errs.size()) 175 176 + tr("The server replied with response code 404.<br>" 176 + "This usually means, the server does not know an object with the requested id."), 177 + "This usually means, the server does not know an object with the requested id."), 177 178 tr("missing objects:"), 178 179 JOptionPane.ERROR_MESSAGE … … 189 190 } 190 191 } 191 192 192 193 Set<PrimitiveId> del = new TreeSet<PrimitiveId>(); 193 194 DataSet ds = getCurrentDataSet(); … … 202 203 trn("Object deleted", "Objects deleted", del.size()), 203 204 trn( 204 "One downloaded object is deleted.", 205 "One downloaded object is deleted.", 205 206 "{0} downloaded objects are deleted.", 206 207 del.size(), … … 220 221 Main.worker.submit(showErrorsAndWarnings); 221 222 } 222 223 private ExtendedDialog reportProblemDialog(Set<PrimitiveId> errs, 223 224 private ExtendedDialog reportProblemDialog(Set<PrimitiveId> errs, 224 225 String TITLE, String TEXT, String LIST_LABEL, int msgType) { 225 226 JPanel p = new JPanel(new GridBagLayout()); … … 242 243 return new ExtendedDialog( 243 244 Main.parent, 244 TITLE, 245 TITLE, 245 246 new String[] { tr("Ok") }) 246 247 .setButtonIcons(new String[] { "ok" }) … … 252 253 final String data; 253 254 final String text; 254 255 public SimpleListItem(String data, String text) { 256 this.data = data; 257 this.text = text; 258 } 259 260 @Override public String toString() { 261 return text; 255 256 public SimpleListItem(String data, String text) { 257 this.data = data; 258 this.text = text; 259 } 260 261 @Override public String toString() { 262 return text; 262 263 } 263 264 }
Note:
See TracChangeset
for help on using the changeset viewer.