pipeRun.addChild(newComponent);
- if (newComponent instanceof InlineComponent && ((InlineComponent)newComponent).isVariableLength() ||((InlineComponent)newComponent).isModifialble()) {
- newPcp.setLength(inst.length);
- newComponent.setParameter("length", inst.length);
- } else if (newComponent instanceof TurnComponent && ((TurnComponent)newComponent).isVariableAngle()) {
- newPcp.setTurnAngle(inst.angle);
- newComponent.setParameter("turnAngle", inst.angle);
+ if (newComponent instanceof InlineComponent) {
+ InlineComponent inlineComponent = (InlineComponent)newComponent;
+ if (inlineComponent.isVariableLength()|| inlineComponent.isModifialble()) {
+ newPcp.setLength(inst.length);
+ newComponent.setParameter("length", inst.length);
+ }
+ } else if (newComponent instanceof TurnComponent) {
+ TurnComponent turnComponent = (TurnComponent)newComponent;
+ if (turnComponent.isVariableAngle()) {
+ newPcp.setTurnAngle(inst.angle);
+ newComponent.setParameter("turnAngle", inst.angle);
+ }
}
newComponent.updateParameters();