}
String fixedLink = (String)cFixedLink.getSelectedItem();
int fixed = Integer.parseInt(fixedLink.substring(fixedLink.length()-1));
int direction = (rbClockwise.isSelected())?(-1):(1);
boolean elbowUp = cbElbowUp.isSelected();
FourBarMechanism newMechanism = new FourBarMechanism(linkLengths[0],
linkLengths[1], linkLengths[2], linkLengths[3]);
if (!newMechanism.isMechanism()) {
JOptionPane.showMessageDialog(this, "This is not a valid mechanism.\n"
+ "Please check link lengths", "Try Again", JOptionPane.ERROR_MESSAGE);
return;
}
mechanism.setFixed(1);