Re: Unique ResultsTable instance with clearing capabilities
Posted by
Wayne Rasband on
Jan 04, 2007; 11:01pm
URL: http://imagej.273.s1.nabble.com/Unique-ResultsTable-instance-with-clearing-capabilities-tp3700704p3700705.html
These bugs are fixed in ImageJ 1.38g, due next week. The
Sine_Cosine_Table plugin at
http://rsb.info.nih.gov/ij/plugins/sine-cosine.htmldemonstrates how a plugin can display values in the Results window.
-wayne
On Jan 3, 2007, at 5:35 PM, Josh D wrote:
> Right now I have a plugin which measures several unique statistics and
> adds them to a ResultsTable. Right now I use
> ResultsTable.getResultsTable()
> which gets the table used by Analyze>Measure titled "Results". This has
> problems however.
>
> If I use
> my plugin to populate the table with values, and then procede to
> use the Analyze>Measure tool, all of my results get deleted
> without any prompting
> whatsoever. Oddly, if I first use Measure and then use my plugin,
> then measure again, results stay, though with the two
> odd rows I added by using measure.
>
> I tried just making my own instance of ResultsTable, but it lacks the
> ability to truly clear the table (old "deleted" rows reappear when I do
> another image). This is because only the window gets cleared, not the
> actual ResultsTable. I see the code in the TextPanel and TextWindow
> classes actually looks for the "Results" text in the title of the
> window to
> determine whether to add the "Clear Results" menu and to provide for
> selectively clearing rows.
>
> Is there a way to have all the functionality of Analyze>Measure's
> ResultsTable, without having these problems? I tried to subclass
> ResultsTable, TextPanel and TextWindow to make things work, but it's
> gotten
> so messy and it doesn't even work! I think the clearing functionality
> should
> be built into an existing class or maybe another class, instead of
> TextPanel
> and TextWindow using if(getTitle().equals("Results")). Thanks,
> Josh D
>