use of edu.cmu.tetradapp.workbench.DisplayNode in project tetrad by cmu-phil.
the class GraphSelectionEditor method resetWorkbenches.
private JButton resetWorkbenches(final GraphSelectionWrapper wrapper) {
final JButton executeButton = new JButton("Graph It!");
executeButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Window owner = (Window) getTopLevelAncestor();
new WatchedProcess(owner) {
public void watch() {
GraphWorkbench workbench = getWorkbench();
List<DisplayNode> displayNodes = workbench.getSelectedNodes();
List<Node> newSelected = new ArrayList<>();
for (DisplayNode node : displayNodes) {
newSelected.add(node.getModelNode());
}
if (!newSelected.isEmpty()) {
editorPanel.setSelected(newSelected);
}
resetGraphs(wrapper);
}
};
}
});
forWorkbenchScrolls.validate();
return executeButton;
}
use of edu.cmu.tetradapp.workbench.DisplayNode in project tetrad by cmu-phil.
the class SessionEditorWorkbench method getNewDisplayEdge.
/**
* @return a new SessionEditorEdge for the given given edge (cast as
* indicated).
*/
public IDisplayEdge getNewDisplayEdge(Edge modelEdge) {
Node modelNodeA = modelEdge.getNode1();
Node modelNodeB = modelEdge.getNode2();
DisplayNode displayNodeA = (DisplayNode) (getModelNodesToDisplay().get(modelNodeA));
DisplayNode displayNodeB = (DisplayNode) (getModelNodesToDisplay().get(modelNodeB));
if ((displayNodeA == null) || (displayNodeB == null)) {
return null;
}
SessionEditorNode sessionEditorNodeA = (SessionEditorNode) displayNodeA;
SessionEditorNode sessionEditorNodeB = (SessionEditorNode) displayNodeB;
return new SessionEditorEdge(sessionEditorNodeA, sessionEditorNodeB, SessionEditorEdge.UNRANDOMIZED);
}
Aggregations