<commit_before>/*******************************************************************************
 * Copyright (c) 2016 EfficiOS Inc., <NAME>
 *
 * 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();
    }
}<commit_msg>timegraph: Use ConfigOptions for some drawn event elements<commit_after>/*******************************************************************************
 * Copyright (c) 2016 EfficiOS Inc., <NAME>
 *
 * 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.config.ConfigOption;
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,
        BANG,
        SQUARE,
        DIAMOND,
        TRIANGLE;
    }

    private final TimeGraphEvent fTimeGraphEvent;
    private final String fEventName;
    private final ConfigOption<ColorDefinition> fColor;
    private final ConfigOption<SymbolStyle> fSymbolStyle;
    private final @Nullable Supplier<Map<String, String>> fPropertySupplier;

    public TimeGraphDrawnEvent(TimeGraphEvent event,
            String eventName,
            ConfigOption<ColorDefinition> color,
            ConfigOption<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 ConfigOption<ColorDefinition> getColor() {
        return fColor;
    }

    public ConfigOption<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();
    }
}
{'fraction_non_alphanumeric': 0.1469288555015466, 'fraction_numerical': 0.005081749889527177, 'mean_word_length': 3.340364333652924, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1470836', 'n_tokens_mistral': 1239, 'n_tokens_neox': 1192, 'n_words': 293}