Search in sources :

Example 1 with CytoPanel

use of org.cytoscape.application.swing.CytoPanel in project EnrichmentMapApp by BaderLab.

the class HeatMapMediator method showHeatMapPanel.

public void showHeatMapPanel() {
    try {
        heatMapPanel = (HeatMapParentPanel) serviceRegistrar.getService(CytoPanelComponent.class, "(id=" + HeatMapParentPanel.ID + ")");
    } catch (Exception ex) {
    }
    if (heatMapPanel == null) {
        heatMapPanel = panelFactory.create(this);
        Properties props = new Properties();
        props.setProperty("id", HeatMapParentPanel.ID);
        serviceRegistrar.registerService(heatMapPanel, CytoPanelComponent.class, props);
    }
    // Bring panel to front
    CytoPanel cytoPanel = swingApplication.getCytoPanel(heatMapPanel.getCytoPanelName());
    int index = cytoPanel.indexOfComponent(HeatMapParentPanel.ID);
    if (index >= 0)
        cytoPanel.setSelectedIndex(index);
}
Also used : CytoPanel(org.cytoscape.application.swing.CytoPanel) Properties(java.util.Properties)

Example 2 with CytoPanel

use of org.cytoscape.application.swing.CytoPanel in project EnrichmentMapApp by BaderLab.

the class ControlPanelMediator method showControlPanel.

public void showControlPanel() {
    CytoPanelComponent panel = null;
    try {
        panel = serviceRegistrar.getService(CytoPanelComponent.class, "(id=" + ControlPanel.ID + ")");
    } catch (Exception ex) {
    }
    if (panel == null) {
        panel = controlPanelProvider.get();
        Properties props = new Properties();
        props.setProperty("id", ControlPanel.ID);
        serviceRegistrar.registerService(panel, CytoPanelComponent.class, props);
        if (firstTime && emManager.getAllEnrichmentMaps().isEmpty()) {
            firstTime = false;
            controlPanelProvider.get().getCreateEmButton().doClick();
        } else {
            setCurrentNetworkView(applicationManager.getCurrentNetworkView());
        }
    }
    // Select the panel
    CytoPanel cytoPanel = swingApplication.getCytoPanel(panel.getCytoPanelName());
    int index = cytoPanel.indexOfComponent(ControlPanel.ID);
    if (index >= 0)
        cytoPanel.setSelectedIndex(index);
}
Also used : CytoPanel(org.cytoscape.application.swing.CytoPanel) Properties(java.util.Properties) CytoPanelComponent(org.cytoscape.application.swing.CytoPanelComponent)

Aggregations

Properties (java.util.Properties)2 CytoPanel (org.cytoscape.application.swing.CytoPanel)2 CytoPanelComponent (org.cytoscape.application.swing.CytoPanelComponent)1