All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.imageprocessing.ImageProcessing

java.lang.Object
   |
   +----com.ibm.imageprocessing.ImageProcessing

public abstract class ImageProcessing
extends Object
implements Serializable
This class is a base class for all beans contained in the ImageProcessing suite of beans. This abstract class provides implementation for firing events like FetchArgumentsEvent, TriggerNextActionEvent, and PropertyChangeEvent, which are to be fired by these beans. This class provides methods for triggering processing an image(triggerAction). It should be subclassed to provide the concrete implementation. Initially an inputImage is null. So, FetchArgumentsEvent can be connected to the setInputImage method of a bean passing java.awt.Image as an argument. If FetchArgumentsEvent is used to set the input image set the autoAction flag to false to prevent infinite loop.

See Also:
FetchArgumentsEvent, FetchArgumentsListener, TriggerNextActionEvent, TriggerNextActionListener

Variable Index

 o processing
Flag to indicate whether processing is going on or not.

Constructor Index

 o ImageProcessing()

Method Index

 o addFetchArgumentsListener(FetchArgumentsListener)
Adds a FetchArgumentsListener to the listener list.
 o addPropertyChangeListener(PropertyChangeListener)
Adds a PropertyChangeListener to the listener list.
 o addTriggerNextActionListener(TriggerNextActionListener)
Adds a TriggerNextActionListener to the listener list.
 o evaluate()
Fires FetchArgumentsEvent and calls the startProcessing method.
 o getAutoAction()
Gets the autoAction flag.
 o getDebug()
Gets the debug flag.
 o removeFetchArgumentsListener(FetchArgumentsListener)
Removes a FetchArgumentsListener from the listener list.
 o removePropertyChangeListener(PropertyChangeListener)
Removes a PropertyChangeListener from the listener list.
 o removeTriggerNextActionListener(TriggerNextActionListener)
Removes a TriggerNextActionListener from the listener list.
 o setAutoAction(boolean)
Sets the autoAction flag.
 o setDebug(boolean)
Sets the debug flag.
 o startProcessing()
Abstract method for processing an image.
 o triggerAction()
Initiates the image filtering action.

Variables

 o processing
 protected boolean processing
Flag to indicate whether processing is going on or not. The default value is false.

Constructors

 o ImageProcessing
 public ImageProcessing()

Methods

 o triggerAction
 public void triggerAction()
Initiates the image filtering action. Calls the evaluate method. After that a TriggerNextActionEvent is fired irrespective of the return value from the startProcessing method.

 o setAutoAction
 public void setAutoAction(boolean autoAction)
Sets the autoAction flag. This is used to check whether to call the evaluate method whenever input or control properties of a bean are modified. If the flag is true, the evaluate method is called. The default value is true. The PropertyChangeEvent event is fired if old and new values are different.

Parameters:
autoAction - autoAction flag
 o getAutoAction
 public boolean getAutoAction()
Gets the autoAction flag.

Returns:
autoAction flag
 o setDebug
 public void setDebug(boolean debug)
Sets the debug flag. Flag to indicate whether IllegalArgumentException should be thrown if the input property is set to null( if null is an invalid input). If the flag is true and the input property is set to null, IllegalArgumentException is thrown else the null value is set as the input property. The default value is false. The PropertyChangeEvent event is fired if old and new values are different.

Parameters:
debug - The debug flag
 o getDebug
 public boolean getDebug()
Gets the debug flag.

Returns:
debug flag
 o addTriggerNextActionListener
 public synchronized void addTriggerNextActionListener(TriggerNextActionListener listener)
Adds a TriggerNextActionListener to the listener list.

Parameters:
listener - TriggerNextActionListener to be added
Throws: IllegalArgumentException
if the passed value is null
See Also:
TriggerNextActionListener, removeTriggerNextActionListener
 o removeTriggerNextActionListener
 public synchronized void removeTriggerNextActionListener(TriggerNextActionListener listener)
Removes a TriggerNextActionListener from the listener list.

Parameters:
listener - TriggerNextActionListener to be removed
Throws: IllegalArgumentException
if the passed value is null
See Also:
TriggerNextActionListener, addTriggerNextActionListener
 o addFetchArgumentsListener
 public synchronized void addFetchArgumentsListener(FetchArgumentsListener listener)
Adds a FetchArgumentsListener to the listener list.

Parameters:
listener - FetchArgumentsListener to be added
Throws: IllegalArgumentException
if the passed value is null
See Also:
FetchArgumentsListener, removeFetchArgumentsListener
 o removeFetchArgumentsListener
 public synchronized void removeFetchArgumentsListener(FetchArgumentsListener listener)
Removes a FetchArgumentsListener from the listener list.

Parameters:
listener - FetchArgumentsListener to be removed
Throws: IllegalArgumentException
if the passed value is null
See Also:
FetchArgumentsListener, addFetchArgumentsListener
 o addPropertyChangeListener
 public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list.

Parameters:
listener - PropertyChangeListener to be added
Throws: IllegalArgumentException
if the passed value is null
See Also:
PropertyChangeListener, removePropertyChangeListener
 o removePropertyChangeListener
 public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list.

Parameters:
listener - PropertyChangeListener to be removed
Throws: IllegalArgumentException
if the passed value is null
See Also:
PropertyChangeListener, addPropertyChangeListener
 o startProcessing
 protected abstract void startProcessing()
Abstract method for processing an image. Called by the triggerAction method and implementation is provided by the subclass. It should implement the processing algorithm and store the processed image and the old processed image . It then compares the new result with the old result. If they are different,the PropertyChangeEvent is fired.

 o evaluate
 protected void evaluate()
Fires FetchArgumentsEvent and calls the startProcessing method. This method causes FetchArgumentsEvent to be fired. This event is used for setting the input arguments(i.e. inputImage) of its subclass. After firing this event, it calls the startProcessing method (whose implementation is provided by its subclass).


All Packages  Class Hierarchy  This Package  Previous  Next  Index