Skip to content

Commit 04b36dc

Browse files
committed
Heat Map listeners removed during update. Fixes #360
1 parent 1699758 commit 04b36dc

File tree

1 file changed

+11
-2
lines changed
  • EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/view/heatmap

1 file changed

+11
-2
lines changed

EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/view/heatmap/HeatMapMediator.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,9 @@ private void updateHeatMap(CyNetworkView networkView) {
295295

296296
invokeOnEDT(() -> {
297297
HeatMapContentPanel contentPanel = getContentPanel();
298-
contentPanel.update(network, map, params, rankOptions, union, inter, clusterRankingOption);
298+
resetWithoutListeners(() -> {
299+
contentPanel.update(network, map, params, rankOptions, union, inter, clusterRankingOption);
300+
});
299301

300302
if (propertyManager.getValue(PropertyManager.HEATMAP_AUTOFOCUS))
301303
bringToFront();
@@ -353,6 +355,13 @@ private void updateHeatMapPanel() {
353355
List<RankingOption> rankOptions = getDataSetRankOptions(map);
354356
ClusterRankingOption clusterRankingOption = getClusterRankingOption(map);
355357

358+
resetWithoutListeners(() -> {
359+
getContentPanel().update(network, map, params, rankOptions, getContentPanel().getUnionGenes(), getContentPanel().getInterGenes(), clusterRankingOption);
360+
});
361+
}
362+
363+
364+
private void resetWithoutListeners(Runnable runnable) {
356365
isResetting = true;
357366

358367
getContentPanel().getOperatorCombo().removeActionListener(operatorActionListener);
@@ -361,7 +370,7 @@ private void updateHeatMapPanel() {
361370
getContentPanel().getShowValuesCheck().removeActionListener(showValueActionListener);
362371

363372
try {
364-
getContentPanel().update(network, map, params, rankOptions, getContentPanel().getUnionGenes(), getContentPanel().getInterGenes(), clusterRankingOption);
373+
runnable.run();
365374
} finally {
366375
getContentPanel().getOperatorCombo().addActionListener(operatorActionListener);
367376
getContentPanel().getNormCombo().addActionListener(normActionListener);

0 commit comments

Comments
 (0)