originNodeFullName.append(tempOrigin.getNode().getName() + ".");
tempOrigin = ((OriginWrapper) tempOrigin).getWrappedOrigin();
}
StringBuilder terminationNodeFullName = new StringBuilder();
Termination tempTermination = myTermination;
while(tempTermination instanceof TerminationWrapper)
{
terminationNodeFullName.append(tempTermination.getNode().getName() + ".");
tempTermination = ((TerminationWrapper) tempTermination).getWrappedTermination();
}
DecodedTermination dTermination;
StringBuilder transformString = new StringBuilder();
transformString.append('[');
if(tempTermination instanceof DecodedTermination)
{
dTermination = (DecodedTermination) tempTermination;
transformString.append(getTransformScript(dTermination, "transform = ".length()));
terminationNodeFullName.append(tempTermination.getNode().getName());
}
else if(tempTermination instanceof EnsembleTermination &&
tempTermination.getNode() instanceof NetworkArrayImpl)
{
terminationNodeFullName.deleteCharAt(terminationNodeFullName.length()-1);
boolean first = true;
for(Node node : tempTermination.getNode().getChildren())
{
if(first)
{
first = false;
}else {
transformString.append(",\n" + new String(new char["transform = ".length() + 1]).replace("\0", " "));
}
// this relies on the decoded terminations in the child nodes having the
// same name as the ensemble termination that contains them
try{
dTermination = (DecodedTermination) node.getTermination(tempTermination.getName());
}catch(Exception e){
dTermination = null;
}
transformString.append(getTransformScript(dTermination, "transform = ".length() + 1));