*/
public Element writeBeanConnection(Element parent, Object o, String name)
throws Exception {
Element node;
BeanConnection beanconn;
int source;
int target;
int sourcePos;
int targetPos;
// for debugging only
if (DEBUG)
trace(new Throwable(), name);
m_CurrentNode = parent;
beanconn = (BeanConnection) o;
node = null;
// get position
sourcePos = m_BeanInstances.indexOf(beanconn.getSource());
targetPos = m_BeanInstances.indexOf(beanconn.getTarget());
// get id (if Connection is from a Bean in the UserToolBar, it's not listed! -> ignore it)
if ( (sourcePos > -1) && (targetPos > -1) ) {
source = ((Integer) m_BeanInstancesID.get(sourcePos)).intValue();
target = ((Integer) m_BeanInstancesID.get(targetPos)).intValue();
}
else {
source = -1;
target = -1;
}
// connection exists in the layout?
if ( (source > -1) && (target > -1) ) {
node = addElement(parent, name, beanconn.getClass().getName(), false);
writeIntToXML(node, source, VAL_SOURCEID);
writeIntToXML(node, target, VAL_TARGETID);
invokeWriteToXML(node, beanconn.getEventName(), VAL_EVENTNAME);
writeBooleanToXML(node, beanconn.isHidden(), VAL_HIDDEN);
}
return node;
}