TimelineThread.java
Go to the documentation of this file.00001 package edu.rice.cs.hpc.traceviewer.main;
00002
00003
00004 import java.util.Queue;
00005 import java.util.concurrent.atomic.AtomicInteger;
00006
00007 import org.eclipse.core.runtime.IProgressMonitor;
00008 import org.eclipse.ui.IWorkbenchWindow;
00009
00010 import edu.rice.cs.hpc.traceviewer.data.db.DataPreparation;
00011 import edu.rice.cs.hpc.traceviewer.data.db.TimelineDataSet;
00012 import edu.rice.cs.hpc.traceviewer.data.graph.ColorTable;
00013 import edu.rice.cs.hpc.traceviewer.services.ProcessTimelineService;
00014 import edu.rice.cs.hpc.traceviewer.spaceTimeData.SpaceTimeDataController;
00015 import edu.rice.cs.hpc.traceviewer.timeline.BaseTimelineThread;
00016
00017 import edu.rice.cs.hpc.traceviewer.data.timeline.ProcessTimeline;
00018
00019 public class TimelineThread
00020 extends BaseTimelineThread
00021 {
00023 private boolean changedBounds;
00024
00025 final private ProcessTimelineService traceService;
00026
00027
00028
00029
00030
00031 public TimelineThread(IWorkbenchWindow window, SpaceTimeDataController _stData, ProcessTimelineService traceService,
00032 boolean _changedBounds, double _scaleY, Queue<TimelineDataSet> queue,
00033 AtomicInteger numTimelines, IProgressMonitor monitor)
00034 {
00035 super(_stData, _scaleY, queue, numTimelines,_stData.isEnableMidpoint(), monitor);
00036 changedBounds = _changedBounds;
00037 this.traceService = traceService;
00038 }
00039
00040
00041 @Override
00042 protected ProcessTimeline getNextTrace() {
00043 return stData.getNextTrace(changedBounds);
00044 }
00045
00046
00047 @Override
00048 protected boolean init(ProcessTimeline trace) {
00049
00050 if(changedBounds)
00051 {
00052 if (trace.getData().isEmpty()) {
00053
00054 trace.readInData();
00055 traceService.setProcessTimeline(trace.line(), trace);
00056 }
00057 trace.shiftTimeBy(stData.getMinBegTime());
00058 }
00059 boolean res = (trace.size()>=2);
00060 return res;
00061 }
00062
00063 @Override
00064 protected void finalize() {
00065 }
00066
00067 @Override
00068 protected DataPreparation getData(ColorTable colorTable,
00069 ProcessTimeline timeline, long timeBegin, int linenum, int height,
00070 double pixelLength, boolean midPoint) {
00071
00072 return new DetailDataPreparation(colorTable, timeline,
00073 timeBegin, stData.getAttributes().getDepth(), height, pixelLength, midPoint);
00074 }
00075
00076 }