use of org.baderlab.csplugins.enrichmentmap.view.control.ControlPanel.EMViewControlPanel in project EnrichmentMapApp by BaderLab.
the class ControlPanelMediator method handleEvent.
@Override
public void handleEvent(SetCurrentNetworkViewEvent e) {
if (getControlPanel().isDisplayable())
setCurrentNetworkView(e.getNetworkView());
invokeOnEDT(() -> {
EMViewControlPanel viewPanel = getControlPanel().getViewControlPanel(e.getNetworkView());
updateLegends(viewPanel);
});
}
use of org.baderlab.csplugins.enrichmentmap.view.control.ControlPanel.EMViewControlPanel in project EnrichmentMapApp by BaderLab.
the class ControlPanelMediator method applyVisualStyle.
private void applyVisualStyle(EMStyleOptions options, CyCustomGraphics2<?> chart, boolean updateChartOnly) {
ApplyEMStyleTask task = applyStyleTaskFactory.create(options, chart, updateChartOnly);
dialogTaskManager.execute(new TaskIterator(task), new TaskObserver() {
@Override
public void taskFinished(ObservableTask task) {
}
@Override
public void allFinished(FinishStatus finishStatus) {
EMViewControlPanel viewPanel = getControlPanel().getViewControlPanel(options.getNetworkView());
updateLegends(viewPanel);
}
});
}
use of org.baderlab.csplugins.enrichmentmap.view.control.ControlPanel.EMViewControlPanel in project EnrichmentMapApp by BaderLab.
the class ControlPanelMediator method reset.
public void reset(ViewParams params) {
long netViewID = params.getNetworkViewID();
invokeOnEDT(() -> {
EMViewControlPanel viewPanel = getControlPanel().getViewControlPanel(netViewID);
if (viewPanel == null)
return;
EnrichmentMap map = emManager.getEnrichmentMap(viewPanel.getNetworkView().getModel().getSUID());
if (map == null)
return;
try {
// Update Filters
if (params.getPValue() != null && viewPanel.getPValueSliderPanel() != null)
viewPanel.getPValueSliderPanel().setValue(params.getPValue());
if (params.getQValue() != null && viewPanel.getQValueSliderPanel() != null)
viewPanel.getQValueSliderPanel().setValue(params.getQValue());
if (params.getSimilarityCoefficient() != null && viewPanel.getSimilaritySliderPanel() != null)
viewPanel.getSimilaritySliderPanel().setValue(params.getSimilarityCoefficient());
if (params.getNodeCutoffParam() == CutoffParam.P_VALUE)
viewPanel.getPValueRadio().doClick();
else if (params.getNodeCutoffParam() == CutoffParam.Q_VALUE)
viewPanel.getQValueRadio().doClick();
Set<String> filteredOutDataSetNames = params.getFilteredOutDataSets();
if (filteredOutDataSetNames != null && !filteredOutDataSetNames.isEmpty()) {
Set<AbstractDataSet> allDataSets = viewPanel.getAllDataSets();
Set<AbstractDataSet> filteredDataSets = allDataSets.stream().filter(ds -> !filteredOutDataSetNames.contains(ds.getName())).collect(Collectors.toSet());
viewPanel.getDataSetSelector().setCheckedItems(filteredDataSets);
}
// Update Style options
ChartOptions chartOptions = params.getChartOptions();
viewPanel.getChartDataCombo().setSelectedItem(chartOptions != null ? chartOptions.getData() : null);
viewPanel.getChartTypeCombo().setSelectedItem(chartOptions != null ? chartOptions.getType() : null);
viewPanel.getChartColorsCombo().setSelectedItem(chartOptions != null ? chartOptions.getColorScheme() : null);
viewPanel.getShowChartLabelsCheck().setSelected(chartOptions != null && chartOptions.isShowLabels());
viewPanel.getPublicationReadyCheck().setSelected(params.isPublicationReady());
viewPanel.updateChartDataCombo();
updateVisualStyle(map, viewPanel);
filterNodesAndEdges(viewPanel, map);
} finally {
updating = false;
}
});
}
use of org.baderlab.csplugins.enrichmentmap.view.control.ControlPanel.EMViewControlPanel in project EnrichmentMapApp by BaderLab.
the class ControlPanelMediator method updateDataSetList.
public void updateDataSetList(CyNetworkView netView) {
EMViewControlPanel viewPanel = getControlPanel().getViewControlPanel(netView);
viewPanel.updateDataSetSelector();
updateLegends(viewPanel);
}
use of org.baderlab.csplugins.enrichmentmap.view.control.ControlPanel.EMViewControlPanel in project EnrichmentMapApp by BaderLab.
the class ControlPanelMediator method createStyleOptions.
public EMStyleOptions createStyleOptions(CyNetworkView netView) {
EnrichmentMap map = netView != null ? emManager.getEnrichmentMap(netView.getModel().getSUID()) : null;
EMViewControlPanel viewPanel = getControlPanel().getViewControlPanel(netView);
return createStyleOptions(map, viewPanel);
}
Aggregations