/*******************************************************************************
- * 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
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;
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;
* 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(
}
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);
}
// ------------------------------------------------------------------------