diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/CyActivator.java b/src/main/java/de/hhu/ba/yoshikoWrapper/CyActivator.java index 63a875a892451124e8448f3e953d9332c45cda54..1652fedf579aeec507609e441553917764bda682 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/CyActivator.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/CyActivator.java @@ -117,7 +117,6 @@ public class CyActivator extends AbstractCyActivator { props.setProperty(COMMAND, YoshikoCommand.PERFORM_ALGORITHM.toString()); props.setProperty(COMMAND_DESCRIPTION,"TEST PERFORM ALGORITHM"); registerService(context, commandTaskFactory, TaskFactory.class, props); - System.out.println(props.toString()); //Initialize and register main panel MainPanel mainPanel = new MainPanel(); diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/core/ParameterSet.java b/src/main/java/de/hhu/ba/yoshikoWrapper/core/ParameterSet.java index f74c050263309cbab89cc8419dc0a8c830ee2555..87da79a3c3a696e288a56a4ae30390e1f11bf963 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/core/ParameterSet.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/core/ParameterSet.java @@ -1,11 +1,16 @@ package de.hhu.ba.yoshikoWrapper.core; + import org.cytoscape.model.CyColumn; +import org.cytoscape.work.Tunable; public class ParameterSet { - public int timeLimit; + @Tunable(description="Time Limit for the ILP mode", context="nogui") + public int timeLimit = -1; + @Tunable(description="A column in the edge table containing weights", context="nogui") public CyColumn weightColumn; + public CyColumn permanentColumn; public CyColumn forbiddenColumn; public double defaultInsertionCost; @@ -17,5 +22,5 @@ public class ParameterSet { public boolean useHeuristic; public int solCount; public boolean disableMultiThreading; - + } diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/core/YoshikoLoader.java b/src/main/java/de/hhu/ba/yoshikoWrapper/core/YoshikoLoader.java index 4a970c02730b55d2dbdc1e57c4c8e64b16a8a246..1eec501cc0181d32d458f117094ce12adc009dae 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/core/YoshikoLoader.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/core/YoshikoLoader.java @@ -39,7 +39,6 @@ public class YoshikoLoader { private static Logger logger = YoshikoLogger.getInstance().getLogger(); public static void loadLibrary(String libPath) { - //Attempt to load from a previously stored path File f = new File (libPath); if (!f.exists()) { @@ -49,15 +48,19 @@ public class YoshikoLoader { try { logger.info("Attempting to load library @: "+libPath); + //Verify version ending if (!libPath.substring(0,libPath.lastIndexOf(".")).endsWith(REQUIRED_VERSION)) { - throw new Exception(LocalizationManager.get("libFail")+" "+REQUIRED_VERSION); + logger.info(LocalizationManager.get("libFail")+" "+REQUIRED_VERSION); + return; } + //Perform actual loading System.load(libPath); + } - catch(Exception e) { + catch(UnsatisfiedLinkError e) { + //This might happen as Java doesn't unload native libs + //One such case might be reloading the Cytoscape app on-the-fly logger.error(e.getMessage()); - logger.info(LocalizationManager.get("libFail")+" "+REQUIRED_VERSION); - return; } LibraryInterface.setVerbosity(3); diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/swing/LanguageSwitcherPanel.java b/src/main/java/de/hhu/ba/yoshikoWrapper/swing/LanguageSwitcherPanel.java index 1b175e4f3eaf153c37fb3700e858bfe7eeab9aa7..8848647483717eb9963010d7fef1a247f6261b8a 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/swing/LanguageSwitcherPanel.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/swing/LanguageSwitcherPanel.java @@ -37,7 +37,7 @@ public class LanguageSwitcherPanel extends BasicCollapsiblePanel{ super(LocalizationManager.get("switchLanguage")); final LanguageSwitcher switcher; //final BasicCollapsiblePanel ret = new BasicCollapsiblePanel(); - getContentPane().setLayout(new BoxLayout(getContentPane(),BoxLayout.X_AXIS)); + //getContentPane().setLayout(new BoxLayout(getContentPane(),BoxLayout.X_AXIS)); //SWING COMPONENTS INIT switcher = new LanguageSwitcher(); diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/taskFactories/YoshikoCommand.java b/src/main/java/de/hhu/ba/yoshikoWrapper/taskFactories/YoshikoCommand.java index 0a964ecd2d1a98ee7f11490def7ea976b7a41ad7..812564310a916ea70ad7a2f0f044e710c2087e0e 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/taskFactories/YoshikoCommand.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/taskFactories/YoshikoCommand.java @@ -11,5 +11,15 @@ public enum YoshikoCommand { */ CREATE_CLUSTER_VIEW, CREATE_META_GRAPH, - PERFORM_ALGORITHM + PERFORM_ALGORITHM; + + @Override + public String toString() { + if (this==PERFORM_ALGORITHM) { + return "cluster"; //TODO: Dynamic + } + return "null"; + } } + + diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/tasks/AlgorithmTask.java b/src/main/java/de/hhu/ba/yoshikoWrapper/tasks/AlgorithmTask.java index c3a0af7cf9d43f7ed73d7a696a075fa918513e82..80bc8ae8049c5af37f7acf8d45d79d9e2ac2159b 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/tasks/AlgorithmTask.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/tasks/AlgorithmTask.java @@ -31,6 +31,7 @@ import org.cytoscape.application.swing.CytoPanelState; import org.cytoscape.model.CyNetwork; import org.cytoscape.model.CyNode; import org.cytoscape.work.AbstractTask; +import org.cytoscape.work.ContainsTunables; import org.cytoscape.work.TaskMonitor; import org.cytoscape.work.Tunable; import org.slf4j.Logger; @@ -65,11 +66,15 @@ public class AlgorithmTask extends AbstractTask { private final Window statusWindow; //TODO: Make tunable? //Parameters - @Tunable(description="Parameter Set determining the operation mode for Yoshiko", context="nogui") - private final ParameterSet parameterSet; + + /**The ParameterSet specifying how the algorithm is to be performed + * + */ + @ContainsTunables + public ParameterSet parameterSet = null; @Tunable(description="Network to analyze for clusters", context="nogui") - private final CyNetwork net; + public CyNetwork net; //Temps, pointing to and need to be freed in C++ private LibraryInput input; @@ -78,6 +83,12 @@ public class AlgorithmTask extends AbstractTask { private ResultPanel resultPanel; + /** + * Default constructor, creates a new AlgorithmTask + * @param statusWindow The Window in which the status-bar is to be shown, can be null + * @param net The network that is to be clustered + * @param parameterSet The parameter set specifying the clustering mode + */ public AlgorithmTask( Window statusWindow, CyNetwork net, diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/tasks/CreateClusterViews.java b/src/main/java/de/hhu/ba/yoshikoWrapper/tasks/CreateClusterViews.java index 103d03c1d7f44689433c8e3c1c70aa757be47b26..a5674a7ab6dff36f5f5e70afee44af3280afb41a 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/tasks/CreateClusterViews.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/tasks/CreateClusterViews.java @@ -10,6 +10,7 @@ import org.cytoscape.work.ObservableTask; import org.cytoscape.work.Task; import org.cytoscape.work.TaskMonitor; import org.cytoscape.work.TaskObserver; +import org.cytoscape.work.Tunable; import de.hhu.ba.yoshikoWrapper.core.CyCore; import de.hhu.ba.yoshikoWrapper.core.LocalizationManager; @@ -18,9 +19,8 @@ import de.hhu.ba.yoshikoWrapper.graphModel.YoshikoCluster; public class CreateClusterViews implements Task { - //TODO: Merge redundant code with CreateMetaGraphTask - - private ArrayList<YoshikoCluster> clusters; + @Tunable + public ArrayList<YoshikoCluster> clusters; private boolean isTerminated;