Import "views" plugins
[deliverable/tracecompass.git] / tmf / org.lttng.scope.tmf2.views.core / src / org / lttng / scope / tmf2 / views / core / timegraph / model / render / states / MultiStateInterval.java
diff --git a/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/timegraph/model/render/states/MultiStateInterval.java b/tmf/org.lttng.scope.tmf2.views.core/src/org/lttng/scope/tmf2/views/core/timegraph/model/render/states/MultiStateInterval.java
new file mode 100644 (file)
index 0000000..4610fc0
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2017 EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com>
+ *
+ * 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.states;
+
+import java.util.Collections;
+
+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.LineThickness;
+import org.lttng.scope.tmf2.views.core.timegraph.model.render.tree.TimeGraphTreeElement;
+
+/**
+ * Dummy interval model object representing a "multi-state", which means a case
+ * where more than one state exists for a given pixel.
+ *
+ * @author Alexandre Montplaisir
+ */
+public final class MultiStateInterval extends BasicTimeGraphStateInterval {
+
+    /** Configuration option for the line thickness of multi-state intervals */
+    public static final ConfigOption<LineThickness> MULTI_STATE_THICKNESS_OPTION = new ConfigOption<>(LineThickness.NORMAL);
+
+    private static final String MULTI_STATE_NAME = "Multi-state"; //$NON-NLS-1$
+    private static final ColorDefinition MULTI_STATE_COLOR = new ColorDefinition(0, 0, 0);
+    private static final ConfigOption<ColorDefinition> MULTI_STATE_COLOR_OPTION = new ConfigOption<>(MULTI_STATE_COLOR);
+
+    /**
+     * Constructor
+     *
+     * @param startTime
+     *            Start time
+     * @param endTime
+     *            End time
+     * @param treeElement
+     *            The tree element to which this interval is associated
+     */
+    public MultiStateInterval(long startTime, long endTime, TimeGraphTreeElement treeElement) {
+        super(startTime,
+                endTime,
+                treeElement,
+                MULTI_STATE_NAME,
+                /* Label */
+                null,
+                MULTI_STATE_COLOR_OPTION,
+                MULTI_STATE_THICKNESS_OPTION,
+                Collections.emptyMap());
+    }
+
+    @Override
+    public boolean isMultiState() {
+        return true;
+    }
+
+}
This page took 0.023331 seconds and 5 git commands to generate.