Action Bar
Jerome Mutterer (email)
This plugin extends ImageJ's graphical user interface. It's purpose is to provide one or many easy to use button bar(s). This type of bars is called 'ActionBar'. It will be a good place to install frequently used items like macros, built-in commands, or user plugins. It can turn a series of plugins into a good looking user interface (see examples).
Each button can have a name, an icon, and can do one of three actions type:
Of course with the macro language you can run other macros, user or builtin plugins, javascripts, etc.
Each line of buttons should be included between line tags like this:
<line> // add buttons here </line>
All buttons are simply described in a basic configuration file. You can edit this file manually with ImageJ's built-in text editor. Simply add new buttons there with 5 descriptors for each button :
| <button> | Declares a new button in your ActionBar. |
| label | The button's name, display in a tooltip. |
| icon | The button's icon file which should be in the 'icons' folder. |
| bgcolor | The button's background color 1-8 preset colors or RGB value in the form of #RRGGBB |
| arg | Is the argument to the button's action |
Choose “Action Bar” alone from the plugins menu, and you'll be invited to create your first Action Bar. After that, you can edit the config file to do real things.
You can customize the default ActionBarConf.txt as you like, but you can also have more than one Action Bar (an idea by Gabriel Landini). To achieve that, simply call Action Bar with the reference to the configuration file of your choice. Here are two ways of doing this:
run("Action Bar", "/plugins/Morphology/ActionBarMorphoset.txt");
see also the example macro provided that starts 3 ActionBars.
run("Install Plugin...", "plugin=Action_Bar menu=Plugins command=sampleActionBar
shortcut=F1 argument=/plugins/ActionBar/sampleActionBar.txt");
Include an AutoRun macro in StartupMacros.txt:
macro "AutoRun" {
run("Action Bar", "/plugins/Morphology/ActionBarMorphoset.txt");
}
Tip : One Action Bar can start others…
Defining your Action Bar 'sticky' with the <sticky> property, will allow you to always have your favorite functions next to the active image window. The following screenshot shows you what it looks like :
Follow this link for a screencast. Available soon.
First download ActionBar.zip from the bottom of this page and unzip it in an ActionBar folder inside the plugins folder. Restart ImageJ.
ImageJ/plugins/ActionBar/ main ActionBar folder ImageJ/plugins/ActionBar/icons/ ..icons folder ImageJ/plugins/ActionBar/Action Bar.class main class ImageJ/plugins/ActionBar/Action Bar.java main class source code ...
Rainer M. Engel wrote a macro that can be used to update an ActionBar in a comfortable way. Another macro makes it easy to add/remove rows/columns or for example switch button positions.
No licence associated. Citing Action Bar will be apreciated.
Contact Jerome if you find any bugs or if you'd like to see a feature appear in a new release.
March 2013 version action_bar201a.jar
The jar file should contain:
* the action bar config file
* a plugins.config file referencing the config file like this:
Plugins>Test, "Test AB with icons in jar", Action_Bar("jar:file:test_bar.jar!/test.txt")
* an icons/ folder with the icons.
<beanshell> <line> <button> label=A arg=<bsh> i=34; </bsh> <button> label=B arg=<bsh> i=i*2; print (i); </bsh> </line>
May 2012 version actionbar20120524.zip
November 2011 version actionbar20111107.zip
→ either use one of 8 preset colors
<button> label=test1 bgcolor=1 ...
→ or specify RGB color code
<button> label=test2 bgcolor=#ff4480 ...
March 2011 version
run("Action Bar","/plugins/ActionBar/1_pixel.ijm");
exit();
<line>
<button>
label=1-pixel
...
...
<DnDAction>
file=getArgument();
open(file);
run("8-bit");
</DnDAction>
...
...
<sticky>
<line>
<button> <enabled>if (bitDepth==8) return '1';
label=info
icon=no
arg=run("Show Info...");
</line>
...
previous version actionbar3.zip
Contains <sticky> feature, and Alt-click actionbar removal.
ImageJ Luxembourg 2008 Workshop support material : mutterer_workshop.pdf
FigureJ