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

Last change on this file since 3128 was 2017, checked in by Gubaer, 15 years ago

removed OptionPaneUtil
cleanup of deprecated Layer API
cleanup of deprecated APIs in OsmPrimitive and Way
cleanup of imports

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1// License: GPL. Copyright 2007 by Immanuel Scholz and others
2package org.openstreetmap.josm.gui.dialogs;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import java.awt.Component;
7import java.awt.event.ActionEvent;
8
9import javax.swing.AbstractAction;
10import javax.swing.JList;
11import javax.swing.JOptionPane;
12import javax.swing.JPopupMenu;
13
14import org.openstreetmap.josm.Main;
15import org.openstreetmap.josm.gui.layer.Layer;
16import org.openstreetmap.josm.tools.ImageProvider;
17
18/**
19 * Popup menu handler for the layer list.
20 */
21public class LayerListPopup extends JPopupMenu {
22
23 public final static class InfoAction extends AbstractAction {
24 private final Layer layer;
25 public InfoAction(Layer layer) {
26 super(tr("Info"), ImageProvider.get("info"));
27 this.layer = layer;
28 }
29 public void actionPerformed(ActionEvent e) {
30 JOptionPane.showMessageDialog(
31 Main.parent,
32 layer.getInfoComponent(),
33 tr("Information about layer"),
34 JOptionPane.INFORMATION_MESSAGE
35 );
36 }
37 }
38
39 public LayerListPopup(final JList layers, final Layer layer) {
40 for (Component c : layer.getMenuEntries()) {
41 add(c);
42 }
43 }
44}
Note: See TracBrowser for help on using the repository browser.