Merge branch 'master' into lttng-luna
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / widgets / timegraph / TimeGraphPresentationProvider.java
CommitLineData
34313553 1/*******************************************************************************
4999a196 2 * Copyright (c) 2009, 2013 Ericsson, École Polytechnique de Montréal
34313553
PT
3 *
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
8 *
9 * Contributors:
10 * Alvaro Sanchez-Leon - Initial API and implementation
11 * Patrick Tasse - Refactoring
4999a196 12 * Geneviève Bastien - Add drawing helper methods
34313553
PT
13 *******************************************************************************/
14
15package org.eclipse.linuxtools.tmf.ui.widgets.timegraph;
16
17import java.util.Map;
18
19import org.eclipse.linuxtools.internal.tmf.ui.Messages;
20import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent;
21import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;
4999a196 22import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.ITmfTimeGraphDrawingHelper;
34313553
PT
23import org.eclipse.swt.graphics.GC;
24import org.eclipse.swt.graphics.Image;
25import org.eclipse.swt.graphics.Rectangle;
26
27/**
28 * Provider class for the time graph provider
29 *
30 * @version 1.0
31 * @author Patrick Tasse
32 *
33 */
4999a196
GB
34public class TimeGraphPresentationProvider implements ITimeGraphPresentationProvider2 {
35
36 private ITmfTimeGraphDrawingHelper fDrawingHelper;
37 private final String fStateTypeName;
34313553
PT
38
39 // ------------------------------------------------------------------------
40 // Constants
41 // ------------------------------------------------------------------------
42 private static final int DEFAULT_ITEM_HEIGHT = 19;
43
44 // ------------------------------------------------------------------------
45 // Operations
46 // ------------------------------------------------------------------------
47
4999a196
GB
48 /**
49 * Constructor
50 * @param stateTypeName The state type name
51 * @since 2.1
52 */
53 public TimeGraphPresentationProvider(String stateTypeName) {
54 fStateTypeName = stateTypeName;
55 }
56
57 /**
58 * Constructor
59 * @since 2.1
60 */
61 public TimeGraphPresentationProvider() {
62 this(Messages.TmfTimeLegend_TRACE_STATES);
63 }
64
34313553
PT
65 @Override
66 public String getStateTypeName() {
4999a196 67 return fStateTypeName;
34313553
PT
68 }
69
70 /**
71 * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getStateTypeName(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry)
72 * @since 2.0
73 */
74 @Override
75 public String getStateTypeName(ITimeGraphEntry entry) {
76 return null;
77 }
11252342 78
34313553
PT
79 @Override
80 public StateItem[] getStateTable() {
81 return null;
82 }
83
34313553
PT
84 @Override
85 public int getStateTableIndex(ITimeEvent event) {
86 return 0;
87 }
88
4999a196
GB
89 /**
90 * @since 2.1
91 */
92 @Override
93 public ITmfTimeGraphDrawingHelper getDrawingHelper() {
94 return fDrawingHelper;
95 }
96
97 /**
98 * @since 2.1
99 */
100 @Override
101 public void setDrawingHelper(ITmfTimeGraphDrawingHelper helper) {
102 fDrawingHelper = helper;
103 }
104
34313553
PT
105 @Override
106 public void postDrawControl(Rectangle bounds, GC gc) {
107 // Override to add own drawing code
108 }
109
34313553
PT
110 @Override
111 public void postDrawEntry(ITimeGraphEntry entry, Rectangle bounds, GC gc) {
112 // Override to add own drawing code
113 }
114
34313553
PT
115 @Override
116 public void postDrawEvent(ITimeEvent event, Rectangle bounds, GC gc) {
117 // Override to add own drawing code
118 }
119
34313553
PT
120 @Override
121 public int getItemHeight(ITimeGraphEntry entry) {
122 return DEFAULT_ITEM_HEIGHT;
123 }
124
34313553
PT
125 @Override
126 public Image getItemImage(ITimeGraphEntry entry) {
127 return null;
128 }
129
34313553
PT
130 @Override
131 public String getEventName(ITimeEvent event) {
132 return null;
133 }
134
34313553
PT
135 @Override
136 public Map<String, String> getEventHoverToolTipInfo(ITimeEvent event) {
137 return null;
138 }
139
34313553
PT
140 /**
141 * @since 2.0
142 */
143 @Override
144 public Map<String, String> getEventHoverToolTipInfo(ITimeEvent event, long hoverTime) {
145 return getEventHoverToolTipInfo(event);
146 }
147
b83af2c3 148}
This page took 0.041625 seconds and 5 git commands to generate.