Hi,

after browsing around a bit in SCJ and IJ2 examples, I would like to apply some 
of it in my BigDataViewer plugin. Before I do it all wrong, I thought I ask for 
advice on best practices…

My first application scenario is the following:
I have some code that exports from various sources to BigDataViewer's hdf5 
based file format. There is stuff that can go wrong, and usually the export 
takes some time. Thus, it would be nice to have some user feedback on progress 
and warnings etc. If the code is called from an IJ1 plugin, this should be 
directed to IJ.log and the IJ progressbar. If the code is called from other 
code, it should be directed to stdout. Currently I'm using my own 
ProgressListener interface and IJ /  sysout implementations.
However this seems like the textbook example for LogService, so I would like to 
replace my crooked reinvented wheel by a shiny new scijava one :-)

I'm a bit unclear on how to do it exactly:
1) A lot of the code lives in static methods. The correct (and only) way to get 
the LogService in there is as a method parameter, right?
2) Where do I instantiate the service? Probably in the respective IJ1 plugin, 
somthing like this:
    new Context(IJ1LogService.class) in the constructor, and then
    context.inject(this) to fill a @Parameter annotated LogService field.
    Is that about right?
3) Is there something like a ProgressService which could be implemented to set 
the IJ1 progressbar? (I had a quick look but couldn't find one)

thanks a lot for any pointers,
Tobias


Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
ImageJ-devel mailing list
[email protected]
http://imagej.net/mailman/listinfo/imagej-devel

Reply via email to