use of edu.cmu.tetradapp.workbench.GraphWorkbench in project tetrad by cmu-phil.
the class BayesUpdaterEditor method createWorkbenchScroll.
private JScrollPane createWorkbenchScroll(UpdaterWrapper updaterWrapper) {
workbench = new GraphWorkbench(updaterWrapper.getBayesUpdater().getManipulatedGraph());
workbench.setAllowDoubleClickActions(false);
JScrollPane workbenchScroll = new JScrollPane(getWorkbench());
workbenchScroll.setPreferredSize(new Dimension(400, 400));
return workbenchScroll;
}
use of edu.cmu.tetradapp.workbench.GraphWorkbench in project tetrad by cmu-phil.
the class BayesUpdaterEditorObs method createWorkbenchScroll.
private JScrollPane createWorkbenchScroll(UpdaterWrapper updaterWrapper) {
workbench = new GraphWorkbench(updaterWrapper.getBayesUpdater().getManipulatedGraph());
workbench.setAllowDoubleClickActions(false);
JScrollPane workbenchScroll = new JScrollPane(getWorkbench());
workbenchScroll.setPreferredSize(new Dimension(400, 400));
return workbenchScroll;
}
use of edu.cmu.tetradapp.workbench.GraphWorkbench in project tetrad by cmu-phil.
the class BayesImEditorObs method init.
private void init(BayesIm bayesIm) {
if (bayesIm == null) {
throw new NullPointerException("Bayes IM must not be null.");
}
BayesPm bayesPm = bayesIm.getBayesPm();
Graph graph = bayesPm.getDag();
GraphWorkbench workbench = new GraphWorkbench(graph);
JMenuBar menuBar = new JMenuBar();
JMenu file = new JMenu("File");
menuBar.add(file);
// file.add(new SaveBayesImXmlAction(this));
// file.add(new LoadBayesImXmlAction(wrapper, this));
file.add(new SaveScreenshot(this, true, "Save Screenshot..."));
file.add(new SaveComponentImage(workbench, "Save Graph Image..."));
setLayout(new BorderLayout());
add(menuBar, BorderLayout.NORTH);
wizard = new BayesImEditorWizardObs(bayesIm, workbench);
wizard.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
if ("editorValueChanged".equals(evt.getPropertyName())) {
firePropertyChange("modelChanged", null, null);
}
}
});
JScrollPane workbenchScroll = new JScrollPane(workbench);
JScrollPane wizardScroll = new JScrollPane(getWizard());
workbenchScroll.setPreferredSize(new Dimension(450, 450));
JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, workbenchScroll, wizardScroll);
splitPane.setOneTouchExpandable(true);
splitPane.setDividerLocation(workbenchScroll.getPreferredSize().width);
add(splitPane, BorderLayout.CENTER);
setName("Bayes IM Obs Editor");
getWizard().addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
if ("editorClosing".equals(evt.getPropertyName())) {
firePropertyChange("editorClosing", null, getName());
}
if ("closeFrame".equals(evt.getPropertyName())) {
firePropertyChange("closeFrame", null, null);
firePropertyChange("editorClosing", true, true);
}
if ("modelChanged".equals(evt.getPropertyName())) {
firePropertyChange("modelChanged", evt.getOldValue(), evt.getNewValue());
}
}
});
}
Aggregations