Search in sources :

Example 1 with FileChooserFactory

use of net.parostroj.timetable.gui.actions.impl.FileChooserFactory in project grafikon by jub77.

the class MainFrame method ouputTemplatesMenuItemActionPerformed.

private void ouputTemplatesMenuItemActionPerformed(java.awt.event.ActionEvent evt) {
    // output templates list dialog
    OutputTemplateListDialog dialog = new OutputTemplateListDialog(this, true);
    dialog.setLocationRelativeTo(this);
    dialog.registerContext(model.getGuiContext());
    OutputSettings settings = model.getOutputSettings();
    FileChooserFactory chooserFactory = FileChooserFactory.getInstance();
    File outputDirectory = chooserFactory.getLocation(FileChooserFactory.Type.OUTPUT_DIRECTORY);
    try (CloseableFileChooser allChooser = chooserFactory.getFileChooser(FileChooserFactory.Type.ALL_FILES)) {
        dialog.showDialog(model.getDiagram(), outputDirectory, allChooser, new Settings(settings.getLocale()));
        dialog.dispose();
    }
}
Also used : FileChooserFactory(net.parostroj.timetable.gui.actions.impl.FileChooserFactory) OutputSettings(net.parostroj.timetable.gui.data.OutputSettings) CloseableFileChooser(net.parostroj.timetable.gui.actions.impl.CloseableFileChooser) File(java.io.File) LSFile(net.parostroj.timetable.model.ls.LSFile) Settings(net.parostroj.timetable.output2.OutputWriter.Settings) OutputSettings(net.parostroj.timetable.gui.data.OutputSettings)

Example 2 with FileChooserFactory

use of net.parostroj.timetable.gui.actions.impl.FileChooserFactory in project grafikon by jub77.

the class MainFrame method initAndPreload.

private void initAndPreload(SplashScreenInfo info) {
    // preload FileLoadSave
    info.setText(getInfoText("Registering LS..."));
    LSFileFactory.getInstance();
    LSLibraryFactory.getInstance();
    // initialize groovy
    info.setText(getInfoText("Initializing Groovy..."));
    new GroovyShell().parse("");
    // initialize javascript
    info.setText(getInfoText("Initializing JavaScript..."));
    new ScriptEngineManager().getEngineByName("javascript");
    // preload file dialogs
    info.setText(getInfoText("Preloading dialogs..."));
    FileChooserFactory fcf = FileChooserFactory.getInstance();
    fcf.initialize();
}
Also used : FileChooserFactory(net.parostroj.timetable.gui.actions.impl.FileChooserFactory) ScriptEngineManager(javax.script.ScriptEngineManager) GroovyShell(groovy.lang.GroovyShell)

Aggregations

FileChooserFactory (net.parostroj.timetable.gui.actions.impl.FileChooserFactory)2 GroovyShell (groovy.lang.GroovyShell)1 File (java.io.File)1 ScriptEngineManager (javax.script.ScriptEngineManager)1 CloseableFileChooser (net.parostroj.timetable.gui.actions.impl.CloseableFileChooser)1 OutputSettings (net.parostroj.timetable.gui.data.OutputSettings)1 LSFile (net.parostroj.timetable.model.ls.LSFile)1 Settings (net.parostroj.timetable.output2.OutputWriter.Settings)1