Commit | Line | Data |
---|---|---|
b0d3496e | 1 | /*****************************************************************************\r |
fb5cad3d | 2 | * Copyright (c) 2007 Intel Corporation, 2010, 2012 Ericsson.\r |
b0d3496e ASL |
3 | * All rights reserved. This program and the accompanying materials\r |
4 | * are made available under the terms of the Eclipse Public License v1.0\r | |
5 | * which accompanies this distribution, and is available at\r | |
6 | * http://www.eclipse.org/legal/epl-v10.html\r | |
7 | *\r | |
8 | * Contributors:\r | |
fb5cad3d PT |
9 | * Intel Corporation - Initial API and implementation\r |
10 | * Ruslan A. Scherbakov, Intel - Initial API and implementation\r | |
11 | * Alvaro Sanchez-Leon - Updated for TMF\r | |
12 | * Patrick Tasse - Refactoring\r | |
b0d3496e | 13 | *\r |
b0d3496e ASL |
14 | *****************************************************************************/\r |
15 | \r | |
2fa130b8 | 16 | package org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets;\r |
b0d3496e | 17 | \r |
013a5f1c AM |
18 | /**\r |
19 | * Time data provider interface, for use in the timegraph widget.\r | |
20 | *\r | |
21 | * @version 1.0\r | |
22 | * @author Alvaro Sanchez-Leon\r | |
23 | * @author Patrick Tasse\r | |
24 | */\r | |
b0d3496e ASL |
25 | public interface ITimeDataProvider {\r |
26 | \r | |
3934297e AM |
27 | /**\r |
28 | * @return The selected time\r | |
29 | */\r | |
fb5cad3d | 30 | long getSelectedTime();\r |
b0d3496e | 31 | \r |
3934297e AM |
32 | /**\r |
33 | * @return The beginning time\r | |
34 | */\r | |
fb5cad3d | 35 | long getBeginTime();\r |
b0d3496e | 36 | \r |
3934297e AM |
37 | /**\r |
38 | * @return The end time\r | |
39 | */\r | |
fb5cad3d | 40 | long getEndTime();\r |
b0d3496e | 41 | \r |
3934297e AM |
42 | /**\r |
43 | * @return The minimum time\r | |
44 | */\r | |
fb5cad3d | 45 | long getMinTime();\r |
b0d3496e | 46 | \r |
3934297e AM |
47 | /**\r |
48 | * @return The maximum time\r | |
49 | */\r | |
fb5cad3d | 50 | long getMaxTime();\r |
b0d3496e | 51 | \r |
3934297e AM |
52 | /**\r |
53 | * @return The start time of the current selection window\r | |
54 | */\r | |
fb5cad3d | 55 | long getTime0();\r |
b0d3496e | 56 | \r |
3934297e AM |
57 | /**\r |
58 | * @return The end time of the current selection window\r | |
59 | */\r | |
fb5cad3d | 60 | long getTime1();\r |
b0d3496e | 61 | \r |
3934297e AM |
62 | /**\r |
63 | * @return The minimal time interval\r | |
64 | */\r | |
fb5cad3d | 65 | long getMinTimeInterval();\r |
b0d3496e | 66 | \r |
fb5cad3d PT |
67 | /**\r |
68 | * Updates the time range and notify registered listeners\r | |
013a5f1c | 69 | *\r |
fb5cad3d PT |
70 | * @param time0\r |
71 | * @param time1\r | |
72 | */\r | |
73 | void setStartFinishTimeNotify(long time0, long time1);\r | |
71c964eb | 74 | \r |
fb5cad3d PT |
75 | /**\r |
76 | * Update the time range but do not trigger event notification\r | |
013a5f1c | 77 | *\r |
fb5cad3d PT |
78 | * @param time0\r |
79 | * @param time1\r | |
80 | */\r | |
81 | void setStartFinishTime(long time0, long time1);\r | |
b0d3496e | 82 | \r |
8b9fa226 ASL |
83 | /**\r |
84 | * Notify registered listeners without updating the time range\r | |
85 | */\r | |
86 | void notifyStartFinishTime();\r | |
87 | \r | |
3ac6ad1a | 88 | /**\r |
3934297e AM |
89 | * Updates the selected time, adjusts the time range if necessary and\r |
90 | * notifies any registered listeners about the new selected time and new\r | |
91 | * range (if necessary)\r | |
013a5f1c | 92 | *\r |
3934297e AM |
93 | * @param time\r |
94 | * A Time to set\r | |
95 | * @param ensureVisible\r | |
96 | * Ensure visibility of new time (will adjust time range if\r | |
97 | * necessary)\r | |
3ac6ad1a BH |
98 | */\r |
99 | public void setSelectedTimeNotify(long time, boolean ensureVisible);\r | |
013a5f1c | 100 | \r |
3ac6ad1a | 101 | /**\r |
3934297e AM |
102 | * Updates the selected time and adjusts the time range if necessary without\r |
103 | * notifying registered listeners.\r | |
013a5f1c | 104 | *\r |
3934297e AM |
105 | * @param time\r |
106 | * A Time to set\r | |
107 | * @param ensureVisible\r | |
108 | * Ensure visibility of new time (will adjust time range if\r | |
109 | * necessary)\r | |
3ac6ad1a BH |
110 | */\r |
111 | public void setSelectedTime(long time, boolean ensureVisible);\r | |
fb5cad3d | 112 | \r |
3934297e AM |
113 | /**\r |
114 | * Reset the start and end times\r | |
115 | */\r | |
fb5cad3d | 116 | void resetStartFinishTime();\r |
b0d3496e | 117 | \r |
3934297e AM |
118 | /**\r |
119 | * @return The names' width\r | |
120 | */\r | |
fb5cad3d | 121 | int getNameSpace();\r |
b0d3496e | 122 | \r |
3934297e AM |
123 | /**\r |
124 | * Set the names' width\r | |
125 | *\r | |
126 | * @param width\r | |
127 | */\r | |
fb5cad3d | 128 | void setNameSpace(int width);\r |
b0d3496e | 129 | \r |
3934297e AM |
130 | /**\r |
131 | * @return The width for timestamps\r | |
132 | */\r | |
fb5cad3d | 133 | int getTimeSpace();\r |
b0d3496e | 134 | \r |
3934297e AM |
135 | /**\r |
136 | * @return If the calendar format is absolute (true) or relative (false)\r | |
137 | */\r | |
fb5cad3d | 138 | boolean isCalendarFormat();\r |
b0d3496e | 139 | }\r |