visad.data.jai
Class JAIForm
- java.lang.Object
-
- visad.data.FormNode
-
- visad.data.Form
-
- visad.data.jai.JAIForm
-
- All Implemented Interfaces:
- FormFileInformer
public class JAIForm extends Form implements FormFileInformer
JAIForm is the VisAD data form for image formats supported by the Java Advanced Imaging API: BMP, GIF, FlashPix, JPEG, PNG, PNM, and TIFF.
-
-
Constructor Summary
Constructors Constructor and Description JAIForm()Constructs a new JAI file form.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidadd(java.lang.String id, Data data, boolean replace)Adds data to an existing JAI image file.java.lang.String[]getDefaultSuffixes()Returns the default file suffixes for the JAI image file formats.FormNodegetForms(Data data)Return the data forms that are compatible with a data object.booleanisThisType(byte[] block)Checks if the given block is a valid header for a JAI image file.booleanisThisType(java.lang.String name)Checks if the given string is a valid filename for a JAI image file.static voidmain(java.lang.String[] args)Run 'java visad.data.visad.JAIForm in_file' to test read an image file supported by Java Advanced Imaging.DataImplopen(java.lang.String id)Opens an existing JAI image file from the given location.DataImplopen(java.net.URL url)Opens an existing JAI image file from the given URL.voidsave(java.lang.String id, Data data, boolean replace)Saves a VisAD Data object to a JAI image format at the given location.-
Methods inherited from class visad.data.Form
getMathType
-
-
-
-
Method Detail
-
isThisType
public boolean isThisType(java.lang.String name)
Checks if the given string is a valid filename for a JAI image file.- Specified by:
isThisTypein interfaceFormFileInformer- Parameters:
name- name of the file- Returns:
- true if the name is right for this type of form
-
isThisType
public boolean isThisType(byte[] block)
Checks if the given block is a valid header for a JAI image file.- Specified by:
isThisTypein interfaceFormFileInformer- Parameters:
block- block of bytes from file- Returns:
- true if the magic number is right
-
getDefaultSuffixes
public java.lang.String[] getDefaultSuffixes()
Returns the default file suffixes for the JAI image file formats.- Specified by:
getDefaultSuffixesin interfaceFormFileInformer- Returns:
- array of suffixes
-
save
public void save(java.lang.String id, Data data, boolean replace) throws BadFormException, java.io.IOException, java.rmi.RemoteException, VisADExceptionSaves a VisAD Data object to a JAI image format at the given location.- Specified by:
savein classFormNode- Throws:
BadFormException- Always thrown (method is not implemented).java.io.IOExceptionjava.rmi.RemoteExceptionVisADException
-
add
public void add(java.lang.String id, Data data, boolean replace) throws BadFormExceptionAdds data to an existing JAI image file.- Specified by:
addin classFormNode- Throws:
BadFormException- Always thrown (method is not implemented).
-
open
public DataImpl open(java.lang.String id) throws BadFormException, java.io.IOException, VisADException
Opens an existing JAI image file from the given location.- Specified by:
openin classFormNode- Returns:
- VisAD Data object containing JAI image data.
- Throws:
BadFormExceptionjava.io.IOExceptionVisADException
-
open
public DataImpl open(java.net.URL url) throws BadFormException, java.io.IOException, VisADException
Opens an existing JAI image file from the given URL.- Specified by:
openin classFormNode- Returns:
- VisAD Data object containing JAI image data.
- Throws:
BadFormExceptionjava.io.IOExceptionVisADException
-
getForms
public FormNode getForms(Data data)
Description copied from class:FormNodeReturn the data forms that are compatible with a data object.
-
main
public static void main(java.lang.String[] args) throws VisADException, java.rmi.RemoteException, java.io.IOExceptionRun 'java visad.data.visad.JAIForm in_file' to test read an image file supported by Java Advanced Imaging.- Throws:
VisADExceptionjava.rmi.RemoteExceptionjava.io.IOException
-
-
DMelt 3.0 © DataMelt by jWork.ORG