imageJ: setting a global static variable at startup

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

imageJ: setting a global static variable at startup

Giuseppe De Marco
Hi!

i'm new with imageJ.
I develop software for the Italian Public Administration.
In my Office we looked for a Java/ActiveX Web Twain Applet.
Because I'm a FLOSS appasionate I was happy to work with imageJA and the Scan
plugin.
Now The Digital scannings works fine.

Here is my question:

I need to develop a Java Plugin (i prefer python but the jython interpreter
grows too much the web transfer...) to automate the web form submission of the
image.

That's the workflow of my idea:

1. I initialize imageJ with a enviroment variable equivalent at the protocol
number of the document that i need to scan
2. Scan plugin execution: I scan document
3. Web form submission execution: Using an Apache http client I made the
connection between imageJ and my web system and i store the image using the form
i made.

The barrier is:

I don't now how to store a static variable into imageJ at startup.
I saw the parameters in applet/object  html tag but nothing...
I looked up the source of imageJ... But first I need your opinion because I
don't want to reinvent the "CARTWHEEL" :)

The meaning of this variable:

I need this value to automate the form submission, this variable represent the
value that complete the corrispondent url of the digital document attachment
procedure.

Any Idea will be appreciate,
i'm very happy to use imageJ, the plugin i'm developing will be released under
GPL.

giuseppe de marco



Reply | Threaded
Open this post in threaded view
|

Re: imageJ: setting a global static variable at startup

dscho
Hi,

On Mon, 25 Oct 2010, Giuseppe De Marco wrote:

> I don't now how to store a static variable into imageJ at startup.

Several options:

1) You can use ij.Prefs to store the variable under a certain name. If it
   is not set yet, ask the user. The good thing: ImageJ will take care of
   storing it persistently on disk.

2) You can use Java properties. They can be changed more easily, but
   you'll have to change the way ImageJ is started up.

3) Use Javascript in StartupMacros.ijm's AutoRun block to set a real
   static variable. Problem: you need to make sure that the class is
   loaded already.

There are probably many more ways...

Ciao,
Johannes