|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmegamek.client.ui.swing.util.ImageFileFactory
public class ImageFileFactory
This class will produce Image objects from files. If an image
file is inside of JAR and ZIP file, then it must save the contents to a
temporary file.
| Method Summary | |
|---|---|
boolean |
accept(java.io.File dir,
java.lang.String name)
The method that must be implemented by any object that filters filenames (i.e., selects a subset of filenames from a list of filenames). |
boolean |
accept(java.util.zip.ZipFile zipFile,
java.lang.String name)
The method that must be implemented by any object that filters filenames within a ZipFile (i.e., selects a subset of filenames from
a list of filenames in a ZIP archive). |
static ImageFileFactory |
getInstance()
Get the Singleton ImageFileFactory. |
ItemFile |
getItemFile(java.io.File file)
Get the ItemFile for the given File. |
ItemFile |
getItemFile(java.util.zip.ZipEntry zipEntry,
java.util.zip.ZipFile zipFile)
Get the ItemFile for the given ZipEntry in
the ZipFile. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ImageFileFactory getInstance()
ImageFileFactory.
ImageFileFactory.
public ItemFile getItemFile(java.io.File file)
throws java.lang.IllegalArgumentException
ItemFile for the given File.
getItemFile in interface ItemFileFactoryfile - - the input File object that will be read to
produce the item. This value must not be null.
ItemFile for the given file.
IllegalArgumentException - if the file
is null.
java.lang.IllegalArgumentException
public ItemFile getItemFile(java.util.zip.ZipEntry zipEntry,
java.util.zip.ZipFile zipFile)
throws java.lang.IllegalArgumentException
ItemFile for the given ZipEntry in
the ZipFile.
getItemFile in interface ItemFileFactoryzipEntry - - the ZipEntry that will be read to
produce the item. This value must not be null.zipFile - - the ZipFile object that contains the
ZipEntry that will produce the item. This value
must not be null.
ItemFile for the given zip file entry.
IllegalArgumentException - if either the
zipEntry or the zipFile is
null.
java.lang.IllegalArgumentException
public boolean accept(java.io.File dir,
java.lang.String name)
java.io.FilenameFilter for
completeness.
accept in interface java.io.FilenameFilteraccept in interface ItemFileFactorydir - - the File object of the directory containing
the named file.name - - the String name of the file.
public boolean accept(java.util.zip.ZipFile zipFile,
java.lang.String name)
ZipFile (i.e., selects a subset of filenames from
a list of filenames in a ZIP archive).
accept in interface ItemFileFactoryzipFile - - the ZipFile object that contains the
named file's entry.name - - the String name of the file.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||