|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.expasy.minitools.util.FileUtils
public class FileUtils
Title: FileUtils
Description:
Copyright: Copyright (c) 2003
Company: SIB
Date: 24 avr. 2003
Time: 13:53:32
Field Summary | |
---|---|
static java.lang.String |
ALDENTE_PROJECT_EXTENSION
Extension for aldente project files (*.prj) |
Method Summary | |
---|---|
static void |
addConstraints(java.awt.GridBagConstraints c,
int gridx,
int gridy,
int gridwidth,
int gridheight,
double weightx,
double weighty,
int ipadx,
int ipady,
int fill,
int anchor)
Add contraints to the display of an element in a panel using GridBagLayout. |
static java.io.InputStream |
findFileAsStream(java.lang.String name)
Similar to the findImage method, but dedicated to files. |
static javax.swing.ImageIcon |
findImage(java.lang.String name)
Finds an image using different methods to retrieve its location: first java.net.URL url = UIManager.class.getResource("../.. |
static java.net.URL |
findImagePath(java.lang.String name)
Similar to the findImage method, but dedicated to files. |
static java.lang.String |
getExtension(java.io.File f)
Get the extension of a file. |
static boolean |
isInJar()
Test is the executed application has been zipped in a jar. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ALDENTE_PROJECT_EXTENSION
Method Detail |
---|
public static javax.swing.ImageIcon findImage(java.lang.String name)
java.net.URL url = UIManager.class.getResource("../../images/name.gif");
then
java.net.URL url = ClassLoader.getSystemClassLoader().getResource("images/name.gif");
name
- The name of the image.
public static java.net.URL findImagePath(java.lang.String name)
findImage
method, but dedicated to files.
This method is not effective when trying to retrieve files in jar archives,
as they do not exist any more as "files". In that case, use findFileAsStream instead.
Have to replace '%20' in the url by space characters.
name
- Name of the file to find.
public static java.io.InputStream findFileAsStream(java.lang.String name)
findImage
method, but dedicated to files.
This method is effective when trying to retrieve files between system files AND
in jar archives.
name
- Name of the file to find.
public static boolean isInJar()
public static java.lang.String getExtension(java.io.File f)
public static void addConstraints(java.awt.GridBagConstraints c, int gridx, int gridy, int gridwidth, int gridheight, double weightx, double weighty, int ipadx, int ipady, int fill, int anchor)
c
- The constraints object containing all the informations to use.gridx
- Location on the x-axis (up-left hand corner of the element).gridy
- Location on the y-axis (up-left hand corner of the element).gridwidth
- gridheight
- weightx
- weighty
- ipadx
- ipady
- fill
- anchor
- Place of the element in the case of grid (east, west, north, south, center)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |