Commit | Line | Data |
---|---|---|
be222f56 | 1 | /***************************************************************************** |
50d36521 | 2 | * Copyright (c) 2007, 2015 Intel Corporation, Ericsson |
baf92cac | 3 | * |
be222f56 PT |
4 | * All rights reserved. This program and the accompanying materials |
5 | * are made available under the terms of the Eclipse Public License v1.0 | |
6 | * which accompanies this distribution, and is available at | |
7 | * http://www.eclipse.org/legal/epl-v10.html | |
8 | * | |
9 | * Contributors: | |
10 | * Intel Corporation - Initial API and implementation | |
11 | * Ruslan A. Scherbakov, Intel - Initial API and implementation | |
12 | * Alvaro Sanchez-Leon - Updated for TMF | |
baf92cac AM |
13 | * Geneviève Bastien - Added methods to save a time range selection |
14 | * Patrick Tasse - Refactoring, support for range selection | |
be222f56 PT |
15 | *****************************************************************************/ |
16 | ||
2bdf0193 | 17 | package org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets; |
be222f56 | 18 | |
2bdf0193 | 19 | import org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.Utils.TimeFormat; |
026664b7 | 20 | |
be222f56 PT |
21 | /** |
22 | * Time data provider interface, for use in the timegraph widget. | |
23 | * | |
be222f56 PT |
24 | * @author Alvaro Sanchez-Leon |
25 | * @author Patrick Tasse | |
026664b7 | 26 | * @author Xavier Raynaud |
be222f56 PT |
27 | */ |
28 | public interface ITimeDataProvider { | |
29 | ||
30 | /** | |
baf92cac AM |
31 | * Updates the selection begin and end time and notifies any registered |
32 | * listeners about the new time range (if necessary) | |
33 | * | |
34 | * @param beginTime the selection begin time | |
35 | * @param endTime the selection end time | |
baf92cac AM |
36 | */ |
37 | void setSelectionRangeNotify(long beginTime, long endTime); | |
38 | ||
39 | /** | |
40 | * Updates the selection begin and end time | |
0fcf3b09 | 41 | * |
baf92cac AM |
42 | * @param beginTime the selection begin time |
43 | * @param endTime the selection end time | |
baf92cac AM |
44 | */ |
45 | void setSelectionRange(long beginTime, long endTime); | |
46 | ||
47 | /** | |
48 | * @return The begin time of the current selection | |
baf92cac AM |
49 | */ |
50 | long getSelectionBegin(); | |
51 | ||
52 | /** | |
53 | * @return The end time of the current selection | |
be222f56 | 54 | */ |
baf92cac | 55 | long getSelectionEnd(); |
be222f56 PT |
56 | |
57 | /** | |
50d36521 PT |
58 | * Get the user-specified bounds begin time. May be set to SWT.DEFAULT. For |
59 | * the actual bound use {@link #getMinTime()}. | |
60 | * | |
61 | * @return The user-specified begin time, or SWT.DEFAULT if input bound used | |
be222f56 PT |
62 | */ |
63 | long getBeginTime(); | |
64 | ||
65 | /** | |
50d36521 PT |
66 | * Get the user-specified bounds end time. May be set to SWT.DEFAULT. For |
67 | * the actual bound use {@link #getMaxTime()}. | |
68 | * | |
69 | * @return The user-specified end time, or SWT.DEFAULT if input bound used | |
be222f56 PT |
70 | */ |
71 | long getEndTime(); | |
72 | ||
73 | /** | |
50d36521 | 74 | * @return The bounds minimum time |
be222f56 PT |
75 | */ |
76 | long getMinTime(); | |
77 | ||
78 | /** | |
50d36521 | 79 | * @return The bounds maximum time |
be222f56 PT |
80 | */ |
81 | long getMaxTime(); | |
82 | ||
83 | /** | |
50d36521 | 84 | * @return The current window start time |
be222f56 PT |
85 | */ |
86 | long getTime0(); | |
87 | ||
88 | /** | |
50d36521 | 89 | * @return The current window end time |
be222f56 PT |
90 | */ |
91 | long getTime1(); | |
92 | ||
93 | /** | |
94 | * @return The minimal time interval | |
95 | */ | |
96 | long getMinTimeInterval(); | |
97 | ||
98 | /** | |
99 | * Updates the time range and notify registered listeners | |
100 | * | |
101 | * @param time0 | |
102 | * @param time1 | |
103 | */ | |
104 | void setStartFinishTimeNotify(long time0, long time1); | |
105 | ||
106 | /** | |
107 | * Update the time range but do not trigger event notification | |
108 | * | |
109 | * @param time0 | |
110 | * @param time1 | |
111 | */ | |
112 | void setStartFinishTime(long time0, long time1); | |
113 | ||
114 | /** | |
115 | * Notify registered listeners without updating the time range | |
116 | */ | |
117 | void notifyStartFinishTime(); | |
118 | ||
119 | /** | |
120 | * Updates the selected time, adjusts the time range if necessary and | |
121 | * notifies any registered listeners about the new selected time and new | |
122 | * range (if necessary) | |
123 | * | |
124 | * @param time | |
125 | * A Time to set | |
126 | * @param ensureVisible | |
127 | * Ensure visibility of new time (will adjust time range if | |
128 | * necessary) | |
129 | */ | |
f1fae91f | 130 | void setSelectedTimeNotify(long time, boolean ensureVisible); |
be222f56 PT |
131 | |
132 | /** | |
133 | * Updates the selected time and adjusts the time range if necessary without | |
134 | * notifying registered listeners. | |
135 | * | |
136 | * @param time | |
137 | * A Time to set | |
138 | * @param ensureVisible | |
139 | * Ensure visibility of new time (will adjust time range if | |
140 | * necessary) | |
141 | */ | |
f1fae91f | 142 | void setSelectedTime(long time, boolean ensureVisible); |
be222f56 PT |
143 | |
144 | /** | |
88de10c6 | 145 | * Reset the start and end times and notify the registered listeners |
be222f56 PT |
146 | */ |
147 | void resetStartFinishTime(); | |
148 | ||
149 | /** | |
150 | * @return The names' width | |
151 | */ | |
152 | int getNameSpace(); | |
153 | ||
154 | /** | |
155 | * Set the names' width | |
156 | * | |
157 | * @param width | |
158 | */ | |
159 | void setNameSpace(int width); | |
160 | ||
161 | /** | |
162 | * @return The width for timestamps | |
163 | */ | |
164 | int getTimeSpace(); | |
165 | ||
026664b7 XR |
166 | /** |
167 | * @return the time format, one of: | |
168 | * <ul> | |
169 | * <li>{@link TimeFormat#CALENDAR} absolute time, displayed as year/month/day/hours/minutes/seconds/ms/us/ns | |
170 | * <li>{@link TimeFormat#RELATIVE} relative time, displayed as seconds/ms/us/ns | |
171 | * <li>{@link TimeFormat#NUMBER} number, displayed as long values. | |
172 | * </ul> | |
026664b7 XR |
173 | */ |
174 | TimeFormat getTimeFormat(); | |
be222f56 | 175 | } |