Changeset 5963 in josm for trunk/src/org


Ignore:
Timestamp:
2013-05-14T23:55:50+02:00 (12 years ago)
Author:
Don-vip
Message:

fix #5790 - No layer information for Imagery Sources

Location:
trunk/src/org/openstreetmap/josm/gui/layer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java

    r5808 r5963  
    1010import java.awt.Font;
    1111import java.awt.Graphics;
     12import java.awt.GridBagLayout;
    1213import java.awt.Toolkit;
    1314import java.awt.event.ActionEvent;
     
    2223import javax.swing.JCheckBoxMenuItem;
    2324import javax.swing.JComponent;
     25import javax.swing.JLabel;
    2426import javax.swing.JMenu;
    2527import javax.swing.JMenuItem;
     28import javax.swing.JPanel;
    2629import javax.swing.JPopupMenu;
    2730import javax.swing.JSeparator;
     
    3639import org.openstreetmap.josm.data.preferences.IntegerProperty;
    3740import org.openstreetmap.josm.gui.MenuScroller;
     41import org.openstreetmap.josm.tools.GBC;
    3842import org.openstreetmap.josm.tools.ImageProvider;
     43import org.openstreetmap.josm.tools.UrlLabel;
    3944
    4045public abstract class ImageryLayer extends Layer {
     
    120125    @Override
    121126    public Object getInfoComponent() {
    122         return getToolTipText();
     127        JPanel panel = new JPanel(new GridBagLayout());
     128        panel.add(new JLabel(getToolTipText()), GBC.eol());
     129        if (info != null) {
     130            String url = info.getUrl();
     131            if (url != null) {
     132                panel.add(new JLabel(tr("URL: ")), GBC.std().insets(0, 5, 2, 0));
     133                panel.add(new UrlLabel(url), GBC.eol().insets(2, 5, 10, 0));
     134            }
     135            if (dx != 0.0 || dy != 0.0) {
     136                panel.add(new JLabel(tr("Offset: ") + dx + ";" + dy), GBC.eol().insets(0, 5, 10, 0));
     137            }
     138        }
     139        return panel;
    123140    }
    124141
  • trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java

    r5898 r5963  
    14871487    @Override
    14881488    public String getToolTipText() {
    1489         return null;
     1489        return tr("TMS layer ({0}), downloading in zoom {1}", getName(), currentZoomLevel);
    14901490    }
    14911491
Note: See TracChangeset for help on using the changeset viewer.