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
CommitLineData
6e512b93
ASL
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
f05aabed
FC
11 *
12 * Modifications:
13 * 2010-07-16 Yuriy Vashchuk - Heritage corrections.
6e512b93
ASL
14 *******************************************************************************/
15package org.eclipse.linuxtools.lttng.ui.views.histogram;
16
17import org.eclipse.swt.events.FocusEvent;
18import 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 */
26public class HistogramCanvasFocusListener implements FocusListener {
27
f05aabed 28 private HistogramCanvas ourCanvas = null;
6e512b93
ASL
29
30 /**
31 * HistogramCanvasFocusListener constructor
32 *
33 * @param newCanvas Related canvas
34 */
35 public HistogramCanvasFocusListener(HistogramCanvas newCanvas) {
f05aabed 36 ourCanvas = newCanvas;
6e512b93
ASL
37 }
38
39 /**
40 * Function that is called when the canvas get focus.<p>
41 *
050df4a5 42 * Redraw the screen to make sure everything is sane.
6e512b93
ASL
43 *
44 * @param event The focus event generated.
45 */
d4011df2 46 @Override
6e512b93 47 public void focusGained(FocusEvent event) {
f05aabed 48 ourCanvas.redrawAsynchronously();
6e512b93
ASL
49 }
50
51 /**
544fe9b7 52 * Function that is called when the canvas loose focus.<p>
6e512b93
ASL
53 *
54 * Doesn't do anything yet...
55 *
56 * @param event The focus event generated.
57 */
d4011df2 58 @Override
6e512b93 59 public void focusLost(FocusEvent event) {
544fe9b7 60 // Nothing to do yet
6e512b93
ASL
61 }
62
63}
This page took 0.029481 seconds and 5 git commands to generate.