becker.xtras.imageTransformation
Class SampleTransformations

java.lang.Object
  extended by becker.xtras.imageTransformation.SampleTransformations
All Implemented Interfaces:
ITransformations

public final class SampleTransformations
extends Object
implements ITransformations

A sample class implementing the ITransformations interface. It can apply a number of transformations to an image.

Please see the package description for a more in-depth discussion of using this class.

Author:
Michael DiBernardo, Byron Weber Becker

Constructor Summary
SampleTransformations()
           
 
Method Summary
 void addView(IView aView)
          Add a view (graphical user interface) to the image transformer.
 int[][] getPixels()
          Get the image that was transformed.
 String[] getTransformationNames()
          A array filled with the names of the transformations implemented by this class.
 void performTransformation(String transformationName)
          Perform the transformation indicated.
 void setPixels(int[][] newPix)
          Set the image to be transformed to a new set of pixels.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SampleTransformations

public SampleTransformations()
Method Detail

setPixels

public void setPixels(int[][] newPix)
Description copied from interface: ITransformations
Set the image to be transformed to a new set of pixels.

Specified by:
setPixels in interface ITransformations
Parameters:
newPix - The new image to be used for subsequent transformations.

getPixels

public int[][] getPixels()
Description copied from interface: ITransformations
Get the image that was transformed.

Specified by:
getPixels in interface ITransformations
Returns:
The pixels representing the image.

performTransformation

public void performTransformation(String transformationName)
Description copied from interface: ITransformations
Perform the transformation indicated.

Specified by:
performTransformation in interface ITransformations
Parameters:
transformationName - The name of the transformation to perform. Must be one of the transformation names returned by getTransformationNames.

getTransformationNames

public String[] getTransformationNames()
Description copied from interface: ITransformations
A array filled with the names of the transformations implemented by this class.

Specified by:
getTransformationNames in interface ITransformations
Returns:
The array of transformation names.

addView

public void addView(IView aView)
Description copied from interface: ITransformations
Add a view (graphical user interface) to the image transformer. The view's updateView method must be called each time the transformer's state changes.

Specified by:
addView in interface ITransformations