Need to compile and run for plugin to work after runing another plugin

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

Need to compile and run for plugin to work after runing another plugin

JPCLAMME
Hi,

I have two GUI plug-ins I made to help formating and analyzing images They
are both made on the same design. When I run one plug-in and analyze
images, the next time I run the second plug-in, that one doesn't work
properly. I have to open the .java file, do compile and run and then it
works properly but then the other one doesn't work anymore.
Does someone has a hit on were to start looking for the bug in my code ?

Thank you

JP



- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Jean-Pierre CLAMME, PhD
Chief Scientist
Nitto Denko Technical
501 Via Del Monte
Oceanside, CA 92058
E-mail: [hidden email]
Phone: 1-760-696-9428

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Need to compile and run for plugin to work after runing another plugin

dscho
Hi Jean Pierre,

On Mon, 11 Mar 2013, Jean Pierre CLAMME wrote:

> I have two GUI plug-ins I made to help formating and analyzing images They
> are both made on the same design. When I run one plug-in and analyze
> images, the next time I run the second plug-in, that one doesn't work
> properly. I have to open the .java file, do compile and run and then it
> works properly but then the other one doesn't work anymore.
> Does someone has a hit on were to start looking for the bug in my code ?

As you are using ImageJ, an Open Source software, you are probably
expecting what comes now:

It would be easier [*1*] if you posted the source code of the plugins [*2*].

Ciao,
Johannes

Footnote *1*: it could be a number of things, something that comes to mind
is incompatible helper classes contained in the same .java file. But
really, it is so vaguely described what goes wrong that it would be a wild
goose chase without substantially more information. (And keep in mind that
it very likely took me longer to craft this email than to identify the
problem given the source code.)

Footnote *2*: If you are working on scientific software, the source code
should be open: http://developer.imagej.net/faq#t21n236 Compare also to
http://www.youtube.com/watch?v=lGNv0EtqC64 and if you cannot come up with
scientific reasons to keep the source code closed after that, you
shouldn't...

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Need to compile and run for plugin to work after runing another plugin

dscho
Hi Jean-Pierre,

On Tue, 12 Mar 2013, [hidden email] wrote:

> Here are the two codes.

Thank you.

> I'm sure they are bad coding example as I kind of build layers of stuff
> as I needed them. They are nothing special, just putting buttons and a
> few automatic features when loading and image.

I think that you do not need to be embarassed at all. It is certainly not
bad coding, and besides: it does its job, right? If you are still worried
about making the source code public:

        http://matt.might.net/articles/crapl/

In essence: it is better to make your code available than to keep it
private, even if you deem the code quality low. There is always somebody
who can benefit from your work.

In your concrete example, you might think that the plugins do nothing
special, but I guarantee you that there are people who would learn from
the code, adapt it to their own needs, and be really grateful.

So: you might want to consider making it public, say, as a public reply to
this mail.

As to the concrete problem: it is indeed a class included in the .java
file that is incompatible, as I suspected. Thanks for letting me confirm
that by showing me the code.

It is the IPDemoRunner class. The problem can be worked around easily by
making them inner classes (so that both plugins can have their own
versions) by moving the closing curly bracket from just before "class
IPDemoRunner" to the end of the file.

Ciao,
Johannes

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html