lttng/tmf: add a "unit-less" representation of time in timechart
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / widgets / timegraph / widgets / ITimeDataProvider.java
1
2 /*****************************************************************************
3 * Copyright (c) 2007 Intel Corporation, 2010, 2012 Ericsson.
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
13 * Patrick Tasse - Refactoring
14 *
15 *****************************************************************************/
16
17 package org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets;
18
19 import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.Utils.TimeFormat;
20
21 /**
22 * Time data provider interface, for use in the timegraph widget.
23 *
24 * @version 1.0
25 * @author Alvaro Sanchez-Leon
26 * @author Patrick Tasse
27 * @author Xavier Raynaud
28 */
29 public interface ITimeDataProvider {
30
31 /**
32 * @return The selected time
33 */
34 long getSelectedTime();
35
36 /**
37 * @return The beginning time
38 */
39 long getBeginTime();
40
41 /**
42 * @return The end time
43 */
44 long getEndTime();
45
46 /**
47 * @return The minimum time
48 */
49 long getMinTime();
50
51 /**
52 * @return The maximum time
53 */
54 long getMaxTime();
55
56 /**
57 * @return The start time of the current selection window
58 */
59 long getTime0();
60
61 /**
62 * @return The end time of the current selection window
63 */
64 long getTime1();
65
66 /**
67 * @return The minimal time interval
68 */
69 long getMinTimeInterval();
70
71 /**
72 * Updates the time range and notify registered listeners
73 *
74 * @param time0
75 * @param time1
76 */
77 void setStartFinishTimeNotify(long time0, long time1);
78
79 /**
80 * Update the time range but do not trigger event notification
81 *
82 * @param time0
83 * @param time1
84 */
85 void setStartFinishTime(long time0, long time1);
86
87 /**
88 * Notify registered listeners without updating the time range
89 */
90 void notifyStartFinishTime();
91
92 /**
93 * Updates the selected time, adjusts the time range if necessary and
94 * notifies any registered listeners about the new selected time and new
95 * range (if necessary)
96 *
97 * @param time
98 * A Time to set
99 * @param ensureVisible
100 * Ensure visibility of new time (will adjust time range if
101 * necessary)
102 */
103 public void setSelectedTimeNotify(long time, boolean ensureVisible);
104
105 /**
106 * Updates the selected time and adjusts the time range if necessary without
107 * notifying registered listeners.
108 *
109 * @param time
110 * A Time to set
111 * @param ensureVisible
112 * Ensure visibility of new time (will adjust time range if
113 * necessary)
114 */
115 public void setSelectedTime(long time, boolean ensureVisible);
116
117 /**
118 * Reset the start and end times
119 */
120 void resetStartFinishTime();
121
122 /**
123 * @return The names' width
124 */
125 int getNameSpace();
126
127 /**
128 * Set the names' width
129 *
130 * @param width
131 */
132 void setNameSpace(int width);
133
134 /**
135 * @return The width for timestamps
136 */
137 int getTimeSpace();
138
139 /**
140 * @return If the time format is calendar (true) or relative (false)
141 * @deprecated replaced by {@link #getTimeFormat()}
142 */
143 boolean isCalendarFormat();
144
145 /**
146 * @return the time format, one of:
147 * <ul>
148 * <li>{@link TimeFormat#CALENDAR} absolute time, displayed as year/month/day/hours/minutes/seconds/ms/us/ns
149 * <li>{@link TimeFormat#RELATIVE} relative time, displayed as seconds/ms/us/ns
150 * <li>{@link TimeFormat#NUMBER} number, displayed as long values.
151 * </ul>
152 * @since 2.0
153 */
154 TimeFormat getTimeFormat();
155 }
This page took 0.033357 seconds and 5 git commands to generate.