Commit | Line | Data |
---|---|---|
c879c4db AM |
1 | /* |
2 | * Copyright (C) 2017 EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com> | |
3 | * | |
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 | |
8 | */ | |
9 | ||
10 | package org.lttng.scope.tmf2.views.core.timegraph.model.provider.drawnevents; | |
11 | ||
12 | import java.util.concurrent.FutureTask; | |
13 | ||
14 | import org.eclipse.jdt.annotation.Nullable; | |
15 | import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace; | |
16 | import org.lttng.scope.tmf2.views.core.TimeRange; | |
17 | import org.lttng.scope.tmf2.views.core.timegraph.model.render.drawnevents.TimeGraphDrawnEventRender; | |
18 | import org.lttng.scope.tmf2.views.core.timegraph.model.render.drawnevents.TimeGraphDrawnEventSeries; | |
19 | import org.lttng.scope.tmf2.views.core.timegraph.model.render.tree.TimeGraphTreeRender; | |
20 | ||
21 | import javafx.beans.property.BooleanProperty; | |
22 | import javafx.beans.property.ObjectProperty; | |
23 | ||
24 | /** | |
25 | * Interface defining providers of drawn events. | |
26 | * | |
27 | * A "drawn event" is a symbol in a timegraph representing one particular | |
28 | * (trace) event. Contrary to a trace event, a drawn event has both horizontal | |
29 | * and vertical coordinates, being time and its corresponding time graph entry. | |
30 | * | |
31 | * @author Alexandre Montplaisir | |
32 | * @see TimeGraphDrawnEventProviderManager | |
33 | */ | |
34 | public interface ITimeGraphDrawnEventProvider { | |
35 | ||
36 | /** | |
37 | * The trace from which the provider will fetch its events. The Property | |
38 | * mechanisms can be used to sync with trace changes elsewhere in the | |
39 | * framework. | |
40 | * | |
41 | * @return The target trace | |
42 | */ | |
43 | ObjectProperty<@Nullable ITmfTrace> traceProperty(); | |
44 | ||
45 | /** | |
46 | * The 'enabled' property of this provider. A provider can be created and | |
47 | * registered to the manager, but considered disabled so that it stops | |
48 | * painting its events. | |
49 | * | |
50 | * For example, if the user can uncheck elements in a list showing all | |
51 | * existing event providers, this could disable said providers without | |
52 | * completely destroying them. | |
53 | * | |
54 | * @return The enabled property | |
55 | */ | |
56 | BooleanProperty enabledProperty(); | |
57 | ||
58 | /** | |
59 | * Return the {@link TimeGraphDrawnEventSeries} provided by this provider. A | |
60 | * single provider should manage a single event series; different providers | |
61 | * should be implemented for different series. | |
62 | * | |
63 | * @return The event series of this provider | |
64 | */ | |
65 | TimeGraphDrawnEventSeries getEventSeries(); | |
66 | ||
67 | /** | |
68 | * Query for a render of drawn events on this provider. | |
69 | * | |
70 | * @param treeRender | |
71 | * The tree render of the timegraph to paint on | |
72 | * @param timeRange | |
73 | * The time range of the timegraph (and trace) to run the query | |
74 | * on. | |
75 | * @param task | |
76 | * If this method is called from within a {@link FutureTask}, it | |
77 | * can optionally be passed here. If the execution is expected to | |
78 | * take a long time, the implementation is suggested to | |
79 | * periodically check this parameter for cancellation. | |
80 | * @return The corresponding event render that contains the result of the | |
81 | * query | |
82 | */ | |
83 | TimeGraphDrawnEventRender getEventRender(TimeGraphTreeRender treeRender, | |
84 | TimeRange timeRange, @Nullable FutureTask<?> task); | |
85 | } |