2 * Copyright (C) 2016-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
.ui
.jfx
.testapp
;
12 import java
.util
.Collections
;
13 import java
.util
.List
;
14 import java
.util
.stream
.Collectors
;
15 import java
.util
.stream
.IntStream
;
17 import org
.lttng
.scope
.tmf2
.views
.core
.timegraph
.model
.provider
.TimeGraphModelProvider
;
18 import org
.lttng
.scope
.tmf2
.views
.core
.timegraph
.model
.render
.tree
.TimeGraphTreeElement
;
19 import org
.lttng
.scope
.tmf2
.views
.core
.timegraph
.model
.render
.tree
.TimeGraphTreeRender
;
21 import com
.google
.common
.collect
.ImmutableList
;
23 class TestModelProvider
extends TimeGraphModelProvider
{
25 public static final String ENTRY_NAME_PREFIX
= "Entry #";
27 private static final int NB_ENTRIES
= 20;
29 private static final TimeGraphTreeRender TREE_RENDER
;
32 List
<TimeGraphTreeElement
> treeElements
= IntStream
.range(1, NB_ENTRIES
)
33 .mapToObj(i
-> new TimeGraphTreeElement(ENTRY_NAME_PREFIX
+ i
, Collections
.emptyList()))
34 .collect(Collectors
.toList());
35 TimeGraphTreeElement rootElement
= new TimeGraphTreeElement("Test", treeElements
);
36 TREE_RENDER
= new TimeGraphTreeRender(rootElement
);
39 protected TestModelProvider() {
46 new TestModelStateProvider(),
48 ImmutableList
.of(new TestModelArrowProvider1(), new TestModelArrowProvider2()));
52 public TimeGraphTreeRender
getTreeRender() {