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.states; | |
11 | ||
12 | import java.util.List; | |
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.timegraph.model.render.StateDefinition; | |
17 | ||
18 | import com.google.common.collect.ImmutableList; | |
19 | ||
20 | import javafx.beans.property.ObjectProperty; | |
21 | import javafx.beans.property.SimpleObjectProperty; | |
22 | ||
23 | /** | |
24 | * Basic implementation of {@link ITimeGraphModelStateProvider}. | |
25 | * | |
26 | * @author Alexandre Montplaisir | |
27 | */ | |
28 | public abstract class TimeGraphModelStateProvider implements ITimeGraphModelStateProvider { | |
29 | ||
30 | private final ObjectProperty<@Nullable ITmfTrace> fTraceProperty = new SimpleObjectProperty<>(null); | |
31 | ||
32 | private final List<StateDefinition> fStateDefinitions; | |
33 | ||
34 | /** | |
35 | * Constructor | |
36 | * | |
37 | * @param stateDefinitions | |
38 | * The state definitions used in this provider | |
39 | */ | |
40 | public TimeGraphModelStateProvider(List<StateDefinition> stateDefinitions) { | |
41 | fStateDefinitions = ImmutableList.copyOf(stateDefinitions); | |
42 | } | |
43 | ||
44 | @Override | |
45 | public ObjectProperty<@Nullable ITmfTrace> traceProperty() { | |
46 | return fTraceProperty; | |
47 | } | |
48 | ||
49 | @Override | |
50 | public List<StateDefinition> getStateDefinitions() { | |
51 | return fStateDefinitions; | |
52 | } | |
53 | ||
54 | } |