Commit | Line | Data |
---|---|---|
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 | *******************************************************************************/ |
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 | ||
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 | } |