Michael Küttner created NETBEANS-4857:
-----------------------------------------

             Summary: ExplorerManager creates way too many PropertyChangeEvents 
if multiple OutlineViews are synchonized 
                 Key: NETBEANS-4857
                 URL: https://issues.apache.org/jira/browse/NETBEANS-4857
             Project: NetBeans
          Issue Type: Bug
          Components: platform - Outline&TreeTable
    Affects Versions: 11.3, 11.2, 11.1, 12.0, 11.0, 8.2, 12.1
            Reporter: Michael Küttner
         Attachments: TreeViewMain.java

An ExplorerManager can be shared by multiple OutlineViews to synchronize 
displayed nodes and selection. This works fine for single node selection 
(ListSelectionModel.SINGLE_SELECTION).

But in case of multiple selection 
(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION) the ExplorerManager creates 
way too many PropertyChangeEvents.

I attached a small example application that contains two OutlineViews sharing a 
single ExplorerManger. A PropertyChangeListener is registered to the 
ExplorerManager and prints old/new selected node to standard out.

If you select all nodes from "0" to "29" (e.g, usind SHIFT+Mouse1) you will get 
following output. The PropertyChangeListener is called *32* times!!!

old node: [0]; new node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
old node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 
19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]; new node: []
old node: []; new node: [0]
old node: [0]; new node: [0, 1]
old node: [0, 1]; new node: [0, 1, 2]
old node: [0, 1, 2]; new node: [0, 1, 2, 3]
old node: [0, 1, 2, 3]; new node: [0, 1, 2, 3, 4]
old node: [0, 1, 2, 3, 4]; new node: [0, 1, 2, 3, 4, 5]
old node: [0, 1, 2, 3, 4, 5]; new node: [0, 1, 2, 3, 4, 5, 6]
old node: [0, 1, 2, 3, 4, 5, 6]; new node: [0, 1, 2, 3, 4, 5, 6, 7]
old node: [0, 1, 2, 3, 4, 5, 6, 7]; new node: [0, 1, 2, 3, 4, 5, 6, 7, 8]
old node: [0, 1, 2, 3, 4, 5, 6, 7, 8]; new node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
old node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; new node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 
9, 10]
old node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; new node: [0, 1, 2, 3, 4, 5, 6, 
7, 8, 9, 10, 11]
old node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; new node: [0, 1, 2, 3, 4, 5, 
6, 7, 8, 9, 10, 11, 12]
old node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]; new node: [0, 1, 2, 3, 4, 
5, 6, 7, 8, 9, 10, 11, 12, 13]
old node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]; new node: [0, 1, 2, 
3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
old node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]; new node: [0, 1, 
2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
old node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; new node: [0, 
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
old node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; new node: 
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
old node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]; new 
node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]
old node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]; 
new node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
old node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 
19]; new node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 
18, 19, 20]
old node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 
19, 20]; new node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 
17, 18, 19, 20, 21]
old node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 
19, 20, 21]; new node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 
16, 17, 18, 19, 20, 21, 22]
old node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 
19, 20, 21, 22]; new node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 
15, 16, 17, 18, 19, 20, 21, 22, 23]
old node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 
19, 20, 21, 22, 23]; new node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 
14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]
old node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 
19, 20, 21, 22, 23, 24]; new node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
old node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 
19, 20, 21, 22, 23, 24, 25]; new node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 
12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]
old node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 
19, 20, 21, 22, 23, 24, 25, 26]; new node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27]
old node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 
19, 20, 21, 22, 23, 24, 25, 26, 27]; new node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28]
old node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 
19, 20, 21, 22, 23, 24, 25, 26, 27, 28]; new node: [0, 1, 2, 3, 4, 5, 6, 7, 8, 
9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 
29]

 

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to