[WIP] CFV Refactor
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / internal / provisional / tmf / core / views / timegraph2 / TimeGraphDrawnEvent.java
diff --git a/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/provisional/tmf/core/views/timegraph2/TimeGraphDrawnEvent.java b/tmf/org.eclipse.tracecompass.tmf.core/src/org/eclipse/tracecompass/internal/provisional/tmf/core/views/timegraph2/TimeGraphDrawnEvent.java
new file mode 100644 (file)
index 0000000..7a9f6f0
--- /dev/null
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2016 EfficiOS Inc., Alexandre Montplaisir
+ *
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.internal.provisional.tmf.core.views.timegraph2;
+
+import java.util.Collections;
+import java.util.Map;
+import java.util.function.Supplier;
+
+import org.eclipse.jdt.annotation.Nullable;
+
+public class TimeGraphDrawnEvent {
+
+    public enum SymbolStyle {
+        CIRCLE,
+        CROSS,
+        STAR;
+    }
+
+    private final TimeGraphEvent fTimeGraphEvent;
+    private final String fEventName;
+    private final ColorDefinition fColor;
+    private final SymbolStyle fSymbolStyle;
+    private final @Nullable Supplier<Map<String, String>> fPropertySupplier;
+
+    public TimeGraphDrawnEvent(TimeGraphEvent event, String eventName,
+            ColorDefinition color, SymbolStyle style,
+            @Nullable Supplier<Map<String, String>> propertySupplier) {
+        fTimeGraphEvent = event;
+        fEventName = eventName;
+        fColor = color;
+        fSymbolStyle = style;
+        fPropertySupplier = propertySupplier;
+    }
+
+    public TimeGraphEvent getEvent() {
+        return fTimeGraphEvent;
+    }
+
+    public String getEventName() {
+        return fEventName;
+    }
+
+    public ColorDefinition getColor() {
+        return fColor;
+    }
+
+    public SymbolStyle getSymbolStyle() {
+        return fSymbolStyle;
+    }
+
+    public Map<String, String> getProperties() {
+        Supplier<Map<String, String>> supplier = fPropertySupplier;
+        if (supplier == null) {
+            return Collections.EMPTY_MAP;
+        }
+        return supplier.get();
+    }
+}
This page took 0.026506 seconds and 5 git commands to generate.