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

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

public class OpenImageOperator
extends OperatorImpl
implements ComponentActionProvider, OpenImageFileProvider

An Operator to open an Image from a file. It accepts zero inputs and theoretically any number of outputs. At the moment this is limited to 10. This is for efficiency reasons since any operator making use of this data will need to create a copy if they will make changes to the original.
Input data = none
Output data = RenderdImage
Allowable inputs = 0
Allowable outputs = 10
You should have received a copy of GNU public license with this code. If not please visit this site

See Also:
Operator, Serialized Form

Field Summary
 
Fields inherited from class uk.ac.essex.ia.media.OperatorImpl
iconURL, inputParameters, label, operatorDescriptor, operatorDialog, translator
 
Constructor Summary
OpenImageOperator()
           
OpenImageOperator(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.util.List<javax.swing.Action> getActions()
           
 java.io.File getFile()
           
protected  java.awt.image.RenderedImage openFile()
          Opens the image whose path is stored in file and returns the RenderedImage
 void setInputParameters(java.awt.image.renderable.ParameterBlock inputParameters)
          Overriden so the string file name stored in the parameter block is stored locally as a File object.
 void showOperatorDialog()
          Not only does this function show the GUI, it also creates the dialog and then disposes of it when done.
 
Methods inherited from class uk.ac.essex.ia.media.OperatorImpl
acceptsInputFrom, clone, getAllowedInputs, getAllowedOutputs, getHelpID, getIcon, getInputParameters, getInputParametersForWriting, getOperatorDialog, getOutputData, getRequiredInputs, getSingleSource, initSingleImageParameterBlock, readExternal, setOperatorDialog, toString, writeExternal
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OpenImageOperator

public OpenImageOperator()

OpenImageOperator

public OpenImageOperator(OperatorDescriptor operatorType)
Method Detail

showOperatorDialog

public void showOperatorDialog()
Not only does this function show the GUI, it also creates the dialog and then disposes of it when done. The reason for this is so when an operator is serialized we don't serialize unnecessary data (ie/ the dialog)

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

setInputParameters

public void setInputParameters(java.awt.image.renderable.ParameterBlock inputParameters)
Overriden so the string file name stored in the parameter block is stored locally as a File object.

Specified by:
setInputParameters in interface Operator
Overrides:
setInputParameters in class OperatorImpl
Parameters:
inputParameters -

getActions

public java.util.List<javax.swing.Action> getActions()
Specified by:
getActions in interface ComponentActionProvider

getFile

public java.io.File getFile()
Specified by:
getFile in interface OpenImageFileProvider

openFile

protected java.awt.image.RenderedImage openFile()
                                         throws ImageIOException
Opens the image whose path is stored in file and returns the RenderedImage

Throws:
ImageIOException - When the image called file cannot be opened