|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectimagej.patcher.LegacyHooks
public abstract class LegacyHooks
Extension points for ImageJ 1.x.
These extension points will be patched into ImageJ 1.x by the
CodeHacker. To override the behavior of ImageJ 1.x, a new instance of
this interface needs to be installed into ij.IJ._hooks.
The essential functionality of the hooks is provided in the
EssentialLegacyHooks class, which makes an excellent base class for
project-specific implementations.
| Constructor Summary | |
|---|---|
LegacyHooks()
|
|
| Method Summary | |
|---|---|
boolean |
createInEditor(String fileName,
String content)
Extension point to override ImageJ 1.x' editor. |
void |
debug(String string)
Logs a debug message (to be shown only in debug mode). |
void |
dispose()
Disposes of the hooks. |
abstract void |
error(Throwable t)
Shows an exception. |
String |
getAppName()
Returns the name to use in place of "ImageJ". |
Object |
getContext()
Return the current context, if any. |
URL |
getIconURL()
Returns the icon to use in place of the ImageJ microscope. |
List<File> |
handleExtraPluginJars()
Extension point to add to ImageJ 1.x' PluginClassLoader's class path. |
abstract boolean |
handleNoSuchMethodError(NoSuchMethodError e)
Extension point to enhance ImageJ 1.x' error reporting upon NoSuchMethodError. |
abstract void |
initialized()
First extension point to run just after ImageJ 1.x spun up. |
void |
installed()
Runs when the hooks are installed into an existing legacy environment. |
Object |
interceptRunPlugIn(String className,
String arg)
Intercepts the call to IJ.runPlugIn(String, String). |
boolean |
isLegacyMode()
Determines whether the image windows should be displayed or not. |
void |
log(String message)
Logs a message. |
void |
newPluginClassLoader(ClassLoader loader)
Extension point to run after a new PluginClassLoader was initialized. |
boolean |
openInEditor(String path)
Extension point to override ImageJ 1.x' editor. |
boolean |
quit()
Disposes and prepares for quitting. |
void |
registerImage(Object image)
Registers an image (possibly not seen before). |
void |
runAfterRefreshMenus()
Extension point to run after Help>Refresh Menus |
void |
showProgress(double progress)
Updates the progress bar, where 0 <= progress <= 1.0. |
void |
showProgress(int currentIndex,
int finalIndex)
Updates the progress bar, where the length of the bar is set to ( currentValue + 1) / finalValue of the maximum bar length. |
void |
showStatus(String status)
Shows a status message. |
void |
unregisterImage(Object image)
Releases an image. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LegacyHooks()
| Method Detail |
|---|
public boolean isLegacyMode()
public Object getContext()
For ImageJ2-specific hooks, the returned object will be the current SciJava context, or null if the context is not yet initialized.
public boolean quit()
public void installed()
public void dispose()
This method is called when ImageJ 1.x is quitting or when new hooks are installed.
public Object interceptRunPlugIn(String className,
String arg)
IJ.runPlugIn(String, String).
className - the class namearg - the argument passed to the runPlugIn method
public void showProgress(double progress)
value - between 0.0 and 1.0
public void showProgress(int currentIndex,
int finalIndex)
currentValue + 1) / finalValue of the maximum bar length.
The bar is erased if currentValue >= finalValue.
currentIndex - the step that was just startedfinalIndex - the final step.public void showStatus(String status)
status - the messagepublic void log(String message)
message - the messagepublic void registerImage(Object image)
image - the new imagepublic void unregisterImage(Object image)
imagej - the imagepublic void debug(String string)
string - the debug messagepublic abstract void error(Throwable t)
t - the exceptionpublic String getAppName()
public URL getIconURL()
public boolean openInEditor(String path)
path - the path to the file to open
public boolean createInEditor(String fileName,
String content)
fileName - the name of the new filecontent - the initial content
public List<File> handleExtraPluginJars()
public void runAfterRefreshMenus()
public abstract boolean handleNoSuchMethodError(NoSuchMethodError e)
NoSuchMethodError.
e - the exception to handle
public void newPluginClassLoader(ClassLoader loader)
loader - the PluginClassLoader instancepublic abstract void initialized()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||