package dukeScrobbler; import java.io.File; import java.io.IOException; import javax.swing.JFileChooser; import javax.swing.JPanel; import com.hp.hpl.guess.Guess; import com.planetj.taste.impl.model.file.FileDataModel; import com.planetj.taste.model.DataModel; /** * GuessScrobbler gets a Taste data text file from the user, converts it into a * GDF file, and then loads GUESS using this generated GDF. * * @author Ben Spain * */ public class GuessScrobbler { public static DataModel tasteData; public static void main(String[] args) { DataModel m = null; JFileChooser fc = new JFileChooser(); int returnVal = fc.showOpenDialog(new JPanel()); // If user cancels, program exits if (returnVal == JFileChooser.APPROVE_OPTION) { String path = fc.getSelectedFile().getAbsolutePath(); try { tasteData = new FileDataModel(new File(path)); File f = new File("generatedGDF.gdf"); gdfMaker.makeGDF(tasteData, f); /* loadAll.py loads the Node Attribute and Scrobbler dockables */ String[] a = { f.toString(), "loadAll.py" }; Guess.main(a); } catch (Exception e) { e.printStackTrace(); } } } }