Commit | Line | Data |
---|---|---|
739b9fec AM |
1 | /******************************************************************************* |
2 | * Copyright (c) 2016 EfficiOS Inc., Alexandre Montplaisir | |
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.eclipse.tracecompass.internal.provisional.tmf.core.views.timegraph2; | |
11 | ||
12 | import java.util.Collections; | |
13 | import java.util.Map; | |
14 | import java.util.function.Supplier; | |
15 | ||
16 | import org.eclipse.jdt.annotation.Nullable; | |
17 | ||
18 | public class TimeGraphDrawnEvent { | |
19 | ||
20 | public enum SymbolStyle { | |
21 | CIRCLE, | |
22 | CROSS, | |
23 | STAR; | |
24 | } | |
25 | ||
26 | private final TimeGraphEvent fTimeGraphEvent; | |
27 | private final String fEventName; | |
28 | private final ColorDefinition fColor; | |
29 | private final SymbolStyle fSymbolStyle; | |
30 | private final @Nullable Supplier<Map<String, String>> fPropertySupplier; | |
31 | ||
32 | public TimeGraphDrawnEvent(TimeGraphEvent event, String eventName, | |
33 | ColorDefinition color, SymbolStyle style, | |
34 | @Nullable Supplier<Map<String, String>> propertySupplier) { | |
35 | fTimeGraphEvent = event; | |
36 | fEventName = eventName; | |
37 | fColor = color; | |
38 | fSymbolStyle = style; | |
39 | fPropertySupplier = propertySupplier; | |
40 | } | |
41 | ||
42 | public TimeGraphEvent getEvent() { | |
43 | return fTimeGraphEvent; | |
44 | } | |
45 | ||
46 | public String getEventName() { | |
47 | return fEventName; | |
48 | } | |
49 | ||
50 | public ColorDefinition getColor() { | |
51 | return fColor; | |
52 | } | |
53 | ||
54 | public SymbolStyle getSymbolStyle() { | |
55 | return fSymbolStyle; | |
56 | } | |
57 | ||
58 | public Map<String, String> getProperties() { | |
59 | Supplier<Map<String, String>> supplier = fPropertySupplier; | |
60 | if (supplier == null) { | |
61 | return Collections.EMPTY_MAP; | |
62 | } | |
63 | return supplier.get(); | |
64 | } | |
65 | } |