-/*******************************************************************************\r
- * Copyright (c) 2009, 2010 Ericsson\r
- * \r
- * All rights reserved. This program and the accompanying materials are\r
- * made available under the terms of the Eclipse Public License v1.0 which\r
- * accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- * \r
- * Contributors:\r
- * Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation\r
- *******************************************************************************/\r
-package org.eclipse.linuxtools.tmf.ui.widgets.timegraph.test.stub.adaption;\r
-\r
-import java.util.HashMap;\r
-import java.util.Map;\r
-\r
-import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.TimeGraphProvider;\r
-import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent;\r
-import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;\r
-import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.test.stub.model.EventImpl;\r
-import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.test.stub.model.TraceImpl;\r
-\r
-@SuppressWarnings("nls")\r
-public class TsfImplProvider extends TimeGraphProvider {\r
-\r
- // ========================================================================\r
- // Methods\r
- // ========================================================================\r
- @Override\r
- public StateColor getEventColor(ITimeEvent event) {\r
- if (event instanceof EventImpl) {\r
- EventImpl devent = (EventImpl) event;\r
- switch (devent.getType()) {\r
- case ALARM:\r
- return StateColor.DARK_GREEN;\r
- case ERROR:\r
- return StateColor.DARK_YELLOW;\r
- case EVENT:\r
- return StateColor.MAGENTA3;\r
- case INFORMATION:\r
- return StateColor.PURPLE1;\r
- case TIMEADJUSTMENT:\r
- return StateColor.PINK1;\r
- case WARNING:\r
- return StateColor.AQUAMARINE;\r
- case INFO1:\r
- return StateColor.RED;\r
- case INFO2:\r
- return StateColor.GREEN;\r
- case INFO3:\r
- return StateColor.DARK_BLUE;\r
- case INFO4:\r
- return StateColor.GOLD;\r
- case INFO5:\r
- return StateColor.ORANGE;\r
- case INFO6:\r
- return StateColor.GRAY;\r
- case INFO7:\r
- return StateColor.LIGHT_BLUE;\r
- case INFO8:\r
- return StateColor.CADET_BLUE;\r
- case INFO9:\r
- return StateColor.OLIVE;\r
- }\r
- }\r
- return StateColor.BLACK;\r
- }\r
-\r
- @Override\r
- public String getStateName(StateColor color) {\r
- switch (color) {\r
- case GOLD:\r
- return "ALARM";\r
- case RED:\r
- return "ERROR";\r
- case DARK_BLUE:\r
- return "EVENT";\r
- case GREEN:\r
- return "INFORMATION";\r
- case GRAY:\r
- return "TIME ADJUSTMENT DKDKDKDKL";\r
- case ORANGE:\r
- return "WARNING";\r
- default:\r
- return "UNKNOWN";\r
- }\r
- }\r
-\r
- @Override\r
- public Map<String, String> getEventHoverToolTipInfo(ITimeEvent revent) {\r
- Map<String, String> toolTipEventMsgs = new HashMap<String, String>();\r
- if (revent instanceof EventImpl) {\r
- toolTipEventMsgs.put("Test Tip1", "Test Value tip1");\r
- toolTipEventMsgs.put("Test Tip2", "Test Value tip2");\r
- }\r
-\r
- return toolTipEventMsgs;\r
- }\r
-\r
- @Override\r
- public String getEventName(ITimeEvent event, boolean upper, boolean extInfo) {\r
- String name = "Unknown";\r
- if (event instanceof EventImpl) {\r
- EventImpl devent = (EventImpl) event;\r
- name = devent.getType().toString();\r
- }\r
- return name;\r
- }\r
-\r
- @Override\r
- public String getTraceClassName(ITimeGraphEntry trace) {\r
- String name = "";\r
- if (trace instanceof TraceImpl) {\r
- TraceImpl dTrace = (TraceImpl) trace;\r
- name = dTrace.getClassName();\r
- }\r
- return name;\r
- }\r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2009, 2013 Ericsson
+ *
+ * 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
+ *
+ * Contributors:
+ * Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.tmf.ui.widgets.timegraph.test.stub.adaption;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.TimeGraphPresentationProvider;
+import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent;
+import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.test.stub.model.EventImpl;
+
+/**
+ * Time Graph Presentation Provider Stub.
+ */
+public class TsfImplProvider extends TimeGraphPresentationProvider {
+
+ // ========================================================================
+ // Methods
+ // ========================================================================
+ @Override
+ public int getStateTableIndex(ITimeEvent event) {
+ return 0;
+ }
+
+ @Override
+ public Map<String, String> getEventHoverToolTipInfo(ITimeEvent revent) {
+ Map<String, String> toolTipEventMsgs = new HashMap<>();
+ if (revent instanceof EventImpl) {
+ toolTipEventMsgs.put("Test Tip1", "Test Value tip1");
+ toolTipEventMsgs.put("Test Tip2", "Test Value tip2");
+ }
+
+ return toolTipEventMsgs;
+ }
+
+ @Override
+ public String getEventName(ITimeEvent event) {
+ String name = "Unknown";
+ if (event instanceof EventImpl) {
+ EventImpl devent = (EventImpl) event;
+ name = devent.getType().toString();
+ }
+ return name;
+ }
+}