uk.ac.essex.ia.media.io
Class SaveImageOperator

java.lang.Object
  extended by uk.ac.essex.ia.media.OperatorImpl
      extended by uk.ac.essex.ia.media.io.SaveImageOperator
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, java.lang.Cloneable, Operator

public class SaveImageOperator
extends OperatorImpl

An operator to save an image to file. This wraps the JAI filestore operator. You should have received a copy of GNU public license with this code. If not please visit this site

See Also:
Serialized Form

Field Summary
static java.lang.String BMP
           
static java.lang.String GIF
           
static java.lang.String JPEG
           
static java.lang.String PNG
           
static java.lang.String PNM
           
static java.lang.String TIFF
           
 
Fields inherited from class uk.ac.essex.ia.media.OperatorImpl
iconURL, inputParameters, label, operatorDescriptor, operatorDialog, translator
 
Constructor Summary
SaveImageOperator()
           
SaveImageOperator(OperatorDescriptor operatorType)
           
 
Method Summary
 java.awt.image.RenderedImage execute(java.awt.image.renderable.ParameterBlock inData)
          Execute this operator with the input data passed as a parameter
 java.lang.String getExtension()
           
 java.lang.String getExtension(java.io.File f)
          Gets the extension of a file and converts it to a format for the image to be written TODO: Use enum
 java.io.File getFile()
           
 void setExtension(java.lang.String extension)
           
 void setFile(java.io.File file)
           
 void showOperatorDialog()
          In this function implmentations should handle displaying the OperatorImpl.operatorDialog via its show() method.
 
Methods inherited from class uk.ac.essex.ia.media.OperatorImpl
acceptsInputFrom, clone, getAllowedInputs, getAllowedOutputs, getHelpID, getIcon, getInputParameters, getInputParametersForWriting, getOperatorDialog, getOutputData, getRequiredInputs, getSingleSource, initSingleImageParameterBlock, readExternal, setInputParameters, setOperatorDialog, toString, writeExternal
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

JPEG

public static final java.lang.String JPEG
See Also:
Constant Field Values

GIF

public static final java.lang.String GIF
See Also:
Constant Field Values

TIFF

public static final java.lang.String TIFF
See Also:
Constant Field Values

PNG

public static final java.lang.String PNG
See Also:
Constant Field Values

PNM

public static final java.lang.String PNM
See Also:
Constant Field Values

BMP

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

SaveImageOperator

public SaveImageOperator()

SaveImageOperator

public SaveImageOperator(OperatorDescriptor operatorType)
Method Detail

getExtension

public java.lang.String getExtension()

setExtension

public void setExtension(java.lang.String extension)

getFile

public java.io.File getFile()

setFile

public void setFile(java.io.File file)

getExtension

public java.lang.String getExtension(java.io.File f)
Gets the extension of a file and converts it to a format for the image to be written TODO: Use enum

Parameters:
f -

showOperatorDialog

public void showOperatorDialog()
In this function implmentations should handle displaying the OperatorImpl.operatorDialog via its show() method. Also any input parameters should if instantiated be loaded into the dialog prior to it being displayed. These should then be dislpayed after it is complete. NB this is modal dialog so once the show method is called execution will block. After the call the parameters can be got via OperatorDialog.getParameter(java.lang.String).

Specified by:
showOperatorDialog in interface Operator
Overrides:
showOperatorDialog in class OperatorImpl

execute

public java.awt.image.RenderedImage execute(java.awt.image.renderable.ParameterBlock inData)
                                     throws java.lang.Exception
Execute this operator with the input data passed as a parameter

Specified by:
execute in interface Operator
Overrides:
execute in class OperatorImpl
Parameters:
inData - - The input data to this operator
Throws:
java.lang.Exception