public static void exportTaskgraph() {
        final TFileChooser fc = new TFileChooser(EXPORT_TASKGRAPH_DIR);
        final FileImportExportDecorator chooser = new FileImportExportDecorator(fc);
        int result = chooser.showExportDialog(GUIEnv.getApplicationFrame());
        if (result == TFileChooser.APPROVE_OPTION) {
            Thread thread = new Thread() {
                public void run() {
                    TrianaProgressBar pb = null;
                    String filename = "";
                    try {
                        // Bug fix for not picking up file name text.
                        if (fc.getUI() instanceof BasicFileChooserUI) {
                            filename = ((BasicFileChooserUI) fc.getUI()).getFileName();
                        }
                        pb = new TrianaProgressBar("exporting: " + filename, false);
                        chooser.exportWorkflow(GUIEnv.getApplicationFrame().getSelectedTaskGraphPanel().getTaskGraph());
                    } catch (IOException e) {
                        ErrorDialog.show("Error Exporting TaskGraph", e.getMessage());
                        e.printStackTrace();
                    } catch (TaskGraphException e) {
                        ErrorDialog.show("Error Exporting TaskGraph", e.getMessage());
                        e.printStackTrace();
                    } finally {
                        if (pb != null) {
                            pb.disposeProgressBar();
                        }
                    }
                }
            };
            thread.setName("Export Task Graph");
            thread.setPriority(Thread.NORM_PRIORITY);
            thread.start();
        }
    }
public static void exportTaskgraph() {
        final TFileChooser fc = new TFileChooser(EXPORT_TASKGRAPH_DIR);
        final FileImportExportDecorator chooser = new FileImportExportDecorator(fc);
        int result = chooser.showExportDialog(GUIEnv.getApplicationFrame());
        if (result == TFileChooser.APPROVE_OPTION) {
            Thread thread = new Thread() {
                public void run() {
                    TrianaProgressBar pb = null;
                    String filename = "";
                    try {
                       
                        if (fc.getUI() instanceof BasicFileChooserUI) {
                            filename = ((BasicFileChooserUI) fc.getUI()).getFileName();
                        }
                        pb = new TrianaProgressBar("exporting: " + filename, false);
                        chooser.exportWorkflow(GUIEnv.getApplicationFrame().getSelectedTaskGraphPanel().getTaskGraph());
                    } catch (IOException e) {
                        ErrorDialog.show("Error Exporting TaskGraph", e.getMessage());
                        e.printStackTrace();
                    } catch (TaskGraphException e) {
                        ErrorDialog.show("Error Exporting TaskGraph", e.getMessage());
                        e.printStackTrace();
                    } finally {
                        if (pb != null) {
                            pb.disposeProgressBar();
                        }
                    }
                }
            };
            thread.setName("Export Task Graph");
            thread.setPriority(Thread.NORM_PRIORITY);
            thread.start();
        }
    }
public static void exporttaskgraph() { final tfilechooser fc = new tfilechooser(export_taskgraph_dir); final fileimportexportdecorator chooser = new fileimportexportdecorator(fc); int result = chooser.showexportdialog(guienv.getapplicationframe()); if (result == tfilechooser.approve_option) { thread thread = new thread() { public void run() { trianaprogressbar pb = null; string filename = ""; try { if (fc.getui() instanceof basicfilechooserui) { filename = ((basicfilechooserui) fc.getui()).getfilename(); } pb = new trianaprogressbar("exporting: " + filename, false); chooser.exportworkflow(guienv.getapplicationframe().getselectedtaskgraphpanel().gettaskgraph()); } catch (ioexception e) { errordialog.show("error exporting taskgraph", e.getmessage()); e.printstacktrace(); } catch (taskgraphexception e) { errordialog.show("error exporting taskgraph", e.getmessage()); e.printstacktrace(); } finally { if (pb != null) { pb.disposeprogressbar(); } } } }; thread.setname("export task graph"); thread.setpriority(thread.norm_priority); thread.start(); } }