Commit 7e53598d authored by Philipp Spohr's avatar Philipp Spohr
Browse files

Fix for reloading app on the fly / hotswapping

parent 5d60f930
......@@ -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();
......
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;
}
......@@ -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);
......
......@@ -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();
......
......@@ -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";
}
}
......@@ -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,
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment