648b5da6a99b8cfe783c0f0f3e95a3168af17640
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / widgets / timegraph / ITimeGraphPresentationProvider.java
1 /*******************************************************************************
2 * Copyright (c) 2012 Ericsson
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 * Patrick Tasse - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.ui.widgets.timegraph;
14
15 import java.util.Map;
16
17 import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent;
18 import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;
19 import org.eclipse.swt.graphics.GC;
20 import org.eclipse.swt.graphics.Image;
21 import org.eclipse.swt.graphics.Rectangle;
22
23 /**
24 * Interface for the time graph widget provider
25 *
26 * @version 1.0
27 * @author Patrick Tasse
28 */
29 public interface ITimeGraphPresentationProvider {
30
31 /**
32 * Returns the name of state types.
33 *
34 * @return the name of state types
35 */
36 public String getStateTypeName();
37
38 /**
39 * Returns table of states with state name to state color relationship.
40 *
41 * @return table of states with color and name
42 *
43 * @see #getStateTableIndex
44 */
45 public StateItem[] getStateTable();
46
47 /**
48 * Returns the index in the state table corresponding to this time event.
49 * The index should correspond to a state in the state table,
50 * otherwise the color SWT.COLOR_BLACK will be used.
51 * If the index returned is negative, the event will not be drawn.
52 *
53 * @param event the time event
54 * @return the corresponding state table index
55 *
56 * @see #getStateTable
57 */
58 public int getStateTableIndex(ITimeEvent event);
59
60 /**
61 * Called after drawing the control
62 *
63 * @param bounds
64 * The drawing rectangle
65 * @param gc
66 * The graphics context
67 */
68 public void postDrawControl(Rectangle bounds, GC gc);
69
70 /**
71 * Called after drawing an entry
72 *
73 * @param entry
74 * the entry that was drawn
75 * @param bounds
76 * the drawing rectangle
77 * @param gc
78 * the graphics context
79 */
80 public void postDrawEntry(ITimeGraphEntry entry, Rectangle bounds, GC gc);
81
82 /**
83 * Called after drawing an event
84 *
85 * @param event
86 * the event that was drawn
87 * @param bounds
88 * the drawing rectangle
89 * @param gc
90 * the graphics context
91 */
92 public void postDrawEvent(ITimeEvent event, Rectangle bounds, GC gc);
93
94 /**
95 * Returns the height of this item. This value is ignored if the time graph has a fixed item height.
96 *
97 * @param entry the entry
98 * @return the item height
99 *
100 * @see TimeGraphViewer#setItemHeight
101 */
102 public int getItemHeight(ITimeGraphEntry entry);
103
104 /**
105 * Provides the image icon for a given entry.
106 *
107 * @param entry the entry
108 * @return the image icon
109 */
110 public Image getItemImage(ITimeGraphEntry entry);
111
112 /**
113 * Returns the name of this event.
114 *
115 * @param event
116 * The event
117 * @return The event name
118 */
119 public String getEventName(ITimeEvent event);
120
121 /**
122 * Returns a map of name and value providing additional information
123 * to display in the tool tip for this event.
124 *
125 * @param event the time event
126 * @return a map of tool tip information
127 */
128 public Map<String, String> getEventHoverToolTipInfo(ITimeEvent event);
129
130 }
This page took 0.055081 seconds and 4 git commands to generate.