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

Last change on this file since 28938 was 28938, checked in by malcolmh, 13 years ago

save

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