Skip to content
Snippets Groups Projects
Commit 25315860 authored by Philipp Spohr's avatar Philipp Spohr
Browse files

Some refactor

parent de07bd9b
Branches
Tags
No related merge requests found
Showing
with 245 additions and 175 deletions
eclipse.preferences.version=1 eclipse.preferences.version=1
encoding//src/main/java=UTF-8 encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8 encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8 encoding/<project>=UTF-8
...@@ -59,6 +59,8 @@ public class YoshikoCluster { ...@@ -59,6 +59,8 @@ public class YoshikoCluster {
private ArrayList<CyNode> nodes; private ArrayList<CyNode> nodes;
private CySubNetwork net; private CySubNetwork net;
private Image img;
//SYMBOLIC LINKS //SYMBOLIC LINKS
private final CyNetwork originalGraph; private final CyNetwork originalGraph;
private Logger logger = YoshikoLogger.getInstance().getLogger(); private Logger logger = YoshikoLogger.getInstance().getLogger();
...@@ -70,9 +72,8 @@ public class YoshikoCluster { ...@@ -70,9 +72,8 @@ public class YoshikoCluster {
this.nodes = new ArrayList<CyNode>(); this.nodes = new ArrayList<CyNode>();
} }
private void createSubNetwork() { public void createSubNetwork() {
if (net == null) {
CyRootNetwork originalGraphAsRoot = CyCore.rootNetworkManager.getRootNetwork(originalGraph); CyRootNetwork originalGraphAsRoot = CyCore.rootNetworkManager.getRootNetwork(originalGraph);
//Create nested graph and cluster subnet //Create nested graph and cluster subnet
...@@ -92,7 +93,6 @@ public class YoshikoCluster { ...@@ -92,7 +93,6 @@ public class YoshikoCluster {
net = subnet; //Save for further reference net = subnet; //Save for further reference
} }
}
/** /**
* Attempt to select the nodes belonging to this cluster in the original Graph given that they still exist * Attempt to select the nodes belonging to this cluster in the original Graph given that they still exist
...@@ -114,12 +114,20 @@ public class YoshikoCluster { ...@@ -114,12 +114,20 @@ public class YoshikoCluster {
} }
public void generateImage(JLabel label, int width, int height) { public void applyImage(JLabel label, int width, int height) {
if (net == null) { if (net == null) {
createSubNetwork(); return;
}
if (img != null) {
getImage(width,height,label);
label.setIcon(new ImageIcon(img));
return;
}
} }
private void getImage(int width, int height,JLabel label) {
final CyNetworkView view = CyCore.networkViewFactory.createNetworkView(net); final CyNetworkView view = CyCore.networkViewFactory.createNetworkView(net);
//layout cluster //layout cluster
...@@ -150,7 +158,7 @@ public class YoshikoCluster { ...@@ -150,7 +158,7 @@ public class YoshikoCluster {
@Override @Override
public void run() { public void run() {
Image img = renderingEngine.createImage(width,height); img = renderingEngine.createImage(width,height);
label.setIcon(new ImageIcon(img)); label.setIcon(new ImageIcon(img));
renderingEngine.dispose(); renderingEngine.dispose();
...@@ -161,11 +169,8 @@ public class YoshikoCluster { ...@@ -161,11 +169,8 @@ public class YoshikoCluster {
} }
@Override @Override
public void cancel() { public void cancel() {}
//Nothing to do as GC is handled by JAVA
}
} }
); );
...@@ -173,8 +178,6 @@ public class YoshikoCluster { ...@@ -173,8 +178,6 @@ public class YoshikoCluster {
CyCore.dialogTaskManager.execute( CyCore.dialogTaskManager.execute(
createLayout createLayout
); );
} }
public int getSize() { public int getSize() {
...@@ -186,9 +189,6 @@ public class YoshikoCluster { ...@@ -186,9 +189,6 @@ public class YoshikoCluster {
} }
public CySubNetwork getSubNetwork() { public CySubNetwork getSubNetwork() {
if (net == null) {
createSubNetwork();
}
return net; return net;
} }
......
...@@ -46,130 +46,33 @@ public class YoshikoSolution { ...@@ -46,130 +46,33 @@ public class YoshikoSolution {
* The original Graph from which the solution was generated. * The original Graph from which the solution was generated.
* NOTE: This can be destroyed or modified during runtime while the solution still exists and may become invalid * NOTE: This can be destroyed or modified during runtime while the solution still exists and may become invalid
*/ */
private CyNetwork originalGraph; private final CyNetwork originalGraph;
public ArrayList<YoshikoCluster> cluster; public ArrayList<YoshikoCluster> cluster;
public int id;
public YoshikoSolution(CyNetwork originalGraph) { private final long id;
public YoshikoSolution(CyNetwork originalGraph, long id) {
cluster = new ArrayList<YoshikoCluster>(); cluster = new ArrayList<YoshikoCluster>();
this.originalGraph = originalGraph; this.originalGraph = originalGraph;
this.id = id;
} }
/** //_____________GETTER / SETTER ________________//
* Transforms this solution in a meta-graph where each cluster is represented by one node
* The nodes are linked to subgraphs representing the cluster and also their size is scaled relative to cluster size
*/
public void exportMetaGraph() {
CyNetwork metaGraph = CyCore.networkFactory.createNetwork();
metaGraph.getRow(metaGraph).set(CyNetwork.NAME, LocalizationManager.get("metaGraph"));
metaGraph.getDefaultNodeTable().createColumn("clusterSize", Integer.class, false);
metaGraph.getDefaultEdgeTable().createColumn("edgeStrength", Integer.class, false);
CyLayoutAlgorithm layout = CyCore.layoutAlgorithmManager.getDefaultLayout();
//Map Cluster to Nodes for further reference
HashMap<YoshikoCluster,CyNode> map = new HashMap<YoshikoCluster,CyNode>();
//Add nodes
for (YoshikoCluster c: cluster) {
CyNode clusterNode = metaGraph.addNode();
CySubNetwork subnet = c.getSubNetwork();
CyCore.networkManager.addNetwork(subnet);
//Create network view and register it
CyNetworkView subnetView = CyCore.networkViewFactory.createNetworkView(subnet);
//layout cluster
CyCore.dialogTaskManager.execute(
layout.createTaskIterator(
subnetView,
layout.getDefaultLayoutContext(),
CyLayoutAlgorithm.ALL_NODE_VIEWS,
null
)
);
StyleManager.style(subnetView,CyCore.visualMappingManager.getCurrentVisualStyle());
CyCore.networkViewManager.addNetworkView(subnetView);
clusterNode.setNetworkPointer(subnet);
//Set node attributes
metaGraph.getRow(clusterNode).set("name", LocalizationManager.get("cluster")+" "+c.getID());
metaGraph.getRow(clusterNode).set(StyleManager.CLUSTERSIZE_COLUMN_NAME,c.getSize());
map.put(c, clusterNode);
}
//Add edges (O(|C|^2*|V|^2) can maybe be improved? //TODO public ArrayList<YoshikoCluster> getCluster() {
for (YoshikoCluster c1:cluster) { return cluster;
for (YoshikoCluster c2:cluster) {
if (
metaGraph.containsEdge(map.get(c1),map.get(c2))
|| c1 == c2
) {
continue;
} }
for (CyNode c1n : c1.getSubNetwork().getNodeList()) {
for (CyNode c2n : c2.getSubNetwork().getNodeList()) {
if (originalGraph.containsEdge(c1n, c2n) || originalGraph.containsEdge(c2n, c1n)) {
if (!metaGraph.containsEdge(map.get(c1), map.get(c2))){
CyEdge edge = metaGraph.addEdge(map.get(c1), map.get(c2), false);
metaGraph.getRow(edge).set(StyleManager.EDGESTRENGTH_COLUMN_NAME,1);
}
else {
CyEdge edge = metaGraph.getConnectingEdgeList(map.get(c1), map.get(c2), Type.ANY).get(0);
metaGraph.getRow(edge).set(StyleManager.EDGESTRENGTH_COLUMN_NAME,
metaGraph.getRow(edge).get(StyleManager.EDGESTRENGTH_COLUMN_NAME, Integer.class)+1
);
}
}
}
}
}
}
CyNetworkView view = CyCore.networkViewFactory.createNetworkView(metaGraph);
//Layout and style solution
TaskIterator it = layout.createTaskIterator( public CyNetwork getOriginalGraph() {
view, return originalGraph;
layout.getDefaultLayoutContext(),
CyLayoutAlgorithm.ALL_NODE_VIEWS,
null
);
it.append(new Task() {
@Override
public void run(TaskMonitor taskMonitor) throws Exception {
StyleManager.styleWithMapping(view, CyCore.visualMappingManager.getCurrentVisualStyle());
} }
@Override /**
public void cancel() {} * @return the id
*/
}); public long getId() {
return id;
CyCore.dialogTaskManager.execute(
it
);
CyCore.networkManager.addNetwork(metaGraph);
CyCore.networkViewManager.addNetworkView(
view
);
view.updateView();
CyCore.cy.setCurrentNetworkView(view);
} }
} }
...@@ -48,8 +48,9 @@ public class ClusterView extends JPanel { ...@@ -48,8 +48,9 @@ public class ClusterView extends JPanel {
private final JLabel icon; private final JLabel icon;
private final BasicCollapsiblePanel nodeList; private final BasicCollapsiblePanel nodeList;
private final Border regularBorder = BorderFactory.createLineBorder(Color.GRAY,3); private final Border regularBorder = BorderFactory.createLineBorder(Color.GRAY,1);
private final Border highlightBorder = BorderFactory.createLineBorder(GraphicsLoader.yoshikoGreen,3); private final Border highlightBorder = BorderFactory.createLineBorder(GraphicsLoader.yoshikoGreen,3);
private final Border selectedBorder = BorderFactory.createLineBorder(Color.BLUE,3);
//SYMBOLIC LINKS //SYMBOLIC LINKS
...@@ -69,7 +70,7 @@ public class ClusterView extends JPanel { ...@@ -69,7 +70,7 @@ public class ClusterView extends JPanel {
clusterSize = new JLabel(LocalizationManager.get("clusterSize")+" "+c.getSize()); clusterSize = new JLabel(LocalizationManager.get("clusterSize")+" "+c.getSize());
icon = new JLabel(); icon = new JLabel();
icon.setBorder(BorderFactory.createLineBorder(Color.BLACK)); icon.setBorder(BorderFactory.createLineBorder(Color.BLACK));
cluster.generateImage(icon,128, 128); cluster.applyImage(icon,128, 128);
SwingUtil.addAll(this,title,clusterSize,icon); SwingUtil.addAll(this,title,clusterSize,icon);
this.add(Box.createVerticalStrut(4)); this.add(Box.createVerticalStrut(4));
......
...@@ -53,7 +53,6 @@ import org.cytoscape.util.swing.BasicCollapsiblePanel; ...@@ -53,7 +53,6 @@ import org.cytoscape.util.swing.BasicCollapsiblePanel;
import org.cytoscape.work.AbstractTask; import org.cytoscape.work.AbstractTask;
import org.cytoscape.work.TaskIterator; import org.cytoscape.work.TaskIterator;
import de.hhu.ba.yoshikoWrapper.core.AlgorithmTask;
import de.hhu.ba.yoshikoWrapper.core.CyCore; import de.hhu.ba.yoshikoWrapper.core.CyCore;
import de.hhu.ba.yoshikoWrapper.core.LocalizationManager; import de.hhu.ba.yoshikoWrapper.core.LocalizationManager;
import de.hhu.ba.yoshikoWrapper.core.ParameterSet; import de.hhu.ba.yoshikoWrapper.core.ParameterSet;
...@@ -63,6 +62,7 @@ import de.hhu.ba.yoshikoWrapper.swing.GraphicsLoader; ...@@ -63,6 +62,7 @@ import de.hhu.ba.yoshikoWrapper.swing.GraphicsLoader;
import de.hhu.ba.yoshikoWrapper.swing.LanguageSwitcherPanelFactory; import de.hhu.ba.yoshikoWrapper.swing.LanguageSwitcherPanelFactory;
import de.hhu.ba.yoshikoWrapper.swing.LibraryPanelFactory; import de.hhu.ba.yoshikoWrapper.swing.LibraryPanelFactory;
import de.hhu.ba.yoshikoWrapper.swing.SwingUtil; import de.hhu.ba.yoshikoWrapper.swing.SwingUtil;
import de.hhu.ba.yoshikoWrapper.tasks.AlgorithmTask;
/**This class describes the Swing Panel that the user interacts with in cytoscape /**This class describes the Swing Panel that the user interacts with in cytoscape
* *
......
...@@ -162,7 +162,7 @@ public class ResultPanel extends JPanel implements CytoPanelComponent{ ...@@ -162,7 +162,7 @@ public class ResultPanel extends JPanel implements CytoPanelComponent{
private void addSolutionTab(YoshikoSolution s) { private void addSolutionTab(YoshikoSolution s) {
SolutionTab tab = new SolutionTab(s); SolutionTab tab = new SolutionTab(s);
solutionTabs.add( solutionTabs.add(
LocalizationManager.get("solution")+" "+(s.id+1), LocalizationManager.get("solution")+" "+(s.getId()+1),
tab tab
); );
} }
......
...@@ -32,10 +32,14 @@ import javax.swing.JLabel; ...@@ -32,10 +32,14 @@ import javax.swing.JLabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import org.cytoscape.work.TaskIterator;
import de.hhu.ba.yoshikoWrapper.core.CyCore;
import de.hhu.ba.yoshikoWrapper.core.LocalizationManager; import de.hhu.ba.yoshikoWrapper.core.LocalizationManager;
import de.hhu.ba.yoshikoWrapper.graphModel.YoshikoCluster; import de.hhu.ba.yoshikoWrapper.graphModel.YoshikoCluster;
import de.hhu.ba.yoshikoWrapper.graphModel.YoshikoSolution; import de.hhu.ba.yoshikoWrapper.graphModel.YoshikoSolution;
import de.hhu.ba.yoshikoWrapper.swing.SwingUtil; import de.hhu.ba.yoshikoWrapper.swing.SwingUtil;
import de.hhu.ba.yoshikoWrapper.tasks.CreateMetaGraphTask;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class SolutionTab extends JPanel { public class SolutionTab extends JPanel {
...@@ -88,7 +92,11 @@ public class SolutionTab extends JPanel { ...@@ -88,7 +92,11 @@ public class SolutionTab extends JPanel {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
solution.exportMetaGraph(); CyCore.dialogTaskManager.execute(
new TaskIterator(1,
new CreateMetaGraphTask(solution)
)
);
} }
}); });
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * SOFTWARE.
******************************************************************************/ ******************************************************************************/
package de.hhu.ba.yoshikoWrapper.core; package de.hhu.ba.yoshikoWrapper.tasks;
import java.awt.Window; import java.awt.Window;
import java.util.Properties; import java.util.Properties;
...@@ -34,6 +34,11 @@ import org.cytoscape.work.AbstractTask; ...@@ -34,6 +34,11 @@ import org.cytoscape.work.AbstractTask;
import org.cytoscape.work.TaskMonitor; import org.cytoscape.work.TaskMonitor;
import org.slf4j.Logger; import org.slf4j.Logger;
import de.hhu.ba.yoshikoWrapper.core.CyCore;
import de.hhu.ba.yoshikoWrapper.core.LocalizationManager;
import de.hhu.ba.yoshikoWrapper.core.NetworkParser;
import de.hhu.ba.yoshikoWrapper.core.ParameterSet;
import de.hhu.ba.yoshikoWrapper.core.StatusInformer;
import de.hhu.ba.yoshikoWrapper.cytoUtil.NodeMap; import de.hhu.ba.yoshikoWrapper.cytoUtil.NodeMap;
import de.hhu.ba.yoshikoWrapper.graphModel.YoshikoCluster; import de.hhu.ba.yoshikoWrapper.graphModel.YoshikoCluster;
import de.hhu.ba.yoshikoWrapper.graphModel.YoshikoResult; import de.hhu.ba.yoshikoWrapper.graphModel.YoshikoResult;
...@@ -49,6 +54,7 @@ import de.hhu.ba.yoshikoWrapper.swing.components.ResultPanel; ...@@ -49,6 +54,7 @@ import de.hhu.ba.yoshikoWrapper.swing.components.ResultPanel;
public class AlgorithmTask extends AbstractTask { public class AlgorithmTask extends AbstractTask {
private String SOLUTION_COLUMN_PREFIX = "yoshikoSolution_";
//Symbolic links //Symbolic links
private static Logger logger = YoshikoLogger.getInstance().getLogger(); private static Logger logger = YoshikoLogger.getInstance().getLogger();
...@@ -137,20 +143,18 @@ public class AlgorithmTask extends AbstractTask { ...@@ -137,20 +143,18 @@ public class AlgorithmTask extends AbstractTask {
long numberOfSolutions = result.getNumberOfSolutions(); long numberOfSolutions = result.getNumberOfSolutions();
taskMonitor.setStatusMessage("Found: "+numberOfSolutions+" solutions!"); //TODO localize taskMonitor.setStatusMessage("Found: "+numberOfSolutions+" solutions!"); //TODO localize
YoshikoResult yoshikoResult = new YoshikoResult(); YoshikoResult yoshikoResult = new YoshikoResult();
yoshikoResult.flags = result.getFlags(); yoshikoResult.flags = result.getFlags();
System.out.print("ILP FLAG: "+yoshikoResult.flags.getIlpGenerated());
//Loop over (multiple) solutions //Loop over (multiple) solutions
for (long i=0;i<numberOfSolutions;i++) { for (long i=0;i<numberOfSolutions;i++) {
taskMonitor.setStatusMessage("Processing solution "+(i+1)+" of "+numberOfSolutions); taskMonitor.setStatusMessage("Processing solution "+(i+1)+" of "+numberOfSolutions);
YoshikoSolution solution = new YoshikoSolution(net); YoshikoSolution solution = new YoshikoSolution(net,i);
String columnName = "YOSHIKO_SOLUTION_"+(i+1); String columnName = SOLUTION_COLUMN_PREFIX+(i+1);
net.getDefaultNodeTable().deleteColumn(columnName); net.getDefaultNodeTable().deleteColumn(columnName);
net.getDefaultNodeTable().createColumn(columnName, String.class, false); net.getDefaultNodeTable().createColumn(columnName, String.class, false);
...@@ -170,16 +174,18 @@ public class AlgorithmTask extends AbstractTask { ...@@ -170,16 +174,18 @@ public class AlgorithmTask extends AbstractTask {
long sizeOfCluster = clusterVector.size(); long sizeOfCluster = clusterVector.size();
for (int l=0;l<sizeOfCluster;l++) { //Unsafe mismatch int long for (int l=0;l<sizeOfCluster;l++) { //Unsafe mismatch int long
taskMonitor.setStatusMessage("Processing entry "+(l+1)+ " of "+sizeOfCluster); taskMonitor.setStatusMessage("Processing node "+(l+1)+ " of "+sizeOfCluster);
int nodeID = clusterVector.get(l); int nodeID = clusterVector.get(l);
CyNode node = nodeMap.indexOf(nodeID); //<<< Another int/long conversion CyNode node = nodeMap.indexOf(nodeID); //<<< Another int/long conversion
cluster.addNode(node); cluster.addNode(node);
net.getRow(node).set(columnName, ""+(k+1)); //Add Cluster ID in table (Remove in final version?) net.getRow(node).set(columnName, ""+(k+1)); //Add Cluster ID in table (Remove in final version?)
} }
cluster.getSubNetwork(); cluster.createSubNetwork();
//Register cluster with solution for further reference
solution.cluster.add(cluster); solution.cluster.add(cluster);
} }
//Register solution with result for further reference
yoshikoResult.solutions.add(solution); yoshikoResult.solutions.add(solution);
} }
......
package de.hhu.ba.yoshikoWrapper.tasks;
import java.util.HashMap;
import org.cytoscape.model.CyEdge;
import org.cytoscape.model.CyNetwork;
import org.cytoscape.model.CyNode;
import org.cytoscape.model.CyEdge.Type;
import org.cytoscape.model.subnetwork.CySubNetwork;
import org.cytoscape.view.layout.CyLayoutAlgorithm;
import org.cytoscape.view.model.CyNetworkView;
import org.cytoscape.work.AbstractTask;
import org.cytoscape.work.Task;
import org.cytoscape.work.TaskIterator;
import org.cytoscape.work.TaskMonitor;
import de.hhu.ba.yoshikoWrapper.core.CyCore;
import de.hhu.ba.yoshikoWrapper.core.LocalizationManager;
import de.hhu.ba.yoshikoWrapper.cytoUtil.StyleManager;
import de.hhu.ba.yoshikoWrapper.graphModel.YoshikoCluster;
import de.hhu.ba.yoshikoWrapper.graphModel.YoshikoSolution;
public class CreateMetaGraphTask extends AbstractTask {
private final YoshikoSolution solution;
public CreateMetaGraphTask(YoshikoSolution s) {
this.solution = s;
}
@Override
public void run(TaskMonitor taskMonitor) throws Exception {
CyNetwork metaGraph = CyCore.networkFactory.createNetwork();
metaGraph.getRow(metaGraph).set(CyNetwork.NAME, LocalizationManager.get("metaGraph"));
metaGraph.getDefaultNodeTable().createColumn("clusterSize", Integer.class, false);
metaGraph.getDefaultEdgeTable().createColumn("edgeStrength", Integer.class, false);
CyLayoutAlgorithm layout = CyCore.layoutAlgorithmManager.getDefaultLayout();
//Map Cluster to Nodes for further reference
HashMap<YoshikoCluster,CyNode> map = new HashMap<YoshikoCluster,CyNode>();
//Add nodes
for (YoshikoCluster c: solution.getCluster()) {
CyNode clusterNode = metaGraph.addNode();
CySubNetwork subnet = c.getSubNetwork();
CyCore.networkManager.addNetwork(subnet);
//Create network view and register it
CyNetworkView subnetView = CyCore.networkViewFactory.createNetworkView(subnet);
//layout cluster
CyCore.dialogTaskManager.execute(
layout.createTaskIterator(
subnetView,
layout.getDefaultLayoutContext(),
CyLayoutAlgorithm.ALL_NODE_VIEWS,
null
)
);
StyleManager.style(subnetView,CyCore.visualMappingManager.getCurrentVisualStyle());
CyCore.networkViewManager.addNetworkView(subnetView);
clusterNode.setNetworkPointer(subnet);
//Set node attributes
metaGraph.getRow(clusterNode).set("name", LocalizationManager.get("cluster")+" "+c.getID());
metaGraph.getRow(clusterNode).set(StyleManager.CLUSTERSIZE_COLUMN_NAME,c.getSize());
map.put(c, clusterNode);
}
//Add edges (O(|C|^2*|V|^2) can maybe be improved? //TODO
for (YoshikoCluster c1:solution.getCluster()) {
for (YoshikoCluster c2:solution.getCluster()) {
if (
metaGraph.containsEdge(map.get(c1),map.get(c2))
|| c1 == c2
) {
continue;
}
for (CyNode c1n : c1.getSubNetwork().getNodeList()) {
for (CyNode c2n : c2.getSubNetwork().getNodeList()) {
if (solution.getOriginalGraph().containsEdge(c1n, c2n) || solution.getOriginalGraph().containsEdge(c2n, c1n)) {
if (!metaGraph.containsEdge(map.get(c1), map.get(c2))){
CyEdge edge = metaGraph.addEdge(map.get(c1), map.get(c2), false);
metaGraph.getRow(edge).set(StyleManager.EDGESTRENGTH_COLUMN_NAME,1);
}
else {
CyEdge edge = metaGraph.getConnectingEdgeList(map.get(c1), map.get(c2), Type.ANY).get(0);
metaGraph.getRow(edge).set(StyleManager.EDGESTRENGTH_COLUMN_NAME,
metaGraph.getRow(edge).get(StyleManager.EDGESTRENGTH_COLUMN_NAME, Integer.class)+1
);
}
}
}
}
}
}
CyNetworkView view = CyCore.networkViewFactory.createNetworkView(metaGraph);
//Layout and style solution
TaskIterator it = layout.createTaskIterator(
view,
layout.getDefaultLayoutContext(),
CyLayoutAlgorithm.ALL_NODE_VIEWS,
null
);
it.append(new Task() {
@Override
public void run(TaskMonitor taskMonitor) throws Exception {
StyleManager.styleWithMapping(view, CyCore.visualMappingManager.getCurrentVisualStyle());
}
@Override
public void cancel() {}
});
CyCore.dialogTaskManager.execute(
it
);
CyCore.networkManager.addNetwork(metaGraph);
CyCore.networkViewManager.addNetworkView(
view
);
view.updateView();
CyCore.cy.setCurrentNetworkView(view);
}
}
/**
*
*/
/**
* @author Philipp Spohr, Sep 14, 2017
*
*/
package de.hhu.ba.yoshikoWrapper.tasks;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment