Search in sources :

Example 31 with GraphWorkbench

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);
}
Also used : IKnowledge(edu.cmu.tetrad.data.IKnowledge) GraphWorkbench(edu.cmu.tetradapp.workbench.GraphWorkbench) Knowledge2(edu.cmu.tetrad.data.Knowledge2)

Example 32 with GraphWorkbench

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);
}
Also used : IKnowledge(edu.cmu.tetrad.data.IKnowledge) Graph(edu.cmu.tetrad.graph.Graph) GraphWorkbench(edu.cmu.tetradapp.workbench.GraphWorkbench) Knowledge2(edu.cmu.tetrad.data.Knowledge2)

Example 33 with GraphWorkbench

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);
}
Also used : IKnowledge(edu.cmu.tetrad.data.IKnowledge) Graph(edu.cmu.tetrad.graph.Graph) GraphWorkbench(edu.cmu.tetradapp.workbench.GraphWorkbench) Knowledge2(edu.cmu.tetrad.data.Knowledge2)

Example 34 with GraphWorkbench

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();
}
Also used : EdgeListGraph(edu.cmu.tetrad.graph.EdgeListGraph) Graph(edu.cmu.tetrad.graph.Graph) GraphWorkbench(edu.cmu.tetradapp.workbench.GraphWorkbench) TitledBorder(javax.swing.border.TitledBorder)

Example 35 with GraphWorkbench

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();
}
Also used : EdgeListGraph(edu.cmu.tetrad.graph.EdgeListGraph) Graph(edu.cmu.tetrad.graph.Graph) GraphWorkbench(edu.cmu.tetradapp.workbench.GraphWorkbench)

Aggregations

GraphWorkbench (edu.cmu.tetradapp.workbench.GraphWorkbench)53 Graph (edu.cmu.tetrad.graph.Graph)24 EdgeListGraph (edu.cmu.tetrad.graph.EdgeListGraph)13 ActionEvent (java.awt.event.ActionEvent)11 ActionListener (java.awt.event.ActionListener)11 IKnowledge (edu.cmu.tetrad.data.IKnowledge)8 Knowledge2 (edu.cmu.tetrad.data.Knowledge2)8 WatchedProcess (edu.cmu.tetradapp.util.WatchedProcess)8 LayoutMenu (edu.cmu.tetradapp.workbench.LayoutMenu)7 MouseAdapter (java.awt.event.MouseAdapter)7 MouseEvent (java.awt.event.MouseEvent)7 PropertyChangeEvent (java.beans.PropertyChangeEvent)6 PropertyChangeListener (java.beans.PropertyChangeListener)6 TitledBorder (javax.swing.border.TitledBorder)6 DataModel (edu.cmu.tetrad.data.DataModel)4 PatternToDag (edu.cmu.tetrad.search.PatternToDag)3 CSH (javax.help.CSH)3 HelpBroker (javax.help.HelpBroker)3 EmptyBorder (javax.swing.border.EmptyBorder)3 MatteBorder (javax.swing.border.MatteBorder)3