To implement a plugin for JPsychoMorph you need to create a Java class that overrides the Facemorph.Batchable interface: {{{ public interface Batchable { public boolean process(ImageZoomPanel izp, boolean single); public boolean initialise(PsychoMorphForm psychomorph); public void finish(); public String getName(); } }}} The main method is ''process'' which will be called for each image in the batch. The ''single'' parameter is true if the processing is '''not''' operating in batch mode, but on a single loaded image. The ImageZoomPanel allows access to the currently loaded Image and Template. The ''initialise'' method is called once before a batch of images, or before a single image is processed. It allows access to the rest of the system state via the PsychoMorphForm parameter. The ''finish'' method is called after all the images in the list have been processed, it is not called when operating on a single image. The ''getName'' method should return the name of the Batchable for inclusion in the ''Plugins'' menu on the psychomorph Transform window. Both Batch and single versions of the plugin will be added to the menu. The class must also have a no parameter (default) constructor for initialising. This is called both when the plugin is first loaded into the system and every time the (single or batch) menu item is clicked. == Examples == === Simple example === An example of a simple Batchable is given below. This Batchable checks that the inner lip points are correctly positioned vertically, and swaps corresponding points if needed. {{{ import Facemorph.Template; import Facemorph.psychomorph.Batchable; import Facemorph.psychomorph.ImageZoomPanel; import Facemorph.psychomorph.PsychoMorphForm; import java.awt.geom.Point2D; /** * Batch corrects the mouth in the "standard" template, by checking if the top -lip is below the bottom lip points and swapping if needed */ public class BatchCorrectMouth implements Batchable { public boolean process(ImageZoomPanel izp, boolean single) { Template tem = izp.getTemplate(); int[] topMouth = {94, 95, 96, 97, 98}, bottomMouth = {99, 100, 101, 102, 103}; for (int i=0; i