org.virion.jam.app
Class Utils

java.lang.Object
  extended by org.virion.jam.app.Utils

public class Utils
extends Object

Author:
Alexei Drummond, Andrew Rambaut

Constructor Summary
Utils()
           
 
Method Summary
static Image getImage(Object caller, String name)
           
static File getLoadFile(String message)
           
static String getLoadFileName(String message)
           
static File getSaveFile(String message)
           
static String getSaveFileName(String message)
           
static String trimExtensions(String fileName, String[] extensions)
          This function takes a file name and an array of extensions (specified without the leading '.').
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

getLoadFileName

public static String getLoadFileName(String message)

getSaveFileName

public static String getSaveFileName(String message)

getLoadFile

public static File getLoadFile(String message)

getSaveFile

public static File getSaveFile(String message)

trimExtensions

public static String trimExtensions(String fileName,
                                    String[] extensions)
This function takes a file name and an array of extensions (specified without the leading '.'). If the file name ends with one of the extensions then it is returned with this trimmed off. Otherwise the file name is return as it is.

Returns:
the trimmed filename

getImage

public static Image getImage(Object caller,
                             String name)
Returns:
a named image from file or resource bundle.