/** * Shows the given Bayesian network in the viewer * * @param state the Bayesian Network to display */ public synchronized void showBayesianNetwork(DialogueState state) { currentState = state; if (!isUpdating) { new Thread( () -> { isUpdating = true; if (tab.getMainFrame().getSystem().isPaused()) { update(); } else { synchronized (currentState) { update(); } } isUpdating = false; }) .start(); } }
/** Updates the viewer with the current state. */ private void update() { Layout<String, Integer> layout = getGraphLayout(currentState, tab.showParameters()); setGraphLayout(layout); updateDistribs(); }