From: Eric P. <th...@us...> - 2010-08-19 21:49:07
|
Update of /cvsroot/sandev/sand/apps/TaskHeap/src/org/sandev/TaskHeap/HeapCalculator In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv15482 Modified Files: HeapCalculatorNode.java Log Message: Initially collapse all but the first top level plan. With a large heap the amount of data transfer makes the display slow. Index: HeapCalculatorNode.java =================================================================== RCS file: /cvsroot/sandev/sand/apps/TaskHeap/src/org/sandev/TaskHeap/HeapCalculator/HeapCalculatorNode.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** HeapCalculatorNode.java 22 Feb 2008 02:00:53 -0000 1.12 --- HeapCalculatorNode.java 19 Aug 2010 21:48:59 -0000 1.13 *************** *** 96,99 **** --- 96,100 ---- HeapAssociation assoc=hd.getAssociation(); AuthUser user=getUserForID(assoc.getAccount()); + DisplayParams params=hd.getDisplayParams(); HeapAttributes ha=(HeapAttributes)getInstance( "HeapAttributes",assoc.getHeap(),user); *************** *** 104,108 **** AuthUser intcomm=getUserForID(INTERNALCOMMSID); root=createTree(ha.getUniqueID(),intcomm); ! ha.setHeap(root); } IntReference currPlanMark=new IntReference(); currPlanMark.setValue(PlanTreeElement.CURRPLANOFFSET_BEFORE); --- 105,110 ---- AuthUser intcomm=getUserForID(INTERNALCOMMSID); root=createTree(ha.getUniqueID(),intcomm); ! ha.setHeap(root); ! initialCollapse(ha,params); } IntReference currPlanMark=new IntReference(); currPlanMark.setValue(PlanTreeElement.CURRPLANOFFSET_BEFORE); *************** *** 110,114 **** user.getUniqueID() + " (" + user.getUsername() + ")"); //abbreviate to new root if drilldown - DisplayParams params=hd.getDisplayParams(); if(params.getDisplayMode()==DisplayParams.DISPLAYMODE_SUBROOT) { PlanTreeElement subroot=findRoot(root,params.getRootPlan()); --- 112,115 ---- *************** *** 357,360 **** --- 358,384 ---- + /** + * Collapse all but the first main plan, so the initial display + * doesn't take forever with a significant size heap. + */ + protected void initialCollapse(HeapAttributes ha,DisplayParams dp) + { + PlanTreeElement root=ha.getHeap(); + if(root!=null) { + log(LOGDEBUG,"initialCollapse root: " + + root.getPlanComponentID() + " " + root.getName()); + PlanTreeElement[] children=root.getChildren(); + for(int i=1;i<children.length;i++) { //collapse all but 1st + int NONPLAN=PlanTreeElement.PLANSTATUS_NONPLAN; + int COLLAPSED=PlanTreeElement.ITEMEXPANSION_COLLAPSED; + PlanTreeElement pte=children[i]; + if(pte.getPlanStatus()!=NONPLAN) { + //pte.setItemExpansion(COLLAPSED); + dp.addCollapsed(pte.getPlanComponentID()); } } } + else { + log(LOGDEBUG,"initialCollapse root null"); } + } + + //////////////////////////////////////// // utility methods |