source: osm/applications/editors/josm/plugins/smed2/src/panels/PanelMain.java@ 29097

Last change on this file since 29097 was 29074, checked in by malcolmh, 12 years ago

save

File size: 2.0 KB
Line 
1package panels;
2
3import static org.openstreetmap.josm.tools.I18n.tr;
4
5import java.awt.Color;
6import java.awt.Dimension;
7import java.awt.Rectangle;
8import java.awt.event.ActionListener;
9
10import javax.swing.*;
11
12import org.openstreetmap.josm.Main;
13
14import smed2.Smed2Action;
15
16public class PanelMain extends JPanel {
17
18 private static final long serialVersionUID = 1L;
19
20 private JTabbedPane tabs = null;
21// public PanelF panelF = null;
22 public static JTextField messageBar = null;
23 public JButton saveButton = null;
24 private ActionListener alSave = new ActionListener() {
25 public void actionPerformed(java.awt.event.ActionEvent e) {
26// item.saveSign(???);
27 }
28 };
29 private JButton openButton = null;
30 final JFileChooser fc = new JFileChooser();
31 private ActionListener alOpen = new ActionListener() {
32 public void actionPerformed(java.awt.event.ActionEvent e) {
33 if (e.getSource() == openButton) {
34 messageBar.setText("Select file");
35 int returnVal = fc.showOpenDialog(Main.parent);
36 if (returnVal == JFileChooser.APPROVE_OPTION) {
37 Smed2Action.panelS57.startImport(fc.getSelectedFile());
38 } else {
39 messageBar.setText("");
40 }
41 }
42 }
43 };
44
45 public PanelMain() {
46
47 setLayout(null);
48 setSize(new Dimension(480, 480));
49 tabs = new JTabbedPane(JTabbedPane.TOP);
50 tabs.setBounds(new Rectangle(0, 0, 480, 420));
51
52// JPanel panelF = new PanelF();
53// tabs.addTab(null, new ImageIcon(getClass().getResource("/images/tabF.png")), panelF, Messages.getString("Ports"));
54
55 add(tabs);
56
57 messageBar = new JTextField();
58 messageBar.setBounds(40, 430, 320, 20);
59 messageBar.setEditable(false);
60 messageBar.setBackground(Color.WHITE);
61 add(messageBar);
62 openButton = new JButton(new ImageIcon(getClass().getResource("/images/fileButton.png")));
63 openButton.setBounds(10, 430, 20, 20);
64 add(openButton);
65 openButton.addActionListener(alOpen);
66 saveButton = new JButton();
67 saveButton.setBounds(370, 430, 100, 20);
68 saveButton.setText(tr("Save"));
69 add(saveButton);
70 saveButton.addActionListener(alSave);
71
72 }
73}
Note: See TracBrowser for help on using the repository browser.