1 /*******************************************************************************
2 * Copyright (c) 2010, 2011 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 * 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
;
16 import org
.eclipse
.linuxtools
.internal
.lttng
.ui
.views
.latency
.AbstractViewer
;
19 * <b><u>TimePointerListener</u></b>
21 * Displays a tooltip showing the approximate values of the point under the mouse cursor.
23 * @author Philippe Sawicki
25 public class TimePointerListener
extends AbstractMouseTrackListener
{
27 // ------------------------------------------------------------------------
29 // ------------------------------------------------------------------------
32 * A reference to the observed view.
34 protected AbstractViewer fView
;
37 * A reference to the HistogramPaintListener.
39 protected GraphPaintListener fGraph
;
41 // ------------------------------------------------------------------------
43 // ------------------------------------------------------------------------
48 * A reference to the observed view.
49 * @param histogramPaintListener
50 * A reference to the histogram's paintListener.
52 public TimePointerListener(AbstractViewer view
, GraphPaintListener graphPaintListener
) {
54 fGraph
= graphPaintListener
;
57 // ------------------------------------------------------------------------
59 // ------------------------------------------------------------------------
63 * @see org.eclipse.linuxtools.lttng.ui.views.latency.listeners.AbstractMouseTrackListener#display()
66 protected void display() {
67 fView
.setToolTipText(fGraph
.formatToolTipLabel(fMouseX
, fMouseY
));