Skip to content

Commit

Permalink
Fix problem with creation dialog blocking table command task.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekucera committed Sep 2, 2021
1 parent b82836f commit 3769c35
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.baderlab.csplugins.enrichmentmap;

import org.baderlab.csplugins.enrichmentmap.actions.OpenEnrichmentMapAction;
import org.baderlab.csplugins.enrichmentmap.actions.OpenEnrichmentMapPanelsAction;
import org.baderlab.csplugins.enrichmentmap.commands.ChartCommandTask;
import org.baderlab.csplugins.enrichmentmap.commands.DatasetColorCommandTask;
import org.baderlab.csplugins.enrichmentmap.commands.DatasetShowCommandTask;
Expand Down Expand Up @@ -28,19 +28,19 @@ protected void configure() {


@ProvidesIntoSet
public CommandTaskFactory provideBuild(Provider<EMBuildCommandTask> taskProvider, OpenEnrichmentMapAction showTask) {
public CommandTaskFactory provideBuild(Provider<EMBuildCommandTask> taskProvider, OpenEnrichmentMapPanelsAction showTask) {
String desc = "Creates an EnrichmentMap network containing one or two data sets.";
return CommandTaskFactory.create("build", desc, null, taskProvider, showTask);
}

@ProvidesIntoSet
public CommandTaskFactory provideGSEA(Provider<EMGseaCommandTask> taskProvider, OpenEnrichmentMapAction showTask) {
public CommandTaskFactory provideGSEA(Provider<EMGseaCommandTask> taskProvider, OpenEnrichmentMapPanelsAction showTask) {
String desc = "Creates an EnrichmetMap network from one or two GSEA results. (Deprecated, use 'build' or 'mastermap' command instead.)";
return CommandTaskFactory.create("gseabuild", desc, null, taskProvider, showTask);
}

@ProvidesIntoSet
public CommandTaskFactory provideMastermap(Provider<MastermapCommandTask> taskProvider, OpenEnrichmentMapAction showTask) {
public CommandTaskFactory provideMastermap(Provider<MastermapCommandTask> taskProvider, OpenEnrichmentMapPanelsAction showTask) {
String desc = "Creates an EnrichmentMap network containing any number of data sets by scanning files in a folder.";
String longDesc = "Uses the same algorithm as the Create EnrichmentMap Dialog to scan the files in a folder and "
+ "automatically group them into data sets. Sub-folders will be scanned up to one level deep, allowing you to "
Expand Down Expand Up @@ -71,7 +71,7 @@ public CommandTaskFactory provideJson(Provider<ExportModelJsonCommandTask> taskP
}

@ProvidesIntoSet
public CommandTaskFactory provideBuildTable(Provider<TableCommandTask> taskProvider, OpenEnrichmentMapAction showTask) {
public CommandTaskFactory provideBuildTable(Provider<TableCommandTask> taskProvider, OpenEnrichmentMapPanelsAction showTask) {
String desc = "Creates an EnrichmentMap network from values in a table.";
String longDesc = "Intended mainly for other Apps to programatically create an EnrichmentMap network.";
return CommandTaskFactory.create("build-table", desc, longDesc, taskProvider, showTask);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package org.baderlab.csplugins.enrichmentmap.actions;

import java.awt.event.ActionEvent;

import org.baderlab.csplugins.enrichmentmap.view.control.ControlPanelMediator;
import org.baderlab.csplugins.enrichmentmap.view.heatmap.HeatMapMediator;
import org.cytoscape.application.swing.AbstractCyAction;
import org.cytoscape.work.Task;
import org.cytoscape.work.TaskMonitor;

import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;

@SuppressWarnings("serial")
@Singleton
public class OpenEnrichmentMapPanelsAction extends AbstractCyAction implements Task {

public static final String NAME = "EnrichmentMap";

@Inject private Provider<ControlPanelMediator> controlPanelMediatorProvider;
@Inject private Provider<HeatMapMediator> heatMapMediatorProvider;

public OpenEnrichmentMapPanelsAction() {
super(NAME);
setPreferredMenu("Apps");
}

public synchronized void showPanels() {
controlPanelMediatorProvider.get().showControlPanel();
heatMapMediatorProvider.get().showHeatMapPanel();
}

@Override
public void actionPerformed(ActionEvent e) {
showPanels();
}

@Override
public void run(TaskMonitor taskMonitor) {
showPanels();
}

@Override
public void cancel() {
}
}

0 comments on commit 3769c35

Please sign in to comment.