continuousNodeNameList.add(n.getName());
}
}
// Create the distribution pane
final ContinuousNormalDistributionPane distributionPane = new ContinuousNormalDistributionPane(discreteNodeNameList, continuousNodeNameList);
screen.setDistributionPane(distributionPane);
screen.setTableOwner(node);
// Fill discrete parent node states
for (Node n : discreteNodeList) {
List<String> stateList = new ArrayList<String>(n.getStatesSize());
for (int i = 0; i < n.getStatesSize(); i++) {
stateList.add(n.getStateAt(i));
}
distributionPane.fillDiscreteParentStateSelection(n.getName(), stateList);
}
loadContinuousDistributionPaneValues(distributionPane, node.getCnNormalDistribution());
// Create the confirm action listener. Responsible for setting the distribution values.
ActionListener confirmAL = new ActionListener() {
public void actionPerformed(ActionEvent ae) {
setContinuousDistributionValues(distributionPane, node.getCnNormalDistribution());
}
};
// Responsible for loading the values from the normal distribution into the distribution pane.
// Used in cancel and in parent state change listeners.
ActionListener restoreValuesFromDistributionAL = new ActionListener() {
public void actionPerformed(ActionEvent ae) {
loadContinuousDistributionPaneValues(distributionPane, node.getCnNormalDistribution());
}
};
distributionPane.addConfirmButtonActionListener(confirmAL);
distributionPane.addCancelButtonActionListener(restoreValuesFromDistributionAL);
distributionPane.addParentStateChangeActionListener(restoreValuesFromDistributionAL);
// moved into #setDistributionPane(JPanel)
// screen.setAddRemoveStateButtonVisible(false);
}