Re: Unique ResultsTable instance with clearing capabilities
Posted by
Frederic V. Hessman on
Jan 04, 2007; 8:26am
URL: http://imagej.273.s1.nabble.com/Unique-ResultsTable-instance-with-clearing-capabilities-tp3700704p3700706.html
You might check out my MeasurementTable class as an example of how I
dealt with these problems :
http://www.astro.physik.uni-goettingen.de/
~hessman/ImageJ/Astronomy/
Rick
On 3 Jan 2007, at 11: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