Login  Register

Re: ImageJ as Eclipse plugin

Posted by Albert Cardona on Jul 13, 2006; 4:52pm
URL: http://imagej.273.s1.nabble.com/ImageJ-as-Eclipse-plugin-tp3702139p3702146.html

A comment on using the ij.gui.ImageCanvas inside a swing component: you are up
for a lot of trouble, but it's not impossible to make it work together.
TrakEM2 uses an extended ij.gui.ImageCanvas inside a JSplitPane, and the
result is very good so far. Other swing widgets are not so good at the
task -perhaps the JSplitPane is particularly suited, for it can "only"
contain one component on each side. TrakEM2's setup works fine so far in
every Sun JVM I've tried in linux, macosx and windows.

In any case a good replacement is, as long as your computer is reasonably
fast, to extend ij.gui.ImageCanvas and make the paint(Graphics g) paint to an
offscreen image, which is then painted in the paint(Graphics g) method of an
extended JPanel embedded in a JScrollPane. An alternative is to paint the
my_ImagePlus.getImage() directly, and the my_ImagePlus.getRoi().paint(g) as
well. Of course in both cases you have to reimplement the panning and
zooming -that's why I stick to the ij.gui.ImageCanvas.

Albert

--
Albert Cardona
Molecular Cell Developmental Biology
University of California Los Angeles
Tel +1 310 2067376
TrakEM2 - http://www.ini.unizh.ch/~acardona/trakem2.html
Programming: http://www.pensament.net/java/
Research: http://www.mcdb.ucla.edu/Research/Hartenstein/
Web design: http://www.pixelets.com