Changeset 5617 in josm for trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java
- Timestamp:
- 2012-12-10T02:04:50+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java
r5541 r5617 336 336 activeToolbar.setBorderPainted(false); 337 337 activeToolbar.setOpaque(false); 338 activeToolbar.add(new NewEntryAction()); 338 activeToolbar.add(new NewEntryAction(ImageryInfo.ImageryType.WMS)); 339 activeToolbar.add(new NewEntryAction(ImageryInfo.ImageryType.TMS)); 339 340 //activeToolbar.add(edit); TODO 340 341 activeToolbar.add(remove); … … 420 421 421 422 private class NewEntryAction extends AbstractAction { 422 public NewEntryAction() { 423 putValue(NAME, tr("New")); 424 putValue(SHORT_DESCRIPTION, tr("Add a new WMS/TMS entry by entering the URL")); 423 424 private final ImageryInfo.ImageryType type; 425 426 public NewEntryAction(ImageryInfo.ImageryType type) { 427 putValue(NAME, type.toString()); 428 putValue(SHORT_DESCRIPTION, tr("Add a new {0} entry by entering the URL", type.toString())); 425 429 putValue(SMALL_ICON, ImageProvider.get("dialogs", "add")); 430 this.type = type; 426 431 } 427 432 428 433 public void actionPerformed(ActionEvent evt) { 429 final AddWMSLayerPanel p = new AddWMSLayerPanel(); 434 final AddImageryPanel p; 435 if (ImageryInfo.ImageryType.WMS.equals(type)) { 436 p = new AddWMSLayerPanel(); 437 } else if (ImageryInfo.ImageryType.TMS.equals(type)) { 438 p = new AddTMSLayerPanel(); 439 } else { 440 throw new IllegalStateException("Type " + type + " not supported"); 441 } 430 442 GuiHelper.prepareResizeableOptionPane(p, new Dimension(250, 350)); 431 443 int answer = JOptionPane.showConfirmDialog(
Note:
See TracChangeset
for help on using the changeset viewer.