1 /*******************************************************************************
2 * Copyright (c) 2009, 2010 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation
11 *******************************************************************************/
12 package org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timeAnalysis
.test
.stub
.adaption
;
14 import java
.util
.HashMap
;
17 import org
.eclipse
.linuxtools
.tmf
.ui
.viewers
.timeAnalysis
.TmfTimeAnalysisProvider
;
18 import org
.eclipse
.linuxtools
.tmf
.ui
.viewers
.timeAnalysis
.model
.ITimeEvent
;
19 import org
.eclipse
.linuxtools
.tmf
.ui
.viewers
.timeAnalysis
.model
.ITmfTimeAnalysisEntry
;
20 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timeAnalysis
.test
.stub
.model
.EventImpl
;
21 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timeAnalysis
.test
.stub
.model
.TraceImpl
;
23 @SuppressWarnings("nls")
24 public class TsfImplProvider
extends TmfTimeAnalysisProvider
{
26 // ========================================================================
28 // ========================================================================
30 public StateColor
getEventColor(ITimeEvent event
) {
31 if (event
instanceof EventImpl
) {
32 EventImpl devent
= (EventImpl
) event
;
33 switch (devent
.getType()) {
35 return StateColor
.DARK_GREEN
;
37 return StateColor
.DARK_YELLOW
;
39 return StateColor
.MAGENTA3
;
41 return StateColor
.PURPLE1
;
43 return StateColor
.PINK1
;
45 return StateColor
.AQUAMARINE
;
47 return StateColor
.RED
;
49 return StateColor
.GREEN
;
51 return StateColor
.DARK_BLUE
;
53 return StateColor
.GOLD
;
55 return StateColor
.ORANGE
;
57 return StateColor
.GRAY
;
59 return StateColor
.LIGHT_BLUE
;
61 return StateColor
.CADET_BLUE
;
63 return StateColor
.OLIVE
;
66 return StateColor
.BLACK
;
70 public String
getStateName(StateColor color
) {
81 return "TIME ADJUSTMENT DKDKDKDKL";
90 public Map
<String
, String
> getEventHoverToolTipInfo(ITimeEvent revent
) {
91 Map
<String
, String
> toolTipEventMsgs
= new HashMap
<String
, String
>();
92 if (revent
instanceof EventImpl
) {
93 toolTipEventMsgs
.put("Test Tip1", "Test Value tip1");
94 toolTipEventMsgs
.put("Test Tip2", "Test Value tip2");
97 return toolTipEventMsgs
;
101 public String
getEventName(ITimeEvent event
, boolean upper
, boolean extInfo
) {
102 String name
= "Unknown";
103 name
= upper ? name
: name
;
104 if (event
instanceof EventImpl
) {
105 EventImpl devent
= (EventImpl
) event
;
106 name
= devent
.getType().toString();
112 public String
getTraceClassName(ITmfTimeAnalysisEntry trace
) {
114 if (trace
instanceof TraceImpl
) {
115 TraceImpl dTrace
= (TraceImpl
) trace
;
116 name
= dTrace
.getClassName();