Class TGFileIO

java.lang.Object
  extended by TGFileIO

public class TGFileIO
extends java.lang.Object

Utility methods for getting stuff from files on the local computer.


Field Summary
static java.lang.String CLASS_NAME
           
 
Constructor Summary
TGFileIO()
           
 
Method Summary
static java.lang.String getCurrentDirectory()
          Return the current working directory.
static java.awt.Image getImage(java.lang.String fileName)
          Given a file name, read the picture file in and convert the contents into an Image.
static PixelRectangle getPixRect(java.lang.String fileName)
          Given a file name (of a picture file), read it in and convert its contents into a PixelRectangle.
static java.lang.String[] getText(java.lang.String fileName)
          Read the specified text file into an array of Strings, one for each line of text.
static boolean isAbsolutePath(java.lang.String path)
          Determine if a path is absolute (starts with a component that is a root of a file system).
static java.lang.String[] pictFiles()
          Return a String array of file names, each the name of a .bmp, .gif, .jpg, or .png picture file that is available for loading.
static void setCurrentDirectory(java.lang.String path)
          Set the current directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_NAME

public static final java.lang.String CLASS_NAME
See Also:
Constant Field Values
Constructor Detail

TGFileIO

public TGFileIO()
Method Detail

getCurrentDirectory

public static java.lang.String getCurrentDirectory()
Return the current working directory.


getImage

public static java.awt.Image getImage(java.lang.String fileName)
Given a file name, read the picture file in and convert the contents into an Image.


getPixRect

public static PixelRectangle getPixRect(java.lang.String fileName)
Given a file name (of a picture file), read it in and convert its contents into a PixelRectangle.


getText

public static java.lang.String[] getText(java.lang.String fileName)
Read the specified text file into an array of Strings, one for each line of text. Return null if the file can't be opened.


isAbsolutePath

public static boolean isAbsolutePath(java.lang.String path)
Determine if a path is absolute (starts with a component that is a root of a file system). Return true if the path is absolute. If the path is a relative path false is returned.


pictFiles

public static java.lang.String[] pictFiles()
Return a String array of file names, each the name of a .bmp, .gif, .jpg, or .png picture file that is available for loading.


setCurrentDirectory

public static void setCurrentDirectory(java.lang.String path)
Set the current directory.