Skip to content

Commit

Permalink
Fix: The connect window shows only 1 collection if the collection has…
Browse files Browse the repository at this point in the history
… several networks.
  • Loading branch information
marclegeay committed Jun 27, 2019
1 parent 31933ce commit 310e0bc
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.HashSet;
import java.util.Set;

import javax.swing.BorderFactory;
import javax.swing.JButton;
Expand Down Expand Up @@ -90,8 +92,11 @@ public void update(OVTable ovTable) {
this.selectNetwork.removeAllItems();
this.selectNetwork.addItem(CHOOSE);

Set<CyNetwork> rootNets = new HashSet<>();
for(CyNetwork net : this.netManager.getNetworkSet()) {
this.selectNetwork.addItem(this.rootNetManager.getRootNetwork(net));
if(rootNets.add(this.rootNetManager.getRootNetwork(net))) {
this.selectNetwork.addItem(this.rootNetManager.getRootNetwork(net));
}
}
// Now that the list is complete, we can re-add the event listener
this.selectNetwork.addActionListener(this);
Expand Down

0 comments on commit 310e0bc

Please sign in to comment.