void JXTreeListWidget::HandleMouseUp ( const JPoint& pt, const JXMouseButton button, const JXButtonStates& buttonStates, const JXKeyModifiers& modifiers ) { if (itsToggleDragIndex > 0 && itsMouseInToggleFlag) { ToggleNode(itsToggleDragIndex, modifiers.shift(), modifiers.meta()); Refresh(); } itsMouseInToggleFlag = kJFalse; itsToggleDragIndex = 0; }
void SummStats(Edge n_edges, Vertex n_nodes, Vertex *tails, Vertex *heads, Network *nwp, Model *m, double *stats, Network *y0){ Vertex *nodes; /*may need to change*/ nodes = (Vertex *)malloc( 1 * sizeof(Vertex)); GetRNGstate(); /* R function enabling uniform RNG */ ShuffleEdges(tails,heads,n_edges); /* Shuffle edgelist. */ for (unsigned int termi=0; termi < m->n_terms; termi++) m->termarray[termi].dstats = m->workspace; /* Doing this one toggle at a time saves a lot of toggles... */ for(Edge e=0; e<n_edges; e++){ ModelTerm *mtp = m->termarray; double *statspos=stats; nodes[0] = 0; for (unsigned int termi=0; termi < m->n_terms; termi++, mtp++){ if(!mtp->s_func){ (*(mtp->d_func))(1, tails+e, heads+e, nodes, mtp, nwp, y0); /* Call d_??? function */ for (unsigned int i=0; i < mtp->nstats; i++,statspos++) *statspos += mtp->dstats[i]; }else statspos += mtp->nstats; } ToggleEdge(tails[e],heads[e],nwp); } /* Doing this one toggle at a time saves a lot of toggles... */ for(int v=0; v<n_nodes; v++){ if(m->nodalstatus[v]== 2.0){ nodes[0] = (int) (v+1); ModelTerm *mtp = m->termarray; double *statspos=stats; for (unsigned int termi=0; termi < m->n_terms; termi++, mtp++){ if(!mtp->s_func){ (*(mtp->d_func))(1, tails, heads, nodes, mtp, nwp, y0); /* Call d_??? function */ for (unsigned int i=0; i < mtp->nstats; i++,statspos++) *statspos += mtp->dstats[i]; }else statspos += mtp->nstats; } ToggleNode(v+1,nwp); } } ModelTerm *mtp = m->termarray; double *dstats = m->workspace; double *statspos=stats; for (unsigned int termi=0; termi < m->n_terms; termi++, dstats+=mtp->nstats, mtp++ ){ if(mtp->s_func){ (*(mtp->s_func))(mtp, nwp); /* Call s_??? function */ for (unsigned int i=0; i < mtp->nstats; i++,statspos++) *statspos = mtp->dstats[i]; }else statspos += mtp->nstats; } PutRNGstate(); }