int x;
int y;
int id;
Object bean;
BeanVisual visual;
BeanInstance beaninst;
// for debugging only
if (DEBUG)
trace(new Throwable(), node.getAttribute(ATT_NAME));
m_CurrentNode = node;
result = null;
children = XMLDocument.getChildTags(node);
id = -1;
x = 0;
y = 0;
bean = null;
String customName = null;
for (i = 0; i < children.size(); i++) {
child = (Element) children.get(i);
name = child.getAttribute(ATT_NAME);
if (name.equals(VAL_ID)) {
id = readIntFromXML(child);
} else if (name.equals(VAL_X)) {
x = readIntFromXML(child);
} else if (name.equals(VAL_Y)) {
y = readIntFromXML(child);
} else if (name.equals(VAL_CUSTOM_NAME)) {
customName = (String)invokeReadFromXML(child);
} else if (name.equals(VAL_BEAN)) {
bean = invokeReadFromXML(child);
} else {
System.out.println(Messages.getInstance().getString("XMLBeans_ReadBeanInstance_Text_First") + name
+ Messages.getInstance().getString("XMLBeans_ReadBeanInstance_Text_Second") + node.getAttribute(ATT_NAME)
+ Messages.getInstance().getString("XMLBeans_ReadBeanInstance_Text_Third"));
}
}
result = new BeanInstance(m_BeanLayout, bean, x, y);
beaninst = (BeanInstance) result;
// set parent of BeanVisual
if (beaninst.getBean() instanceof weka.gui.beans.Visible) {
visual = ((Visible) beaninst.getBean()).getVisual();
visual.setSize(visual.getPreferredSize());
if (visual.getParent() == null) {
((JPanel) beaninst.getBean()).add(visual);
}
}
if (beaninst.getBean() instanceof BeanCommon &&
customName != null) {
((BeanCommon)beaninst.getBean()).setCustomName(customName);
}
// no IDs -> get next null position
if (id == -1) {
for (i = 0; i < m_BeanInstances.size(); i++) {