// } else if (gaussianMixtureAlgorithm.isSelected()) {
// controller.setInferenceAlgorithm(InferenceAlgorithmEnum.GAUSSIAN_MIXTURE);
// }
// commit changes (made at each option panel) on inference algorithm
InferenceAlgorithmOptionPanel currentPanel = getSelectedAlgorithmOptionPanel();
if (currentPanel != null) {
currentPanel.commitChanges();
// updating the inference algorithm referenced by controller
controller.setInferenceAlgorithm(currentPanel.getInferenceAlgorithm());
}
setVisible(false);
dispose();
graph.update();
}
});
restore = new JButton(resource.getString("resetLabel"));
restore.setToolTipText(resource.getString("resetToolTip"));
confirmationPanel.add(restore);
restore.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
probabilisticDescriptionNodeColor = ProbabilisticNode.getDescriptionColor();
probabilisticExplanationNodeColor = ProbabilisticNode.getExplanationColor();
//by young
/*
decisionNodeColor = DecisionNode.getColor();
utilityNodeColor = UtilityNode.getColor();
edgeColor = Edge.getColor();
selectionColor = GraphPane.getSelectionColor();
backgroundColor = graph.getBackgroundColor();
netSlider.setValue((int) graph.getGraphDimension().getWidth());
radiusSlider.setValue((int)Node.getWidth()/2);
*/
//by young end
// reverting changes on algorithm plugins
InferenceAlgorithmOptionPanel selectedAlgorithmOptionPanel = getSelectedAlgorithmOptionPanel();
if (selectedAlgorithmOptionPanel != null) {
selectedAlgorithmOptionPanel.revertChanges();
}
controller.getSingleEntityNetwork().setCreateLog(createLogBoolean);
repaint();
}
});
cancel = new JButton(resource.getString("cancelLabel"));
cancel.setToolTipText(resource.getString("cancelToolTip"));
confirmationPanel.add(cancel);
cancel.addActionListener(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
// reverting changes on algorithm plugins
InferenceAlgorithmOptionPanel selectedAlgorithmOptionPanel = getSelectedAlgorithmOptionPanel();
if (selectedAlgorithmOptionPanel != null) {
selectedAlgorithmOptionPanel.revertChanges();
}
setVisible(false);
dispose();
graph.update();