[Bprocessor-commit] gui/src/net/sourceforge/bprocessor/gui/actions FileImportActionListener.java, 1
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Nikolaj B. <nbr...@us...> - 2007-01-08 12:31:57
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20338/src/net/sourceforge/bprocessor/gui/actions Modified Files: FileImportActionListener.java Log Message: Implemented import for csv files with points from landmålergården Index: FileImportActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/FileImportActionListener.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FileImportActionListener.java 21 Nov 2006 17:29:34 -0000 1.3 --- FileImportActionListener.java 8 Jan 2007 12:31:48 -0000 1.4 *************** *** 8,11 **** --- 8,16 ---- import java.awt.event.ActionEvent; import java.awt.event.ActionListener; + import java.io.File; + + import javax.swing.JFileChooser; + + import net.sourceforge.bprocessor.model.Project; import org.apache.log4j.Logger; *************** *** 29,33 **** */ public void actionPerformed(ActionEvent e) { ! //TODO implement me } } --- 34,50 ---- */ public void actionPerformed(ActionEvent e) { ! JFileChooser loadChooser = new JFileChooser(Project.getInstance().getDefaultPath()); ! int lstate = loadChooser.showOpenDialog(null); ! File lfile = loadChooser.getSelectedFile(); ! if (lfile != null && ! lstate == JFileChooser.APPROVE_OPTION) { ! try { ! Project.getInstance().importCSV(lfile); ! } catch (Exception ex) { ! log.error("Could not open file: " + lfile, ex); ! } ! } } + + } |