quoggles.auxiliary
Class FileUtil

java.lang.Object
  |
  +--quoggles.auxiliary.FileUtil

public class FileUtil
extends java.lang.Object

Auxiliary class holding public ststic methods concerning the use of files.


Constructor Summary
FileUtil()
           
 
Method Summary
private static boolean convertAttribute(org.graffiti.attributes.Attribute attr, org.graffiti.graph.Node node, javax.xml.parsers.DocumentBuilder docBuilder, boolean useGraphic)
          Interpret XML attribute values and create BoxAttributes.
static org.graffiti.graph.Graph getQueryFromFile(java.io.File loadFile)
          Calls getQueryFromFile(true).
static org.graffiti.graph.Graph getQueryFromFile(java.io.File loadFile, boolean useGraphic)
          The given file should contain a graph in GML format with the nodes having attributes that specify boxes (in XML).
static org.graffiti.util.Pair getQueryFromSomeFile()
          Calls getQueryFromSomeFile(true).
static org.graffiti.util.Pair getQueryFromSomeFile(boolean useGraphic)
          Displays a file chooser dialog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtil

public FileUtil()
Method Detail

getQueryFromSomeFile

public static final org.graffiti.util.Pair getQueryFromSomeFile()
                                                         throws java.io.FileNotFoundException,
                                                                LoadFailedException
Calls getQueryFromSomeFile(true).

java.io.FileNotFoundException
LoadFailedException
See Also:
getQueryFromSomeFile(boolean)

getQueryFromSomeFile

public static final org.graffiti.util.Pair getQueryFromSomeFile(boolean useGraphic)
                                                         throws java.io.FileNotFoundException,
                                                                LoadFailedException
Displays a file chooser dialog. The file should contain a graph in GML format with the nodes having attributes that specify boxes (in XML).

If no exception is thrown, a Pair is returned consisting of the loaded graph and the file from which the graph was loaded.

Parameters:
useGraphic - decides whether any manipulations / loadings of graphical representations should be done
Returns:
Pair (Graph / File)
Throws:
java.io.FileNotFoundException - thrown if the file chosen could not be found
LoadFailedException - thrown if anything went wrong during the loading process

getQueryFromFile

public static final org.graffiti.graph.Graph getQueryFromFile(java.io.File loadFile)
                                                       throws java.io.FileNotFoundException,
                                                              LoadFailedException
Calls getQueryFromFile(true).

java.io.FileNotFoundException
LoadFailedException
See Also:
getQueryFromFile(boolean)

getQueryFromFile

public static final org.graffiti.graph.Graph getQueryFromFile(java.io.File loadFile,
                                                              boolean useGraphic)
                                                       throws java.io.FileNotFoundException,
                                                              LoadFailedException
The given file should contain a graph in GML format with the nodes having attributes that specify boxes (in XML).

If no exception is thrown, the loaded graph is returned.

Parameters:
useGraphic - decides whether any manipulations / loadings of graphical representations should be done
Returns:
Pair (Graph / File)
Throws:
java.io.FileNotFoundException - thrown if the file chosen could not be found
LoadFailedException - thrown if anything went wrong during the loading process

convertAttribute

private static boolean convertAttribute(org.graffiti.attributes.Attribute attr,
                                        org.graffiti.graph.Node node,
                                        javax.xml.parsers.DocumentBuilder docBuilder,
                                        boolean useGraphic)
                                 throws BoxCreationFailedException,
                                        org.graffiti.util.InstanceCreationException
Interpret XML attribute values and create BoxAttributes.

Parameters:
attr -
node -
docBuilder -
useGraphic - decides whether any manipulations / loadings of graphical representations should be done
BoxCreationFailedException
org.graffiti.util.InstanceCreationException