The Add Label works like this:

When a session starts i.e. the manager is populated with ROIs, either opened from files, added manually or by the Add Particles the ROIs the ROIs are giving a number ('label index') which has no internal meaning.  When ROIs are labeled by re-indexing the entries in the table (remember the 'label index' has no internal meaning) calling Measure and subsequent Label (the Clear Results is called first) the order of the ROIs in the manager decides the numeric label added to the image and the number on the image corresponds to the 'label index'.  When we remove a ROI the 'label indices' should remain unchanged as to still match the numeric labels in the image.

That's the reason for the meaningless label index and that's the reason for introducing a JTable since assigning a number to an entry is very easy and we won't have to mess with text labels of the ROI nor make sure that the list AND a hashtable is updated (The getRois method has been altered to create an appropriate hashtable and return it in case it is needed for other plug ins).

The reason behind re-indexing the entries in the table is to ease the use of the plug in.  If we didn't re-index, the user would have to save all the ROIs and open them again if there were many changes (deletions) to the ROIs.  By re-indexing the numbers in the image will correspond to the numbers in the list in a very easy way.

The 'update' may not be the most intuitive for the user since we remove the current entry and add the active ROI, but it is by far the easiest and should handle a small saving problems: sometimes when ROIs are made with the particle analyzer they get the same label and thus the same filename.  By giving the ROI a new text label when the ROI is updated should solve this problem in most cases.