53 |
import javax.swing.BorderFactory; |
import javax.swing.BorderFactory; |
54 |
import javax.swing.BoxLayout; |
import javax.swing.BoxLayout; |
55 |
import javax.swing.JCheckBoxMenuItem; |
import javax.swing.JCheckBoxMenuItem; |
|
import javax.swing.JFileChooser; |
|
56 |
import javax.swing.JMenu; |
import javax.swing.JMenu; |
57 |
import javax.swing.JMenuBar; |
import javax.swing.JMenuBar; |
58 |
import javax.swing.JMenuItem; |
import javax.swing.JMenuItem; |
71 |
import org.jsampler.Server; |
import org.jsampler.Server; |
72 |
|
|
73 |
import org.jsampler.view.JSChannelsPane; |
import org.jsampler.view.JSChannelsPane; |
|
import org.jsampler.view.LscpFileFilter; |
|
74 |
import org.jsampler.view.SessionViewConfig; |
import org.jsampler.view.SessionViewConfig; |
75 |
|
|
76 |
import org.jsampler.view.fantasia.basic.FantasiaPainter; |
import org.jsampler.view.fantasia.basic.FantasiaPainter; |
712 |
|
|
713 |
protected boolean |
protected boolean |
714 |
runScript() { |
runScript() { |
715 |
String s = preferences().getStringProperty("lastScriptLocation"); |
File f = StdUtils.showOpenLscpFileChooser(); |
716 |
JFileChooser fc = new JFileChooser(s); |
if(f == null) return false; |
717 |
fc.setFileFilter(new LscpFileFilter()); |
runScript(f); |
|
int result = fc.showOpenDialog(this); |
|
|
if(result != JFileChooser.APPROVE_OPTION) return false; |
|
|
|
|
|
String path = fc.getCurrentDirectory().getAbsolutePath(); |
|
|
preferences().setStringProperty("lastScriptLocation", path); |
|
|
|
|
|
runScript(fc.getSelectedFile()); |
|
718 |
|
|
719 |
return true; |
return true; |
720 |
} |
} |
728 |
FileReader fr; |
FileReader fr; |
729 |
try { fr = new FileReader(script); } |
try { fr = new FileReader(script); } |
730 |
catch(FileNotFoundException e) { |
catch(FileNotFoundException e) { |
731 |
HF.showErrorMessage(i18n.getMessage("FileNotFound!")); |
HF.showErrorMessage(i18n.getError("fileNotFound!")); |
732 |
return; |
return; |
733 |
} |
} |
734 |
|
|