tmf: Update copyright headers in tmf.ui
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / histogram / HistogramView.java
index 617d2d0434fa64a5b55d99b5d74a0f36d230a95c..64202fc771f39f13484166976382571bd04f77d2 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2009, 2010, 2011, 2012 Ericsson
+ * Copyright (c) 2009, 2013 Ericsson
  *
  * All rights reserved. This program and the accompanying materials are
  * made available under the terms of the Eclipse Public License v1.0 which
@@ -18,9 +18,6 @@
 package org.eclipse.linuxtools.tmf.ui.views.histogram;
 
 import org.eclipse.linuxtools.tmf.core.event.ITmfEvent;
-import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
-import org.eclipse.linuxtools.tmf.core.event.TmfTimeRange;
-import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.request.ITmfDataRequest.ExecutionType;
 import org.eclipse.linuxtools.tmf.core.request.TmfDataRequest;
 import org.eclipse.linuxtools.tmf.core.signal.TmfRangeSynchSignal;
@@ -32,6 +29,9 @@ import org.eclipse.linuxtools.tmf.core.signal.TmfTraceOpenedSignal;
 import org.eclipse.linuxtools.tmf.core.signal.TmfTraceRangeUpdatedSignal;
 import org.eclipse.linuxtools.tmf.core.signal.TmfTraceSelectedSignal;
 import org.eclipse.linuxtools.tmf.core.signal.TmfTraceUpdatedSignal;
+import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimeRange;
+import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
 import org.eclipse.linuxtools.tmf.core.trace.ITmfTrace;
 import org.eclipse.linuxtools.tmf.ui.editors.ITmfTraceEditor;
 import org.eclipse.linuxtools.tmf.ui.views.TmfView;
@@ -178,7 +178,7 @@ public class HistogramView extends TmfView {
         gridData.verticalAlignment = SWT.CENTER;
         fCurrentEventTimeControl = new HistogramCurrentTimeControl(this, controlsComposite, currentEventLabel, 0L);
         fCurrentEventTimeControl.setLayoutData(gridData);
-        fCurrentEventTimeControl.setValue(0L);
+        fCurrentEventTimeControl.setValue(Long.MIN_VALUE);
 
         // Window span time control
         gridData = new GridData();
@@ -186,7 +186,7 @@ public class HistogramView extends TmfView {
         gridData.verticalAlignment = SWT.CENTER;
         fTimeSpanControl = new HistogramTimeRangeControl(this, controlsComposite, windowSpanLabel, 0L);
         fTimeSpanControl.setLayoutData(gridData);
-        fTimeSpanControl.setValue(0L);
+        fTimeSpanControl.setValue(Long.MIN_VALUE);
 
         // --------------------------------------------------------------------
         // Time range histogram
@@ -277,6 +277,7 @@ public class HistogramView extends TmfView {
      * Returns the time range of the current selected window (base on default time scale).
      *
      * @return the time range of current selected window.
+     * @since 2.0
      */
     public TmfTimeRange getTimeRange() {
         return new TmfTimeRange(
@@ -341,20 +342,22 @@ public class HistogramView extends TmfView {
     }
 
     private void setNewRange(long startTime, long duration) {
-        if (startTime < fTraceStartTime) {
-            startTime = fTraceStartTime;
+        long realStart = startTime;
+
+        if (realStart < fTraceStartTime) {
+            realStart = fTraceStartTime;
         }
 
-        long endTime = startTime + duration;
+        long endTime = realStart + duration;
         if (endTime > fTraceEndTime) {
             endTime = fTraceEndTime;
             if ((endTime - duration) > fTraceStartTime) {
-                startTime = endTime - duration;
+                realStart = endTime - duration;
             } else {
-                startTime = fTraceStartTime;
+                realStart = fTraceStartTime;
             }
         }
-        updateTimeRange(startTime, endTime);
+        updateTimeRange(realStart, endTime);
     }
 
     // ------------------------------------------------------------------------
@@ -426,9 +429,9 @@ public class HistogramView extends TmfView {
         // Clear the UI widgets
         fFullTraceHistogram.clear();
         fTimeRangeHistogram.clear();
-        fCurrentEventTimeControl.setValue(0L);
+        fCurrentEventTimeControl.setValue(Long.MIN_VALUE);
 
-        fTimeSpanControl.setValue(0);
+        fTimeSpanControl.setValue(Long.MIN_VALUE);
     }
 
     /**
This page took 0.027226 seconds and 5 git commands to generate.