Cytoscape 3.0.1 API

org.cytoscape.util.swing
Interface FileUtil


public interface FileUtil

Provides a platform-dependent way to open files. Mainly because Mac would prefer that you use java.awt.FileDialog instead of the Swing FileChooser.


Cytoscape Backwards Compatibility (API Interface): We expect that this interface will be used but not implemented by developers using this interface. As such, we reserve the right to add methods to the interface as part of minor version upgrades. We will not remove methods for any changes other than major version upgrades.

Field Summary
static int CUSTOM
          Equal to FileDialog.LOAD + FileDialog.SAVE.
static String LAST_DIRECTORY
          The Cytoscape property that stores the last save/load directory.
static int LOAD
          Equal to FileDialog.LOAD.
static int SAVE
          Equal to FileDialog.SAVE.
static String urlPattern
          A string that defines a simplified java regular expression for a URL.
 
Method Summary
 File getFile(Component parent, String title, int loadSaveCustom, Collection<FileChooserFilter> filters)
          Returns a File object, this method should be used instead of rolling your own JFileChooser.
 File getFile(Component parent, String title, int loadSaveCustom, String startDir, String customApproveText, Collection<FileChooserFilter> filters)
          Returns a File object, this method should be used instead of rolling your own JFileChooser.
 File[] getFiles(Component parent, String title, int loadSaveCustom, Collection<FileChooserFilter> filters)
          Returns an array of File objects, this method should be used instead of rolling your own JFileChooser.
 File[] getFiles(Component parent, String title, int loadSaveCustom, String startDir, String customApproveText, boolean multiselect, Collection<FileChooserFilter> filters)
          Returns a list of File objects, this method should be used instead of rolling your own JFileChooser.
 File[] getFiles(Component parent, String title, int loadSaveCustom, String startDir, String customApproveText, Collection<FileChooserFilter> filters)
          Returns a list of File objects, this method should be used instead of rolling your own JFileChooser.
 

Field Detail

LAST_DIRECTORY

static final String LAST_DIRECTORY
The Cytoscape property that stores the last save/load directory.

See Also:
Constant Field Values

LOAD

static final int LOAD
Equal to FileDialog.LOAD.

See Also:
Constant Field Values

SAVE

static final int SAVE
Equal to FileDialog.SAVE.

See Also:
Constant Field Values

CUSTOM

static final int CUSTOM
Equal to FileDialog.LOAD + FileDialog.SAVE.

See Also:
Constant Field Values

urlPattern

static final String urlPattern
A string that defines a simplified java regular expression for a URL. This may need to be updated to be more precise.

See Also:
Constant Field Values
Method Detail

getFile

File getFile(Component parent,
             String title,
             int loadSaveCustom,
             Collection<FileChooserFilter> filters)
Returns a File object, this method should be used instead of rolling your own JFileChooser.

Parameters:
parent - the parent of the JFileChooser or FileDialog
title - the title of the dialog box
loadSaveCustom - a flag for the type of file dialog
filters - a non-empty collection of file filters
Returns:
the location of the selected file

getFile

File getFile(Component parent,
             String title,
             int loadSaveCustom,
             String startDir,
             String customApproveText,
             Collection<FileChooserFilter> filters)
Returns a File object, this method should be used instead of rolling your own JFileChooser.

Parameters:
parent - the parent of the JFileChooser or FileDialog
title - the title of the dialog box
loadSaveCustom - a flag for the type of file dialog
startDir - an alternate start dir, if null the default Cytoscape MUD will be used
customApproveText - if this is a custom dialog, then custom text should be on the approve button.
filters - a non-empty collection of file filters
Returns:
the location of the selected file

getFiles

File[] getFiles(Component parent,
                String title,
                int loadSaveCustom,
                Collection<FileChooserFilter> filters)
Returns an array of File objects, this method should be used instead of rolling your own JFileChooser.

Parameters:
parent - the parent of the JFileChooser or FileDialog
title - the title of the dialog box
loadSaveCustom - a flag for the type of file dialog
filters - a non-empty collection of file filters
Returns:
the location of the selected file

getFiles

File[] getFiles(Component parent,
                String title,
                int loadSaveCustom,
                String startDir,
                String customApproveText,
                Collection<FileChooserFilter> filters)
Returns a list of File objects, this method should be used instead of rolling your own JFileChooser.

Parameters:
parent - the parent of the JFileChooser or FileDialog
title - the title of the dialog box
loadSaveCustom - a flag for the type of file dialog
startDir - an alternate start dir, if null the default Cytoscape MUD will be used
customApproveText - if this is a custom dialog, then custom text should be on the approve button.
filters - a non-empty collection of file filters
Returns:
and array of selected files, or null if none are selected

getFiles

File[] getFiles(Component parent,
                String title,
                int loadSaveCustom,
                String startDir,
                String customApproveText,
                boolean multiselect,
                Collection<FileChooserFilter> filters)
Returns a list of File objects, this method should be used instead of rolling your own JFileChooser.

Parameters:
parent - the parent of the JFileChooser or FileDialog
title - the title of the dialog box
loadSaveCustom - a flag for the type of file dialog
startDir - an alternate start dir, if null the default cytoscape MUD will be used
customApproveText - if this is a custom dialog, then custom text should be on the approve button.
multiselect - Enable selection of multiple files (Macs are still limited to a single file because we use FileDialog there -- is this fixed in Java 1.5?)
filters - a non-empty collection of file filters
Returns:
and array of selected files, or null if none are selected

Cytoscape 3.0.1 API

Copyright 2011 Cytoscape Consortium. All rights reserved.