1 /*******************************************************************************
2 * Copyright (c) 2009, 2013 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 - Initial API and implementation
11 * Patrick Tasse - Refactoring
12 *******************************************************************************/
14 package org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
;
18 import org
.eclipse
.linuxtools
.internal
.tmf
.ui
.Messages
;
19 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.model
.ITimeEvent
;
20 import org
.eclipse
.linuxtools
.tmf
.ui
.widgets
.timegraph
.model
.ITimeGraphEntry
;
21 import org
.eclipse
.swt
.graphics
.GC
;
22 import org
.eclipse
.swt
.graphics
.Image
;
23 import org
.eclipse
.swt
.graphics
.Rectangle
;
26 * Provider class for the time graph provider
29 * @author Patrick Tasse
32 public class TimeGraphPresentationProvider
implements ITimeGraphPresentationProvider
{
34 // ------------------------------------------------------------------------
36 // ------------------------------------------------------------------------
37 private static final int DEFAULT_ITEM_HEIGHT
= 19;
39 // ------------------------------------------------------------------------
41 // ------------------------------------------------------------------------
44 public String
getStateTypeName() {
45 return Messages
.TmfTimeLegend_TRACE_STATES
;
49 * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getStateTypeName(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry)
53 public String
getStateTypeName(ITimeGraphEntry entry
) {
58 public StateItem
[] getStateTable() {
63 public int getStateTableIndex(ITimeEvent event
) {
68 public void postDrawControl(Rectangle bounds
, GC gc
) {
69 // Override to add own drawing code
73 public void postDrawEntry(ITimeGraphEntry entry
, Rectangle bounds
, GC gc
) {
74 // Override to add own drawing code
78 public void postDrawEvent(ITimeEvent event
, Rectangle bounds
, GC gc
) {
79 // Override to add own drawing code
83 public int getItemHeight(ITimeGraphEntry entry
) {
84 return DEFAULT_ITEM_HEIGHT
;
88 public Image
getItemImage(ITimeGraphEntry entry
) {
93 public String
getEventName(ITimeEvent event
) {
98 public Map
<String
, String
> getEventHoverToolTipInfo(ITimeEvent event
) {
106 public Map
<String
, String
> getEventHoverToolTipInfo(ITimeEvent event
, long hoverTime
) {
107 return getEventHoverToolTipInfo(event
);