Package inra.ijpb.algo
Class DefaultAlgoListener
java.lang.Object
inra.ijpb.algo.DefaultAlgoListener
- All Implemented Interfaces:
AlgoListener
public class DefaultAlgoListener extends java.lang.Object implements AlgoListener
Utility class that catches algorithm events and displays them on ImageJ
main Frame.
Example of use:
// init image and process
ImageProcessor image = ...
Strel strel = SquareStrel.fromDiameter(15);
// Add monitoring of the process
DefaultAlgoListener.monitor(strel);
// run process. The IJ frame will display progress
strel.dilation(image);
- Author:
- David Legland
-
Constructor Summary
Constructors Constructor Description DefaultAlgoListener() -
Method Summary
Modifier and Type Method Description voidalgoProgressChanged(AlgoEvent evt)The method devoted to manage the change in the progression of the algorithm.voidalgoStatusChanged(AlgoEvent evt)The method devoted to manage the change in the status of the algorithm.static voidmonitor(Algo algo)Static method that creates a new instance of DefaultAlgoListener, and add it to the given algorithm.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
DefaultAlgoListener
public DefaultAlgoListener()
-
-
Method Details
-
monitor
Static method that creates a new instance of DefaultAlgoListener, and add it to the given algorithm.// read demo image String imageURL = "http://imagej.nih.gov/ij/images/NileBend.jpg"; ImageProcessor image = IJ.openImage(imageURL).getProcessor(); // init processor class Strel strel = SquareStrel.fromDiameter(15); // Add monitoring of the process DefaultAlgoListener.monitor(strel); // run process. The IJ frame will display progress strel.dilation(image);- Parameters:
algo- the algorithm to monitor
-
algoProgressChanged
Description copied from interface:AlgoListenerThe method devoted to manage the change in the progression of the algorithm.- Specified by:
algoProgressChangedin interfaceAlgoListener- Parameters:
evt- the AlgoEvent instance containing info about the algorithm.
-
algoStatusChanged
Description copied from interface:AlgoListenerThe method devoted to manage the change in the status of the algorithm.- Specified by:
algoStatusChangedin interfaceAlgoListener- Parameters:
evt- the AlgoEvent instance containing info about the algorithm.
-