Ignore:
Timestamp:
2012-12-10T02:04:50+01:00 (11 years ago)
Author:
simon04
Message:

see #8254 - new imagery entry wms_endpoint: Store WMS endpoint only, select layers at usage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java

    r5541 r5617  
    336336            activeToolbar.setBorderPainted(false);
    337337            activeToolbar.setOpaque(false);
    338             activeToolbar.add(new NewEntryAction());
     338            activeToolbar.add(new NewEntryAction(ImageryInfo.ImageryType.WMS));
     339            activeToolbar.add(new NewEntryAction(ImageryInfo.ImageryType.TMS));
    339340            //activeToolbar.add(edit); TODO
    340341            activeToolbar.add(remove);
     
    420421
    421422        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()));
    425429                putValue(SMALL_ICON, ImageProvider.get("dialogs", "add"));
     430                this.type = type;
    426431            }
    427432
    428433            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                }
    430442                GuiHelper.prepareResizeableOptionPane(p, new Dimension(250, 350));
    431443                int answer = JOptionPane.showConfirmDialog(
Note: See TracChangeset for help on using the changeset viewer.