Table of Contents

Action Bar Plugin

Action Bar

Authors

Jerome Mutterer (email) , Johannes Schindelin , Stephan Saalfeld , Michael Schmid , Serge Mazères , Olivier Burri , Simon Roussel , Gabriel Landini

Citing

Please cite ActionBar like this:

Mutterer, Jerome (2017): Custom toolbars and mini applications with Action Bar. figshare. https://dx.doi.org/10.6084/m9.figshare.3397603 Retrieved: 14 17, Jan 09, 2017 (GMT)

Description

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).

ABDemo

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.

How to add a line of buttons

Each line of buttons should be included between line tags like this:

<line>
// add buttons here

</line>

How to add buttons

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

Creating an empty config file canvas with icons

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.

Customizing your ActionBar(s)

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");

How to have one or more Action Bars showing at Startup time?

Go to Edit>Options>Startup

here, enter the command that starts your ActionBar, eg:

run("Action Bar","/plugins/ActionBar/lambda_bar.txt");

If your ActionBar file has an underscore in it and is located in your plugins folder, you should also be able to start it using its own command, eg:

run("lambda bar");

If the StartupMacros file is available

There is an invocation via AutoRun inside the “StartupMacros” file, which executes all macros residing in (../macros/AutoRun/). To use this facility simply put a macro into this folder ending with *.ijm and use i.e. this one line of code, to start your ActionBar.

run("Action Bar", "/plugins/ActionBar/MyNewActionBar.txt");

For older versions, mainly deprecated

Include an AutoRun macro in StartupMacros.txt:

macro "AutoRun" {
  run("Action Bar", "/plugins/Morphology/ActionBarMorphoset.txt");
}

Tip : One Action Bar can start others…

Sticky ActionBars

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.

The Adobe Flash Plugin is needed to display this content. The Adobe Flash Plugin is needed to display this content.

Installation

First download latest version from Download section it in an ActionBar folder inside the plugins folder. Restart ImageJ.

ImageJ/plugins/action_bar201d.jar               Action Bar plugin
ImageJ/plugins/ActionBar/		        ActionBar folder for your bars
ImageJ/plugins/ActionBar/icons/			..icons folder 
...
ImageJ/plugins/test_bar.jar                     a standalone actionbar file

Advanced usage tips

Licence

No licence associated. Citing Action Bar will be apreciated.

Contact

Contact Jerome if you find any bugs or if you'd like to see a feature appear in a new release.

Downloads

Starting 2017, I will upload new versions on figshare. https://dx.doi.org/10.6084/m9.figshare.3397603.v3

August 2014 action_bar202.jar

January 2014 action_bar201d.jar

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

Extra Downloads

FigureJ