2010-10-26 Francois Chouinard <fchouinard@gmail.com> Contribution for Bug309042
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.ui / src / org / eclipse / linuxtools / lttng / ui / views / histogram / HistogramCanvasFocusListener.java
1 /*******************************************************************************
2 * Copyright (c) 2009 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 * William Bourque - Initial API and implementation
11 *
12 * Modifications:
13 * 2010-07-16 Yuriy Vashchuk - Heritage corrections.
14 *******************************************************************************/
15 package org.eclipse.linuxtools.lttng.ui.views.histogram;
16
17 import org.eclipse.swt.events.FocusEvent;
18 import org.eclipse.swt.events.FocusListener;
19
20 /**
21 * <b><u>HistogramCanvasFocusListener</u></b>
22 * <p>
23 * Implementation of a FocusListener for the need of the HistogramCanvas
24 * <p>
25 */
26 public class HistogramCanvasFocusListener implements FocusListener {
27
28 private HistogramCanvas ourCanvas = null;
29
30 /**
31 * HistogramCanvasFocusListener constructor
32 *
33 * @param newCanvas Related canvas
34 */
35 public HistogramCanvasFocusListener(HistogramCanvas newCanvas) {
36 ourCanvas = newCanvas;
37 }
38
39 /**
40 * Function that is called when the canvas get focus.<p>
41 *
42 * Redraw the screen to make sure everything is sane.
43 *
44 * @param event The focus event generated.
45 */
46 @Override
47 public void focusGained(FocusEvent event) {
48 ourCanvas.redrawAsynchronously();
49 }
50
51 /**
52 * Function that is called when the canvas loose focus.<p>
53 *
54 * Doesn't do anything yet...
55 *
56 * @param event The focus event generated.
57 */
58 @Override
59 public void focusLost(FocusEvent event) {
60 // Nothing to do yet
61 }
62
63 }
This page took 0.030726 seconds and 5 git commands to generate.