newTriangle.addToObjects(objects);
clearAndHide();
step.setOutputs(new Object[]
{newTriangle.getSides()[0], newTriangle.getSides()[1],
newTriangle.getSides()[2], newTriangle});
fireUndoableEditUpdate(new UndoableEditEvent(this, step));
}
else {
JOptionPane.showMessageDialog(this, "Please select three distinct"+
" non-collinear points", "Try Again", JOptionPane.ERROR_MESSAGE);
initDialog();
}
}
else if (step.getConstructionType() == POINT_LINE) {
Point P1 = (Point)step.getInputs()[0];
Line L1 = (Line)step.getInputs()[1];
if (!(P1.canIntersect(L1))) {
Triangle newTriangle = new Triangle(P1, L1);
newTriangle.addToObjects(objects);
clearAndHide();
step.setOutputs(new Object[]
{newTriangle.getSides()[1], newTriangle.getSides()[2], newTriangle});
fireUndoableEditUpdate(new UndoableEditEvent(this, step));
}
else {
JOptionPane.showMessageDialog(this, "Please select a point that does "+
"not lie on the line", "Try Again", JOptionPane.ERROR_MESSAGE);
initDialog();