t.addColumns(ANCHORITEM_SCHEMA);
t.addColumns(FORCEITEM_SCHEMA);
Iterator iter = m_vis.visibleItems(m_nodeGroup);
while ( iter.hasNext() ) {
VisualItem item = (VisualItem)iter.next();
// get force item
ForceItem fitem = (ForceItem)item.get(FORCEITEM);
if ( fitem == null ) {
fitem = new ForceItem();
item.set(FORCEITEM, fitem);
}
fitem.location[0] = (float)item.getEndX();
fitem.location[1] = (float)item.getEndY();
fitem.mass = getMassValue(item);
// get spring anchor
ForceItem aitem = (ForceItem)item.get(ANCHORITEM);
if ( aitem == null ) {
aitem = new ForceItem();
item.set(ANCHORITEM, aitem);
aitem.location[0] = fitem.location[0];
aitem.location[1] = fitem.location[1];
}
fsim.addItem(fitem);