/** * */ package analyze; import java.awt.*; import java.awt.geom.*; /** * @author John * */ public class PlotActivity { // empty constructor public PlotActivity(){} // the painting routine public double plotActivity(Graphics2D g2d, Rectangle2D rfLoc, double val, double maxVal, double minVal){ double max = maxVal; double min = 0; // make a minimum scale if (max < 5) max = 5; boolean pA = true; // true // if activity is more positive // than negative if (val<0){ pA = false; val = -val; max = -minVal; } // activity is more negative int lum = 0; // luminance step // determine luminance steps lum = (int)(255.0*(val-min)/ (max-min)); if (pA){ g2d.setPaint(new Color(lum,lum,lum)); } else { g2d.setPaint(new Color(lum,0,lum/3)); } g2d.fill(rfLoc); return val; } public double plotActivity(int type, Graphics2D g2d, Rectangle2D rfLoc, double [] sum, double maxVal, double minVal){ // get the point mean activity level double val = 0; switch(type){ case PlotOutput.MAX_ACT : val = sum[Summarize.MAX]; break; case PlotOutput.MIN_ACT : val = sum[Summarize.MIN]; break; case PlotOutput.MEAN_ACT : val = sum[Summarize.MEAN]; break; } val = plotActivity(g2d, rfLoc,val,maxVal,minVal); return val; // return the lumninance value } }