anvil.gui
Interface AnvilPlugIn


public interface AnvilPlugIn

Defines interface to plug-in modules. Anvil creates one instance of the plug-in class at start up time. The plug-in will appear under "Tool" in the main menu bar. When selected by the user, Anvil will call the method "startFromMain" and, depending on the value of "canHaveMultipleInstances", Anvil will deactivate the plug-in menu entry or not. If your plug-in wants to be time synchronized with Anvil's current video, you need to call addAnvilMediaTimeListener in AnvilMain. When your plug-in is closed by the user, you need to inform AnvilMain with plugInExited. See the AnvilMain interface for more information on possible interaction with Anvil.


Method Summary
 boolean canHaveMultipleInstances()
          Returns true if the plug-in can be called multiple times.
 boolean exitFromAnvil()
          Called by AnvilMain when Anvil is being closed.
 boolean startFromAnvil(anvil.gui.AnvilMain main)
          Called by AnvilMain when the plug-in button is used, i.e. when the user wants to start the plug-in.
 

Method Detail

canHaveMultipleInstances

public boolean canHaveMultipleInstances()
Returns true if the plug-in can be called multiple times. If false, Anvil will deactivate the plug-in button after the first call and re-activate it only when the plug-in is closed. The return value of this method should not change during runtime.

Returns:
whether plug-in can be called and instanciated multiple times.

startFromAnvil

public boolean startFromAnvil(anvil.gui.AnvilMain main)
Called by AnvilMain when the plug-in button is used, i.e. when the user wants to start the plug-in.

Parameters:
main - the AnvilMain object.
Returns:
whether plug-in was successfully started.

exitFromAnvil

public boolean exitFromAnvil()
Called by AnvilMain when Anvil is being closed. Usually, the plug-in also closes (no need to notify AnvilMain with plugInExited in such a case). Before, you may want to ask the user if s/he wants to save information. You may even suppress Anvil's exiting (user pressing "cancel", e.g.).

Returns:
whether it is OK to exit; if false, Anvil will NOT exit.
See Also:
AnvilMain.plugInExited(anvil.gui.AnvilPlugIn)