source: osm/applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionLambertZone.java@ 15707

Last change on this file since 15707 was 13611, checked in by pieren, 16 years ago

Fix minor issues.

  • Property svn:eol-style set to native
File size: 1.9 KB
Line 
1package cadastre_fr;
2
3import static org.openstreetmap.josm.tools.I18n.tr;
4
5import java.awt.GridBagLayout;
6import java.awt.event.ActionEvent;
7
8import javax.swing.JComboBox;
9import javax.swing.JLabel;
10import javax.swing.JOptionPane;
11import javax.swing.JPanel;
12
13import org.openstreetmap.josm.Main;
14import org.openstreetmap.josm.actions.JosmAction;
15import org.openstreetmap.josm.data.projection.Lambert;
16import org.openstreetmap.josm.tools.GBC;
17
18public class MenuActionLambertZone extends JosmAction {
19
20 private static final long serialVersionUID = 1L;
21
22 public static String name = "Change Lambert zone";
23
24 public MenuActionLambertZone() {
25 super(tr(name), "cadastre_small", tr("Set manually the Lambert zone (e.g. for locations between two zones)"),
26 null, false);
27 }
28
29 public void actionPerformed(ActionEvent e) {
30 JPanel p = new JPanel(new GridBagLayout());
31 String[] zones = { "", "1 (51.30 to 48.15 degrees)", "2 (48.15 to 45.45 degrees)", "3 (45.45 to 42.76 degrees)", "4 (Corsica)" };
32 final JComboBox inputLambertZone = new JComboBox(zones);
33 JLabel newLambertZone = new JLabel(tr("Zone"));
34 p.add(newLambertZone, GBC.std());
35 p.add(inputLambertZone, GBC.eol().fill(GBC.HORIZONTAL).insets(5, 0, 0, 0));
36 JOptionPane pane = new JOptionPane(p, JOptionPane.INFORMATION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null) {
37 private static final long serialVersionUID = 1L;
38
39 @Override
40 public void selectInitialValue() {
41 inputLambertZone.setSelectedIndex(0);
42 }
43 };
44 pane.createDialog(Main.parent, tr("Lambert zone")).setVisible(true);
45 if (!Integer.valueOf(JOptionPane.OK_OPTION).equals(pane.getValue()))
46 return;
47 if (inputLambertZone.getSelectedIndex() > 0) {
48 Lambert.layoutZone = inputLambertZone.getSelectedIndex() - 1;
49 }
50 }
51}
Note: See TracBrowser for help on using the repository browser.