Internalize lttng.ui APIs
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.ui / src / org / eclipse / linuxtools / internal / lttng / ui / views / latency / listeners / TimePointerListener.java
1 /*******************************************************************************
2 * Copyright (c) 2010, 2011 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 * Philippe Sawicki (INF4990.A2010@gmail.com) - Initial API and implementation
11 * Mathieu Denis (mathieu.denis55@gmail.com) - Refactored code
12 * Bernd Hufmann - Changed display interface implementation
13 *******************************************************************************/
14 package org.eclipse.linuxtools.internal.lttng.ui.views.latency.listeners;
15
16 import org.eclipse.linuxtools.internal.lttng.ui.views.latency.AbstractViewer;
17
18 /**
19 * <b><u>TimePointerListener</u></b>
20 * <p>
21 * Displays a tooltip showing the approximate values of the point under the mouse cursor.
22 *
23 * @author Philippe Sawicki
24 */
25 public class TimePointerListener extends AbstractMouseTrackListener {
26
27 // ------------------------------------------------------------------------
28 // Attributes
29 // ------------------------------------------------------------------------
30
31 /**
32 * A reference to the observed view.
33 */
34 protected AbstractViewer fView;
35
36 /**
37 * A reference to the HistogramPaintListener.
38 */
39 protected GraphPaintListener fGraph;
40
41 // ------------------------------------------------------------------------
42 // Constructors
43 // ------------------------------------------------------------------------
44
45 /**
46 * Constructor.
47 * @param view
48 * A reference to the observed view.
49 * @param histogramPaintListener
50 * A reference to the histogram's paintListener.
51 */
52 public TimePointerListener(AbstractViewer view, GraphPaintListener graphPaintListener) {
53 fView = view;
54 fGraph = graphPaintListener;
55 }
56
57 // ------------------------------------------------------------------------
58 // Operations
59 // ------------------------------------------------------------------------
60
61 /*
62 * (non-Javadoc)
63 * @see org.eclipse.linuxtools.lttng.ui.views.latency.listeners.AbstractMouseTrackListener#display()
64 */
65 @Override
66 protected void display() {
67 fView.setToolTipText(fGraph.formatToolTipLabel(fMouseX, fMouseY));
68 }
69 }
This page took 0.031365 seconds and 5 git commands to generate.