Object obj1 = step.getInputs()[1];
Object obj2 = step.getInputs()[2];
boolean lengthReference = (obj1 instanceof GeometricalObject);
boolean slopeReference = (obj2 instanceof GeometricalObject);
double length;
Angle slope;
if (lengthReference) {
if (step.getInputs()[1] instanceof Line)
length = ((Line)obj1).getLength();
else
length = ((Circle)obj1).getRadius();
}
else {
length = ((Double)obj1).doubleValue();
if (!(Math.abs(length) > 0)) {
JOptionPane.showMessageDialog(this, "Please enter non-zero value for Length",
"Try Again", JOptionPane.ERROR_MESSAGE);
initDialog();
}
}
if (slopeReference)
slope = new Angle(((Line)obj2).getSlope().getAngle());
else {
double slopeDegrees = ((Double)obj2).doubleValue();
slope = new Angle(Math.toRadians(slopeDegrees));
}
Line newLine = new Line(p, slope, length);
newLine.addToObjects(objects);
if (lengthReference)
if (obj1 instanceof Line) {