Commit | Line | Data |
---|---|---|
34313553 | 1 | /******************************************************************************* |
c8422608 | 2 | * Copyright (c) 2009, 2012 Ericsson |
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 | |
12 | *******************************************************************************/ | |
13 | ||
14 | package org.eclipse.linuxtools.tmf.ui.widgets.timegraph; | |
15 | ||
16 | import java.util.Map; | |
17 | ||
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; | |
24 | ||
25 | /** | |
26 | * Provider class for the time graph provider | |
27 | * | |
28 | * @version 1.0 | |
29 | * @author Patrick Tasse | |
30 | * | |
31 | */ | |
32 | public class TimeGraphPresentationProvider implements ITimeGraphPresentationProvider { | |
33 | ||
34 | // ------------------------------------------------------------------------ | |
35 | // Constants | |
36 | // ------------------------------------------------------------------------ | |
37 | private static final int DEFAULT_ITEM_HEIGHT = 19; | |
38 | ||
39 | // ------------------------------------------------------------------------ | |
40 | // Operations | |
41 | // ------------------------------------------------------------------------ | |
42 | ||
43 | /* | |
44 | * (non-Javadoc) | |
45 | * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getStateTypeName() | |
46 | */ | |
47 | @Override | |
48 | public String getStateTypeName() { | |
49 | return Messages.TmfTimeLegend_TRACE_STATES; | |
50 | } | |
51 | ||
52 | /** | |
53 | * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getStateTypeName(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry) | |
54 | * @since 2.0 | |
55 | */ | |
56 | @Override | |
57 | public String getStateTypeName(ITimeGraphEntry entry) { | |
58 | return null; | |
59 | } | |
60 | /* | |
61 | * (non-Javadoc) | |
62 | * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getStateTable() | |
63 | */ | |
64 | @Override | |
65 | public StateItem[] getStateTable() { | |
66 | return null; | |
67 | } | |
68 | ||
69 | /* | |
70 | * (non-Javadoc) | |
71 | * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getEventTableIndex(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent) | |
72 | */ | |
73 | @Override | |
74 | public int getStateTableIndex(ITimeEvent event) { | |
75 | return 0; | |
76 | } | |
77 | ||
78 | /* | |
79 | * (non-Javadoc) | |
80 | * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#postDrawControl(org.eclipse.swt.graphics.Rectangle, org.eclipse.swt.graphics.GC) | |
81 | */ | |
82 | @Override | |
83 | public void postDrawControl(Rectangle bounds, GC gc) { | |
84 | // Override to add own drawing code | |
85 | } | |
86 | ||
87 | /* | |
88 | * (non-Javadoc) | |
89 | * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#postDrawEntry(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry, org.eclipse.swt.graphics.Rectangle, org.eclipse.swt.graphics.GC) | |
90 | */ | |
91 | @Override | |
92 | public void postDrawEntry(ITimeGraphEntry entry, Rectangle bounds, GC gc) { | |
93 | // Override to add own drawing code | |
94 | } | |
95 | ||
96 | /* | |
97 | * (non-Javadoc) | |
98 | * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#postDrawEvent(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent, org.eclipse.swt.graphics.Rectangle, org.eclipse.swt.graphics.GC) | |
99 | */ | |
100 | @Override | |
101 | public void postDrawEvent(ITimeEvent event, Rectangle bounds, GC gc) { | |
102 | // Override to add own drawing code | |
103 | } | |
104 | ||
105 | /* | |
106 | * (non-Javadoc) | |
107 | * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getItemHeight(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry) | |
108 | */ | |
109 | @Override | |
110 | public int getItemHeight(ITimeGraphEntry entry) { | |
111 | return DEFAULT_ITEM_HEIGHT; | |
112 | } | |
113 | ||
114 | /* | |
115 | * (non-Javadoc) | |
116 | * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getItemImage(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry) | |
117 | */ | |
118 | @Override | |
119 | public Image getItemImage(ITimeGraphEntry entry) { | |
120 | return null; | |
121 | } | |
122 | ||
123 | /* | |
124 | * (non-Javadoc) | |
125 | * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getEventName(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent) | |
126 | */ | |
127 | @Override | |
128 | public String getEventName(ITimeEvent event) { | |
129 | return null; | |
130 | } | |
131 | ||
132 | /* | |
133 | * (non-Javadoc) | |
134 | * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getEventHoverToolTipInfo(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent) | |
135 | */ | |
136 | @Override | |
137 | public Map<String, String> getEventHoverToolTipInfo(ITimeEvent event) { | |
138 | return null; | |
139 | } | |
140 | ||
141 | /* (non-Javadoc) | |
142 | * @see org.eclipse.linuxtools.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider#getEventHoverToolTipInfo(org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent, long) | |
143 | */ | |
144 | /** | |
145 | * @since 2.0 | |
146 | */ | |
147 | @Override | |
148 | public Map<String, String> getEventHoverToolTipInfo(ITimeEvent event, long hoverTime) { | |
149 | return getEventHoverToolTipInfo(event); | |
150 | } | |
151 | ||
b83af2c3 | 152 | } |