Search in sources :

Example 16 with GraphNode

use of edu.cmu.tetrad.graph.GraphNode in project tetrad by cmu-phil.

the class LingDisplay method pasteSubsession.

public void pasteSubsession(List sessionElements, Point upperLeft) {
    getWorkbench().pasteSubgraph(sessionElements, upperLeft);
    getWorkbench().deselectAll();
    for (int i = 0; i < sessionElements.size(); i++) {
        Object o = sessionElements.get(i);
        if (o instanceof GraphNode) {
            Node modelNode = (Node) o;
            getWorkbench().selectNode(modelNode);
        }
    }
    getWorkbench().selectConnectingEdges();
}
Also used : GraphNode(edu.cmu.tetrad.graph.GraphNode) Node(edu.cmu.tetrad.graph.Node) DisplayNode(edu.cmu.tetradapp.workbench.DisplayNode) GraphNode(edu.cmu.tetrad.graph.GraphNode)

Example 17 with GraphNode

use of edu.cmu.tetrad.graph.GraphNode in project tetrad by cmu-phil.

the class PatternDisplay method pasteSubsession.

public void pasteSubsession(List sessionElements, Point upperLeft) {
    getWorkbench().pasteSubgraph(sessionElements, upperLeft);
    getWorkbench().deselectAll();
    for (int i = 0; i < sessionElements.size(); i++) {
        Object o = sessionElements.get(i);
        if (o instanceof GraphNode) {
            Node modelNode = (Node) o;
            getWorkbench().selectNode(modelNode);
        }
    }
    getWorkbench().selectConnectingEdges();
}
Also used : GraphNode(edu.cmu.tetrad.graph.GraphNode) Node(edu.cmu.tetrad.graph.Node) DisplayNode(edu.cmu.tetradapp.workbench.DisplayNode) GraphNode(edu.cmu.tetrad.graph.GraphNode)

Example 18 with GraphNode

use of edu.cmu.tetrad.graph.GraphNode in project tetrad by cmu-phil.

the class GraphSelectionEditor method pasteSubsession.

@Override
public void pasteSubsession(List sessionElements, Point upperLeft) {
    getWorkbench().pasteSubgraph(sessionElements, upperLeft);
    getWorkbench().deselectAll();
    for (Object o : sessionElements) {
        if (o instanceof GraphNode) {
            Node modelNode = (Node) o;
            getWorkbench().selectNode(modelNode);
        }
    }
    getWorkbench().selectConnectingEdges();
}
Also used : Node(edu.cmu.tetrad.graph.Node) GraphNode(edu.cmu.tetrad.graph.GraphNode) DisplayNode(edu.cmu.tetradapp.workbench.DisplayNode) GraphNode(edu.cmu.tetrad.graph.GraphNode)

Example 19 with GraphNode

use of edu.cmu.tetrad.graph.GraphNode in project tetrad by cmu-phil.

the class IonDisplay method pasteSubsession.

public void pasteSubsession(List sessionElements, Point upperLeft) {
    getWorkbench().pasteSubgraph(sessionElements, upperLeft);
    getWorkbench().deselectAll();
    for (int i = 0; i < sessionElements.size(); i++) {
        Object o = sessionElements.get(i);
        if (o instanceof GraphNode) {
            Node modelNode = (Node) o;
            getWorkbench().selectNode(modelNode);
        }
    }
    getWorkbench().selectConnectingEdges();
}
Also used : GraphNode(edu.cmu.tetrad.graph.GraphNode) Node(edu.cmu.tetrad.graph.Node) DisplayNode(edu.cmu.tetradapp.workbench.DisplayNode) GraphNode(edu.cmu.tetrad.graph.GraphNode)

Example 20 with GraphNode

use of edu.cmu.tetrad.graph.GraphNode in project tetrad by cmu-phil.

the class JsonUtils method parseJSONObjectToTetradNode.

public static Node parseJSONObjectToTetradNode(JSONObject jObj) {
    JSONObject nodeType = jObj.getJSONObject("nodeType");
    int ordinal = nodeType.getInt("ordinal");
    int centerX = jObj.getInt("centerX");
    int centerY = jObj.getInt("centerY");
    String name = jObj.getString("name");
    GraphNode graphNode = new GraphNode(name);
    graphNode.setNodeType(NodeType.TYPES[ordinal]);
    graphNode.setCenter(centerX, centerY);
    return graphNode;
}
Also used : JSONObject(org.json.JSONObject) GraphNode(edu.cmu.tetrad.graph.GraphNode) Endpoint(edu.cmu.tetrad.graph.Endpoint)

Aggregations

GraphNode (edu.cmu.tetrad.graph.GraphNode)41 Node (edu.cmu.tetrad.graph.Node)37 Dag (edu.cmu.tetrad.graph.Dag)20 Test (org.junit.Test)11 EdgeListGraph (edu.cmu.tetrad.graph.EdgeListGraph)7 Graph (edu.cmu.tetrad.graph.Graph)7 DisplayNode (edu.cmu.tetradapp.workbench.DisplayNode)6 BayesIm (edu.cmu.tetrad.bayes.BayesIm)3 BayesPm (edu.cmu.tetrad.bayes.BayesPm)3 MlBayesIm (edu.cmu.tetrad.bayes.MlBayesIm)3 IndependenceFact (edu.cmu.tetrad.graph.IndependenceFact)3 ArrayList (java.util.ArrayList)3 FruchtermanReingoldLayout (edu.cmu.tetrad.graph.FruchtermanReingoldLayout)2 DiscreteVariable (edu.cmu.tetrad.data.DiscreteVariable)1 IndependenceFacts (edu.cmu.tetrad.data.IndependenceFacts)1 Endpoint (edu.cmu.tetrad.graph.Endpoint)1 SemGraph (edu.cmu.tetrad.graph.SemGraph)1 TimeLagGraph (edu.cmu.tetrad.graph.TimeLagGraph)1 IndependenceFactsModel (edu.cmu.tetradapp.model.IndependenceFactsModel)1 BufferedReader (java.io.BufferedReader)1