Ignore:
Timestamp:
2013-01-29T21:49:08+01:00 (12 years ago)
Author:
malcolmh
Message:

save

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed2/src/panels/PanelMain.java

    r29198 r29215  
    2525                }
    2626        };
    27         private JButton openButton = null;
    28         final JFileChooser fc = new JFileChooser();
    29         private ActionListener alOpen = new ActionListener() {
     27        private JButton importButton = null;
     28        final JFileChooser ifc = new JFileChooser();
     29        private ActionListener alImport = new ActionListener() {
    3030                public void actionPerformed(java.awt.event.ActionEvent e) {
    31                         if (e.getSource() == openButton) {
     31                        if (e.getSource() == importButton) {
    3232        messageBar.setText("Select file");
    33         int returnVal = fc.showOpenDialog(Main.parent);
     33        int returnVal = ifc.showOpenDialog(Main.parent);
    3434        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());
    3652         } else {
    3753           messageBar.setText("");
     
    5470               
    5571    messageBar = new JTextField();
    56     messageBar.setBounds(40, 430, 320, 20);
     72    messageBar.setBounds(70, 430, 290, 20);
    5773    messageBar.setEditable(false);
    5874    messageBar.setBackground(Color.WHITE);
    5975    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);
    6484                saveButton = new JButton();
    6585                saveButton.setBounds(370, 430, 100, 20);
Note: See TracChangeset for help on using the changeset viewer.