Changeset 29215 in osm for applications/editors/josm/plugins/smed2/src/panels
- Timestamp:
- 2013-01-29T21:49:08+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/panels/PanelMain.java
r29198 r29215 25 25 } 26 26 }; 27 private JButton openButton = null;28 final JFileChooser fc = new JFileChooser(); 29 private ActionListener al Open= new ActionListener() {27 private JButton importButton = null; 28 final JFileChooser ifc = new JFileChooser(); 29 private ActionListener alImport = new ActionListener() { 30 30 public void actionPerformed(java.awt.event.ActionEvent e) { 31 if (e.getSource() == openButton) {31 if (e.getSource() == importButton) { 32 32 messageBar.setText("Select file"); 33 int returnVal = fc.showOpenDialog(Main.parent); 33 int returnVal = ifc.showOpenDialog(Main.parent); 34 34 if (returnVal == JFileChooser.APPROVE_OPTION) { 35 Smed2Action.panelS57.startImport(fc.getSelectedFile()); 35 Smed2Action.panelS57.startImport(ifc.getSelectedFile()); 36 } else { 37 messageBar.setText(""); 38 } 39 } 40 } 41 }; 42 43 private JButton exportButton = null; 44 final JFileChooser efc = new JFileChooser(); 45 private ActionListener alExport = new ActionListener() { 46 public void actionPerformed(java.awt.event.ActionEvent e) { 47 if (e.getSource() == exportButton) { 48 messageBar.setText("Select file"); 49 int returnVal = efc.showOpenDialog(Main.parent); 50 if (returnVal == JFileChooser.APPROVE_OPTION) { 51 Smed2Action.panelS57.startExport(efc.getSelectedFile()); 36 52 } else { 37 53 messageBar.setText(""); … … 54 70 55 71 messageBar = new JTextField(); 56 messageBar.setBounds( 40, 430,320, 20);72 messageBar.setBounds(70, 430, 290, 20); 57 73 messageBar.setEditable(false); 58 74 messageBar.setBackground(Color.WHITE); 59 75 add(messageBar); 60 openButton = new JButton(new ImageIcon(getClass().getResource("/images/fileButton.png"))); 61 openButton.setBounds(10, 430, 20, 20); 62 add(openButton); 63 openButton.addActionListener(alOpen); 76 importButton = new JButton(new ImageIcon(getClass().getResource("/images/importButton.png"))); 77 importButton.setBounds(10, 430, 20, 20); 78 add(importButton); 79 importButton.addActionListener(alImport); 80 exportButton = new JButton(new ImageIcon(getClass().getResource("/images/exportButton.png"))); 81 exportButton.setBounds(40, 430, 20, 20); 82 add(exportButton); 83 exportButton.addActionListener(alExport); 64 84 saveButton = new JButton(); 65 85 saveButton.setBounds(370, 430, 100, 20);
Note:
See TracChangeset
for help on using the changeset viewer.