use of edu.cmu.tetradapp.workbench.GraphWorkbench in project tetrad by cmu-phil.
the class IonSearchEditor method layoutByKnowledge.
public void layoutByKnowledge() {
GraphWorkbench resultWorkbench = getWorkbench();
Graph graph = resultWorkbench.getGraph();
IKnowledge knowledge = (IKnowledge) getAlgorithmRunner().getParams().get("knowledge", new Knowledge2());
SearchGraphUtils.arrangeByKnowledgeTiers(graph, knowledge);
// resultWorkbench.setGraph(graph);
}
use of edu.cmu.tetradapp.workbench.GraphWorkbench in project tetrad by cmu-phil.
the class LingamSearchEditor method layoutByKnowledge.
public void layoutByKnowledge() {
GraphWorkbench resultWorkbench = getWorkbench();
Graph graph = resultWorkbench.getGraph();
IKnowledge knowledge = (IKnowledge) getAlgorithmRunner().getParams().get("knowledge", new Knowledge2());
SearchGraphUtils.arrangeByKnowledgeTiers(graph, knowledge);
// resultWorkbench.setGraph(graph);
}
use of edu.cmu.tetradapp.workbench.GraphWorkbench in project tetrad by cmu-phil.
the class MbSearchEditor method layoutByKnowledge.
public void layoutByKnowledge() {
GraphWorkbench resultWorkbench = getWorkbench();
Graph graph = resultWorkbench.getGraph();
IKnowledge knowledge = (IKnowledge) getAlgorithmRunner().getParams().get("knowledge", new Knowledge2());
SearchGraphUtils.arrangeByKnowledgeTiers(graph, knowledge);
// resultWorkbench.setGraph(graph);
}
use of edu.cmu.tetradapp.workbench.GraphWorkbench in project tetrad by cmu-phil.
the class MimbuildEditor method workbenchScroll.
private JScrollPane workbenchScroll(String resultLabel) {
Graph resultGraph = resultGraph();
Graph sourceGraph = getMimRunner().getSourceGraph();
Graph latestWorkbenchGraph = (Graph) getMimRunner().getParams().get("sourceGraph", null);
boolean arrangedAll = GraphUtils.arrangeBySourceGraph(resultGraph, latestWorkbenchGraph);
if (!arrangedAll) {
GraphUtils.arrangeBySourceGraph(resultGraph, sourceGraph);
}
this.workbench = new GraphWorkbench(resultGraph);
this.workbench.setAllowDoubleClickActions(false);
this.workbenchScroll = new JScrollPane(getWorkbench());
getWorkbenchScroll().setPreferredSize(new Dimension(450, 450));
getWorkbenchScroll().setBorder(new TitledBorder(resultLabel));
this.workbench.addMouseListener(new MouseAdapter() {
public void mouseExited(MouseEvent e) {
storeLatestWorkbenchGraph();
}
});
return getWorkbenchScroll();
}
use of edu.cmu.tetradapp.workbench.GraphWorkbench in project tetrad by cmu-phil.
the class MimbuildEditor method updateDisplayPanel.
private void updateDisplayPanel() {
displayPanel.removeAll();
JTabbedPane tabbedPane = new JTabbedPane();
if (getMimRunner().getStructureGraph() != null) {
if (getMimRunner().getStructureGraph() != null) {
// DataGraphUtils.circleLayout(structureGraph, 200, 200, 150);
Graph structureGraph = getMimRunner().getStructureGraph();
doDefaultArrangement(structureGraph);
GraphWorkbench structureWorkbench = new GraphWorkbench(structureGraph);
structureWorkbench.setAllowDoubleClickActions(false);
tabbedPane.add("Structure Model", new JScrollPane(structureWorkbench));
}
} else {
tabbedPane.add("Structure Model", new JScrollPane(new GraphWorkbench()));
}
if (getMimRunner().getClusters() != null) {
ClusterEditor editor = new ClusterEditor(getMimRunner().getClusters(), getMimRunner().getData().getVariableNames());
tabbedPane.add("Measurement Model", editor);
}
if (getMimRunner().getFullGraph() != null) {
Graph fullGraph = getMimRunner().getFullGraph();
doDefaultArrangement(fullGraph);
GraphUtils.fruchtermanReingoldLayout(fullGraph);
GraphWorkbench fullGraphBench = new GraphWorkbench(fullGraph);
tabbedPane.add("Full Graph", new JScrollPane(fullGraphBench));
} else {
tabbedPane.add("Full Graph", new JScrollPane(new GraphWorkbench()));
}
displayPanel.add(tabbedPane, BorderLayout.CENTER);
displayPanel.revalidate();
displayPanel.repaint();
}
Aggregations