source: josm/src/org/openstreetmap/josm/gui/dialogs/LayerListPopup.java@ 103

Last change on this file since 103 was 103, checked in by imi, 18 years ago
  • fixed unicode compatibility
  • added Layer menu which mirrors the layer list context menu
  • added "convert to data layer" for all gps layers
  • removed raw gpx import and 0.2 osm-file import
  • removed dependency to JDOM
File size: 947 bytes
Line 
1package org.openstreetmap.josm.gui.dialogs;
2
3import java.awt.Component;
4import java.awt.event.ActionEvent;
5
6import javax.swing.AbstractAction;
7import javax.swing.JList;
8import javax.swing.JOptionPane;
9import javax.swing.JPopupMenu;
10
11import org.openstreetmap.josm.Main;
12import org.openstreetmap.josm.gui.layer.Layer;
13import org.openstreetmap.josm.tools.ImageProvider;
14
15/**
16 * Popup menu handler for the layer list.
17 */
18public class LayerListPopup extends JPopupMenu {
19
20 public final static class InfoAction extends AbstractAction {
21 private final Layer layer;
22 public InfoAction(Layer layer) {
23 super("Info", ImageProvider.get("info"));
24 this.layer = layer;
25 }
26 public void actionPerformed(ActionEvent e) {
27 JOptionPane.showMessageDialog(Main.parent, layer.getInfoComponent());
28 }
29 }
30
31 public LayerListPopup(final JList layers, final Layer layer) {
32 for (Component c : layer.getMenuEntries())
33 add(c);
34 }
35}
Note: See TracBrowser for help on using the repository browser.