1 /**********************************************************************
2 * Copyright (c) 2013 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
12 package org
.eclipse
.linuxtools
.tmf
.ui
.viewers
.xycharts
;
14 import org
.eclipse
.linuxtools
.tmf
.ui
.viewers
.ITmfViewer
;
17 * Interface for providing and updating time information. This is typically
18 * implemented by a chart viewer that is displaying trace data over time where
19 * the time is shown on the x-axis.
21 * @author Bernd Hufmann
24 public interface ITmfChartTimeProvider
extends ITmfViewer
{
26 * Gets the start time of trace
28 * @return start time of trace
33 * Gets the end time of trace
35 * @return End time of trace
40 * Gets the start time of current time range displayed
42 * @return start time of current time range
44 long getWindowStartTime();
47 * Gets the end time of current time range displayed
49 * @return End time of current time range
51 long getWindowEndTime();
54 * Gets the duration of the current time range displayed
56 * @return duration of current time range
58 long getWindowDuration();
61 * Gets the begin time of the selected range
63 * @return the begin time of the selected range
65 long getSelectionBeginTime();
68 * Gets the end time of the selected range
70 * @return end time of the selected range
72 long getSelectionEndTime();
75 * Returns a constant time offset that is used to normalize the time values
76 * to a range of 0..53 bits to avoid loss of precision when converting
79 * Time values are stored in TMF as long values. The SWT chart library
80 * uses values of type double (on x and y axis). To avoid loss of
81 * precision when converting long <-> double the values need to fit
84 * Subtract the offset when using time values provided externally for
85 * internal usage in SWT chart. Add the offset when using time values
86 * provided by SWT chart (e.g. for display purposes) and when broadcasting
87 * them externally (e.g. time synchronization signals).
89 * For example the offset can be calculated as the time of the first
90 * time value in the current time range to be displayed in the chart.
91 * Add +1 to avoid 0 when using logarithmic scale.
93 * t0=10000, t2=20000, tn=N -> timeOffset=t0-1
94 * -> t0'=1, t1'=10001, tn'=N-timeOffset
96 * where t0 ... tn are times used externally and t0' ... tn' are times
97 * used internally by the SWT chart.
99 * @return the time offset
101 long getTimeOffset();
104 * Method to notify about a change of the current selected time.
106 * @param currentBeginTime
107 * The current selection begin time
108 * @param currentEndTime
109 * The current selection end time
111 void updateSelectionRange(long currentBeginTime
, long currentEndTime
);
This page took 0.032157 seconds and 5 git commands to generate.