/*******************************************************************************
 * 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.lttng.scope.tmf2.views.core.timegraph.model.render.drawnevents;

import java.util.Collections;
import java.util.Map;
import java.util.function.Supplier;

import org.eclipse.jdt.annotation.Nullable;
import org.lttng.scope.tmf2.views.core.timegraph.model.render.ColorDefinition;
import org.lttng.scope.tmf2.views.core.timegraph.model.render.TimeGraphEvent;

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();
    }
}

@@ -675,16 +675,76 @@
 llable;%0A
+import org.lttng.scope.tmf2.views.core.config.ConfigOption;%0A
 import o
@@ -1002,16 +1002,81 @@
     STAR
+,%0A        BANG,%0A        SQUARE,%0A        DIAMOND,%0A        TRIANGLE
 ;%0A    %7D%0A
@@ -1181,16 +1181,29 @@
 e final 
+ConfigOption%3C
 ColorDef
@@ -1209,16 +1209,17 @@
 finition
+%3E
  fColor;
@@ -1237,16 +1237,29 @@
 e final 
+ConfigOption%3C
 SymbolSt
@@ -1261,16 +1261,17 @@
 bolStyle
+%3E
  fSymbol
@@ -1407,16 +1407,28 @@
 t event,
+%0A           
  String 
@@ -1450,16 +1450,29 @@
         
+ConfigOption%3C
 ColorDef
@@ -1482,16 +1482,42 @@
 tion
+%3E
  color,
- 
+%0A            ConfigOption%3C
 Symb
@@ -1523,16 +1523,17 @@
 bolStyle
+%3E
  style,%0A
@@ -1934,16 +1934,29 @@
  public 
+ConfigOption%3C
 ColorDef
@@ -1962,16 +1962,17 @@
 finition
+%3E
  getColo
@@ -2018,16 +2018,29 @@
  public 
+ConfigOption%3C
 SymbolSt
@@ -2042,16 +2042,17 @@
 bolStyle
+%3E
  getSymb

Use ConfigOptions for some drawn event elements