diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/cytoUtil/CyUtilities.java b/src/main/java/de/hhu/ba/yoshikoWrapper/cytoUtil/CyUtilities.java index 6c96b09a8e238a4a04baeb3979962fd5dd28889a..b4d2629b39dfda50dd07f6b7b3ceb775e4b2b6d4 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/cytoUtil/CyUtilities.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/cytoUtil/CyUtilities.java @@ -23,14 +23,6 @@ package de.hhu.ba.yoshikoWrapper.cytoUtil; -import java.awt.Component; - -import org.cytoscape.application.swing.CytoPanel; -import org.cytoscape.application.swing.CytoPanelComponent2; -import org.cytoscape.application.swing.CytoPanelName; - -import de.hhu.ba.yoshikoWrapper.core.CyCore; - /** * Helper functions that simplify the Cytoscape API that haven't found a home in any other class * @@ -42,18 +34,24 @@ public class CyUtilities { */ public static void highlightCyBrowser() { //We retrieve the result panel - CytoPanel resultPanel = CyCore.swing.getCytoPanel(CytoPanelName.EAST); - for (int i= 0; i< resultPanel.getCytoPanelComponentCount(); i++) { - Component component = resultPanel.getComponentAt(i); - if (component instanceof CytoPanelComponent2) { - CytoPanelComponent2 cmp = (CytoPanelComponent2) component; - if (cmp.getTitle().contains("YoshikoInfo")) { - resultPanel.setSelectedIndex(i); - return; - } - } - - } + //CytoPanel resultPanel = CyCore.swing.getCytoPanel(CytoPanelName.EAST); + + //VARIANT 1: FETCH BY TITLE OF TAB + +// for (int i= 0; i< resultPanel.getCytoPanelComponentCount(); i++) { +// Component component = resultPanel.getComponentAt(i); +// if (component instanceof CytoPanelComponent2) { +// CytoPanelComponent2 cmp = (CytoPanelComponent2) component; +// if (cmp.getTitle().contains("YoshikoInfo")) { +// resultPanel.setSelectedIndex(i); +// return; +// } +// } +// +// } + + //VARIANT 2: FETCH BY CLASS OF TAB COMPONENT + // int index = resultPanel.indexOfComponent("edu.ucsf.rbvi.cyBrowser.internal.view.ResultsPanelBrowser"); // if (index != -1) { // resultPanel.setSelectedIndex(index); diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/help/HelpLinks.java b/src/main/java/de/hhu/ba/yoshikoWrapper/help/HelpLinks.java index 50e87011ba89ab338d11b5946547001a6fb4463a..604225a8c0b69863a221367f9ed4e11fc99e6f7f 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/help/HelpLinks.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/help/HelpLinks.java @@ -29,7 +29,8 @@ public final class HelpLinks { public static final Map<String, Object> mainInfo = new HashMap<String,Object>(); static { mainInfo.put("url", "file:///home/philipp/workspace/cs/cytoscape-tutorials/presentations/yoshiko.html"); - mainInfo.put("title", "YoshikoInfo"); + mainInfo.put("title", "Yoshiko Info"); + //mainInfo.put("id", "AboutYoshiko"); //mainInfo.put("url", "https://spqrph.github.io/cytoscape-tutorials/presentations/yoshiko.html#/title"); } diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/swing/components/HelpButton.java b/src/main/java/de/hhu/ba/yoshikoWrapper/swing/components/HelpButton.java index f349637db103d42bce956ae53e1e0a64bc7a011f..fd5510cfcf6d24349eef9fbaf8641632a6be1539 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/swing/components/HelpButton.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/swing/components/HelpButton.java @@ -33,7 +33,6 @@ import javax.swing.JButton; import de.hhu.ba.yoshikoWrapper.core.LocalizationManager; import de.hhu.ba.yoshikoWrapper.cytoUtil.CommandExecutor; -import de.hhu.ba.yoshikoWrapper.cytoUtil.CyUtilities; import de.hhu.ba.yoshikoWrapper.help.HelpLinks; import de.hhu.ba.yoshikoWrapper.swing.GraphicsLoader; @@ -72,9 +71,9 @@ public class HelpButton extends JButton{ new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - CommandExecutor.executeCommand("cybrowser", "show",HelpLinks.mainInfo , null); + CommandExecutor.executeCommand("cybrowser", "dialog",HelpLinks.mainInfo , null); //Workaround to instantly select/highlight the CyBrowser tab - CyUtilities.highlightCyBrowser(); + //CyUtilities.highlightCyBrowser(); } } );