2 * Copyright (C) 2017 EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com>
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 package org
.lttng
.scope
.tmf2
.views
.core
.timegraph
.model
.provider
.drawnevents
;
12 import java
.util
.concurrent
.FutureTask
;
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
;
21 import javafx
.beans
.property
.BooleanProperty
;
22 import javafx
.beans
.property
.ObjectProperty
;
25 * Interface defining providers of drawn events.
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.
31 * @author Alexandre Montplaisir
32 * @see TimeGraphDrawnEventProviderManager
34 public interface ITimeGraphDrawnEventProvider
{
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
41 * @return The target trace
43 ObjectProperty
<@Nullable ITmfTrace
> traceProperty();
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.
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.
54 * @return The enabled property
56 BooleanProperty
enabledProperty();
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.
63 * @return The event series of this provider
65 TimeGraphDrawnEventSeries
getEventSeries();
68 * Query for a render of drawn events on this provider.
71 * The tree render of the timegraph to paint on
73 * The time range of the timegraph (and trace) to run the query
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
83 TimeGraphDrawnEventRender
getEventRender(TimeGraphTreeRender treeRender
,
84 TimeRange timeRange
, @Nullable FutureTask
<?
> task
);