protected void initSimulator(ForceSimulator fsim){
  TupleSet ts=m_vis.getGroup(m_nodeGroup);
  if (ts == null)   return;
  try {
    ts.addColumns(FORCEITEM_SCHEMA);
  }
 catch (  IllegalArgumentException iae) {
  }
  float startX=(referrer == null ? 0f : (float)referrer.getX());
  float startY=(referrer == null ? 0f : (float)referrer.getY());
  startX=Float.isNaN(startX) ? 0f : startX;
  startY=Float.isNaN(startY) ? 0f : startY;
  Iterator iter=m_vis.visibleItems(m_nodeGroup);
  while (iter.hasNext()) {
    VisualItem item=(VisualItem)iter.next();
    ForceItem fitem=(ForceItem)item.get(FORCEITEM);
    fitem.mass=getMassValue(item);
    double x=item.getEndX();
    double y=item.getEndY();
    fitem.location[0]=(Double.isNaN(x) ? startX : (float)x);
    fitem.location[1]=(Double.isNaN(y) ? startY : (float)y);
    fsim.addItem(fitem);
  }
  if (m_edgeGroup != null) {
    iter=m_vis.visibleItems(m_edgeGroup);
    while (iter.hasNext()) {
      EdgeItem e=(EdgeItem)iter.next();
      NodeItem n1=e.getSourceItem();
      ForceItem f1=(ForceItem)n1.get(FORCEITEM);
      NodeItem n2=e.getTargetItem();
      ForceItem f2=(ForceItem)n2.get(FORCEITEM);
      float coeff=getSpringCoefficient(e);
      float slen=getSpringLength(e);
      fsim.addSpring(f1,f2,(coeff >= 0 ? coeff : -1.f),(slen >= 0 ? slen : -1.f));
    }
  }
}

protected void initSimulator ( ForceSimulator fsim ) { TupleSet ts = m_vis . getGroup ( m_nodeGroup ) ; if ( ts == null ) return ; try { ts . addColumns ( FORCEITEM_SCHEMA ) ; } catch ( IllegalArgumentException iae ) { } float startX = ( referrer == null ? 0f : ( float ) referrer . getX ( ) ) ; float startY = ( referrer == null ? 0f : ( float ) referrer . getY ( ) ) ; startX = Float . isNaN ( startX ) ? 0f : startX ; startY = Float . isNaN ( startY ) ? 0f : startY ; Iterator iter = m_vis . visibleItems ( m_nodeGroup ) ; while ( iter . hasNext ( ) ) { VisualItem item = ( VisualItem ) iter . next ( ) ; ForceItem fitem = ( ForceItem ) item . get ( FORCEITEM ) ; fitem . mass = getMassValue ( item ) ; double x = item . getEndX ( ) ; double y = item . getEndY ( ) ; fitem . location [ 0 ] = ( Double . isNaN ( x ) ? startX : ( float ) x ) ; fitem . location [ 1 ] = ( Double . isNaN ( y ) ? startY : ( float ) y ) ; fsim . addItem ( fitem ) ; } if ( m_edgeGroup != null ) { iter = m_vis . visibleItems ( m_edgeGroup ) ; while ( iter . hasNext ( ) ) { EdgeItem e = ( EdgeItem ) iter . next ( ) ; NodeItem n1 = e . getSourceItem ( ) ; ForceItem f1 = ( ForceItem ) n1 . get ( FORCEITEM ) ; NodeItem n2 = e . getTargetItem ( ) ; ForceItem f2 = ( ForceItem ) n2 . get ( FORCEITEM ) ; float coeff = getSpringCoefficient ( e ) ; float slen = getSpringLength ( e ) ; fsim . addSpring ( f1 , f2 , ( coeff >= 0 ? coeff : - 1.f ) , ( slen >= 0 ? slen : - 1.f ) ) ; } } }
loads the simulator with all relevant force items and springs .
