JButton dominateButton = new JButton();
dominateButton.setText("dominates");
dominateButton.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e) {
State s1 = firstComparePathStates.getSelectedValue();
State s2 = secondComparePathStates.getSelectedValue();
System.out.println("s1 dominates s2:"+MultiShortestPathTree.dominates(s1,s2));
System.out.println("s2 dominates s1:"+MultiShortestPathTree.dominates(s2,s1));
}
});
pane.add(dominateButton);
// A button that executes the 'traverse' function leading to the last clicked state
// in either window. Also only useful if you set a breakpoint.
JButton traverseButton = new JButton();
traverseButton.setText("traverse");
traverseButton.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e) {
if(lastStateClicked==null){
return;
}
Edge backEdge = lastStateClicked.getBackEdge();
State backState = lastStateClicked.getBackState();
backEdge.traverse(backState);
}
});
pane.add(traverseButton);