2323import projections .analysis .ProjMain ;
2424import projections .analysis .TimedProgressThreadExecutor ;
2525import projections .gui .Clickable ;
26- import projections .gui .GenericGraphColorer ;
2726import projections .gui .GenericGraphWindow ;
2827import projections .gui .IntervalChooserPanel ;
2928import projections .gui .JPanelToImage ;
3029import projections .gui .MainWindow ;
3130import projections .gui .RangeDialog ;
31+ import projections .gui .TimeProfileColorer ;
3232import projections .gui .U ;
3333import projections .gui .Util ;
3434
@@ -508,45 +508,6 @@ public void done() {
508508 }
509509 }
510510
511-
512-
513- /** A class that provides the colors for the display */
514- public class TimeProfileColorer implements GenericGraphColorer {
515- int myRun = 0 ;
516- int outSize ;
517- int numIntervals ;
518-
519- TimeProfileColorer (int outSize , int numIntervals ){
520- this .outSize = outSize ;
521- this .numIntervals = numIntervals ;
522- }
523-
524- public Paint [] getColorMap () {
525- Paint [] outColors = new Paint [outSize ];
526- for (int i =0 ; i <numIntervals ; i ++) {
527- int count = 0 ;
528- for (int ep =0 ; ep <numEPs +special ; ep ++) {
529- if (stateArray [ep ]) {
530- outputData [i ][count ] = graphData [i ][ep ];
531- if (ep == numEPs ){
532- outColors [count ++] = MainWindow .runObject [myRun ].getOverheadColor ();
533- }
534- else if (ep == numEPs +1 ){
535- outColors [count ++] = MainWindow .runObject [myRun ].getIdleColor ();
536- }
537- else
538- outColors [count ++] = MainWindow .runObject [myRun ].getEPColorMap ()[ep ];
539- }
540- }
541- }
542-
543- return outColors ;
544- }
545-
546- }
547-
548-
549-
550511 private void setOutputGraphData () {
551512 // need first pass to decide the size of the outputdata
552513 int outSize = 0 ;
@@ -572,7 +533,7 @@ private void setOutputGraphData() {
572533 setYAxis ("Percentage Utilization" , "%" );
573534 String xAxisLabel = "Time (" + U .humanReadableString (intervalSize ) + " resolution)" ;
574535 setXAxis (xAxisLabel , "Time" , startTime , intervalSize );
575- setDataSource ("Time Profile" , outputData , new TimeProfileColorer (outSize , numIntervals ), thisWindow );
536+ setDataSource ("Time Profile" , outputData , new TimeProfileColorer (outSize , numIntervals , numEPs , outputData , graphData , stateArray ), thisWindow );
576537 graphCanvas .setMarkers (phaseMarkers );
577538 refreshGraph ();
578539 }
0 commit comments