On 18.06.2015 07:54, Michaël Michaud wrote:
> 
>>> @@ -667,7 +668,11 @@
>>>     public void fireSelectionChanged() {
>>>             for (Iterator i = listeners.iterator(); i.hasNext();) {
>>>                     LayerViewPanelListener l = (LayerViewPanelListener) 
>>> i.next();
>>> -                   l.selectionChanged();
>>> +            // [mmichaud 2015-06-17] Do not propagate selectionChange if 
>>> the change
>>> +            // comes from AttributeTablePanel
>>> +            if (getWorkBenchFrame().getActiveInternalFrame() instanceof 
>>> ViewAttributesPlugIn.ViewAttributesFrame) continue;
>>> +            if (getWorkBenchFrame().getActiveInternalFrame() instanceof 
>>> InfoFrame) continue;
>>> +            l.selectionChanged();
>>>             }
>>>     }
>> hey Mike,
>>
>> sorry, but that's unclean. there may be other listeners (apart form 
>> Info-,Attrib.Frame) that will need but do not get notified this way.
> 
> Right,
> 
> What about r4501 ?
> 

you moved it to the receiving end. that will probably work, but in theory a 
user could lightning-fast switch the active window and your test would fail.

we should probably go back a bit to the drawing board here. (mis)using 
selection event handlers for synchronization seems wrong. especially when they 
themselves start firing selection events.

how about an approach like:
- layerview and attrib.table each keep their own logic to select features, when 
they are done they fire a section changed event
- both register 'special' selection changed listeners to each other which are 
merely updating their views, but do not actually change the selection, that was 
already done by the events cause.

this is of course a real time approach, which is only necessary if users work 
with attrib table and layerview side by side and would expect them always to 
represent identical synched infos. you should test how that works for real big 
datasets, it might become slow there iterating over all features updating the 
views on each event.
the faster (but not real time) option would be a synch on frame activation of 
course.

additionally: 
 looks like you also integrated the update of layer's features (added,removed?) 
of the attrib.table on the selection events (ca. line 550 
AttributeTablePanel.java). you should probably attach listners to the 
attrib.tables layer for that purpose or agn. refresh on frame activation.


something like that :).. ede


------------------------------------------------------------------------------
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to