DepthPaintThread.java

Go to the documentation of this file.
00001 package edu.rice.cs.hpc.traceviewer.depth;
00002 
00003 import java.util.Queue;
00004 import java.util.concurrent.atomic.AtomicInteger;
00005 
00006 import org.eclipse.swt.graphics.Device;
00007 import org.eclipse.swt.graphics.GC;
00008 import org.eclipse.swt.graphics.Image;
00009 
00010 import edu.rice.cs.hpc.traceviewer.data.db.BaseDataVisualization;
00011 import edu.rice.cs.hpc.traceviewer.data.db.TimelineDataSet;
00012 import edu.rice.cs.hpc.traceviewer.painter.BasePaintThread;
00013 import edu.rice.cs.hpc.traceviewer.painter.ImagePosition;
00014 import edu.rice.cs.hpc.traceviewer.spaceTimeData.SpaceTimeDataController;
00015 
00016 public class DepthPaintThread extends BasePaintThread {
00017 
00018     private Image image;
00019     private GC gc;
00020 
00021     public DepthPaintThread(SpaceTimeDataController stData, Queue<TimelineDataSet> list, int linesToPaint, 
00022             AtomicInteger paintDone, Device device, 
00023             int width) {
00024 
00025         super(stData, list, linesToPaint, paintDone, device, width);
00026     }
00027 
00028     @Override
00029     protected void initPaint(Device device, int width, int height) {
00030 
00031         image = new Image(device, width, height);
00032         gc    = new GC(image);
00033     }
00034 
00035     @Override
00036     protected void paint(int position, BaseDataVisualization data, int height) {
00037         // display only if the current thread line number is within the depth
00038         // note that the line number starts from zero while depth starts from 1 (I think)
00039         if (position < data.depth)
00040             paint(gc, data.x_start, data.x_end, height, data.color);
00041     }
00042 
00043     @Override
00044     protected ImagePosition finalizePaint(int linenum) {
00045 
00046         gc.dispose();
00047         return new ImagePosition(linenum, image);
00048     }
00049 
00050     @Override
00051     protected int getNumberOfCreatedData() {
00052         return stData.getNumberOfDepthLines();
00053     }
00054 
00055 }

Generated on 5 May 2015 for HPCVIEWER by  doxygen 1.6.1