public class FileImportExportDecorator
extends java.lang.Object
implements java.awt.event.ActionListener
Constructor and Description |
---|
FileImportExportDecorator(javax.swing.JFileChooser filechooser) |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Invoked when an action occurs.
|
void |
exportWorkflow(TaskGraph taskgraph)
Converts the taskgraph to the appropriate format and writes it to the user choosen file.
|
java.lang.String |
getDefaultToolPackage() |
Tool[] |
importTools(java.lang.String pack)
Translates and returns the an array of
Tool objects from the file choosen by the user. |
TaskGraph |
importWorkflow()
Translates and returns the
TaskGraph from the file choosen by the user. |
int |
showExportDialog(java.awt.Component parent)
Pops up a "Export Taskgraph" file chooser dialog.
|
int |
showImportDialog(java.awt.Component parent)
Pops up a "Import Taskgraph" file chooser dialog.
|
int |
showImportToolDialog(java.awt.Component parent)
Pops up a "Import Tool" file chooser dialog.
|
public FileImportExportDecorator(javax.swing.JFileChooser filechooser)
public int showImportDialog(java.awt.Component parent)
parent
- the parent component of the dialog, can be null
; see showDialog
for
detailsjava.awt.HeadlessException
- if GraphicsEnvironment.isHeadless() returns true.GraphicsEnvironment.isHeadless()
public int showImportToolDialog(java.awt.Component parent)
parent
- the parent component of the dialog, can be null
; see showDialog
for
detailsjava.awt.HeadlessException
- if GraphicsEnvironment.isHeadless() returns true.GraphicsEnvironment.isHeadless()
public int showExportDialog(java.awt.Component parent)
parent
- the parent component of the dialog, can be null
; see showDialog
for
detailsjava.awt.HeadlessException
- if GraphicsEnvironment.isHeadless() returns true.GraphicsEnvironment.isHeadless()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public TaskGraph importWorkflow() throws TaskGraphException, java.io.IOException
TaskGraph
from the file choosen by the user.java.io.IOException
- thrown if there is a file IO problem.TaskGraphException
public void exportWorkflow(TaskGraph taskgraph) throws java.io.IOException, TaskGraphException
taskgraph
- the taskgraph to exportjava.io.IOException
- thrown if there is an IO problem writing the file.TaskGraphException
public java.lang.String getDefaultToolPackage()
public Tool[] importTools(java.lang.String pack) throws TaskGraphException, java.io.IOException
Tool
objects from the file choosen by the user.pack
- the suggested package for imported toolspack
- java.io.IOException
- thrown if there is a file IO problem.TaskGraphException