ParameterContext[] variableBindings = subProcessAct.getVariableBindings();
for(int i=0; i<variableBindings.length; i++){
if(wannaBeLinked==variableBindings[i].getVariable()){
ArrowLinkingInfo arrowLinkingInfo = new ArrowLinkingInfo();
Point linkPoint;
if(collapsed){
linkPoint = new Point(i * getWidth()/variableBindings.length, getHeight());
}else{
ProcessVariable boundSubProcessVariable = subProcDef.getProcessVariable(variableBindings[i].getArgument().getText());
JLabel labelForBoundSubProcessVariable = subProcessDesignerComponent.processVariableInformationPanel.getJLabel(boundSubProcessVariable);
if(labelForBoundSubProcessVariable==null) continue;
linkPoint = UEngineUtil.getRelativeLocation(this, labelForBoundSubProcessVariable);
}
arrowLinkingInfo.setLinkPoint(linkPoint);
if(variableBindings[i].getDirection()!=null && variableBindings[i].getDirection().equals(ParameterContext.DIRECTION_IN))
arrowLinkingInfo.setTarget(true);
else
if(variableBindings[i].getDirection()!=null && variableBindings[i].getDirection().equals(ParameterContext.DIRECTION_OUT)){
arrowLinkingInfo.setSource(true);
}else{
arrowLinkingInfo.setTarget(true);
arrowLinkingInfo.setSource(true);
}
arrowLinkList.add(arrowLinkingInfo);
}
}
}
if(forWhat instanceof Role && subProcessAct.getRoleBindings()!=null && subProcessAct.getRoleBindings().length > 0){
Role wannaBeLinked = (Role)forWhat;
RoleParameterContext[] roleBindings = subProcessAct.getRoleBindings();
for(int i=0; i<roleBindings.length; i++){
if(wannaBeLinked==roleBindings[i].getRole()){
ArrowLinkingInfo arrowLinkingInfo = new ArrowLinkingInfo();
Point linkPoint;
if(collapsed){
linkPoint = new Point(i * getWidth()/roleBindings.length, getHeight());
}else{
Role boundSubProcessRole = subProcDef.getRole(roleBindings[i].getArgument());
JLabel labelForBoundSubProcessRole = subProcessDesignerComponent.roleInformationPanel.getJLabel(boundSubProcessRole);
if(labelForBoundSubProcessRole==null) continue;
linkPoint = UEngineUtil.getRelativeLocation(this, labelForBoundSubProcessRole);
}
arrowLinkingInfo.setLinkPoint(linkPoint);
if(roleBindings[i].getDirection()!=null && roleBindings[i].getDirection().equals(ParameterContext.DIRECTION_IN))
arrowLinkingInfo.setTarget(true);
else
if(roleBindings[i].getDirection()!=null && roleBindings[i].getDirection().equals(ParameterContext.DIRECTION_OUT)){
arrowLinkingInfo.setSource(true);
}else{
arrowLinkingInfo.setTarget(true);
arrowLinkingInfo.setSource(true);
}
arrowLinkList.add(arrowLinkingInfo);
}
}