1 /*******************************************************************************
2 * Copyright (c) 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 * Bernd Hufmann - Initial API and implementation
11 *******************************************************************************/
12 package org
.eclipse
.linuxtools
.lttng
.ui
.views
.latency
.listeners
;
14 import org
.eclipse
.linuxtools
.lttng
.ui
.views
.latency
.GraphViewer
;
15 import org
.eclipse
.linuxtools
.lttng
.ui
.views
.latency
.model
.LatencyGraphModel
;
18 * <b><u>GraphMouseListener</u></b>
21 public class GraphMouseListener
extends AbstractMouseListener
{
23 // ------------------------------------------------------------------------
25 // ------------------------------------------------------------------------
28 * A reference to the observed view.
30 protected GraphViewer fView
;
33 * A reference to the HistogramPaintListener.
35 protected GraphPaintListener fGraph
;
37 // ------------------------------------------------------------------------
39 // ------------------------------------------------------------------------
44 * A reference to the observed view.
45 * @param histogramPaintListener
46 * A reference to the histogram's paintListener.
48 public GraphMouseListener(GraphViewer view
, GraphPaintListener graphPaintListener
) {
50 fGraph
= graphPaintListener
;
53 // ------------------------------------------------------------------------
55 // ------------------------------------------------------------------------
57 // ------------------------------------------------------------------------
59 // ------------------------------------------------------------------------
63 * @see org.eclipse.linuxtools.lttng.ui.views.latency.listeners.AbstractMouseListener#display()
66 protected void display() {
67 long currentTime
= fGraph
.getCurrentTimeFromHorizontalValue(fMouseX
);
68 ((LatencyGraphModel
)fView
.getModel()).setCurrentEventNotifyListeners(currentTime
);