public abstract class ImageListener extends Object implements FileListener, Runnable
Constructor and Description |
---|
ImageListener() |
Modifier and Type | Method and Description |
---|---|
void |
dropImage(File file) |
void |
dropImage(String path)
Remove the ImagePlus at the given path from the HashTable mapping them together.
|
protected boolean |
fileIsReady(File imageFile)
Checks whether an image file is ready, in the sense that it has been completely written to
disk.
|
ij.ImagePlus |
getImageFromPath(File file) |
ij.ImagePlus |
getImageFromPath(String path)
Returns an ImagePlus given a path String.
|
void |
handle(FolderWatcher fw)
Handles a new file event passed by a FolderWatcher.
|
static FolderWatcher |
imageFolderWatcher(String folderName,
int interval,
ImageListener imageListener,
String regexp)
Create a FolderWatcher to watch the given folder
|
boolean |
isEnabled() |
protected abstract void |
processImage(File imageFile)
An inheriting class should implement a method that processes each image file as it is
popped from the queue.
|
void |
run() |
void |
setEnabled(boolean go) |
void |
stop()
Causes this ImageListener to quit
|
public static FolderWatcher imageFolderWatcher(String folderName, int interval, ImageListener imageListener, String regexp)
folderName
- the folder to watchinterval
- the poll intervalimageListener
- the ImageListener to useregexp
- the regular expression used to match image files.public void handle(FolderWatcher fw)
handle
in interface FileListener
fw
- the FolderWatcher calling this methodpublic void setEnabled(boolean go)
public boolean isEnabled()
public void stop()
stop
in interface FileListener
public ij.ImagePlus getImageFromPath(File file)
public void dropImage(File file)
public void dropImage(String path)
path
- the path keying the given ImagePluspublic ij.ImagePlus getImageFromPath(String path)
path
- the path of the given ImagePlusprotected boolean fileIsReady(File imageFile)
imageFile
- the File representing the image file to test.protected abstract void processImage(File imageFile)
imageFile
- the image File to processCopyright © 2015–2021 Fiji. All rights reserved.