tmf/lttng: Remove unneeded (non-Javadoc) comments
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / histogram / TimeRangeHistogram.java
CommitLineData
c392540b 1/*******************************************************************************
11252342 2 * Copyright (c) 2011, 2013 Ericsson
f8177ba2 3 *
c392540b
FC
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
f8177ba2 8 *
c392540b
FC
9 * Contributors:
10 * Francois Chouinard - Initial API and implementation
f8177ba2 11 * Bernd Hufmann - Changed to updated histogram data model
e0752744 12 * Francois Chouinard - Moved from LTTng to TMF
c392540b
FC
13 *******************************************************************************/
14
e0752744 15package org.eclipse.linuxtools.tmf.ui.views.histogram;
c392540b
FC
16
17import org.eclipse.swt.widgets.Composite;
18
19/**
f8177ba2 20 * A basic histogram widget that displays the event distribution of a specific time range of a trace.
d26274e7 21 * It has the following additional features:
c392540b
FC
22 * <ul>
23 * <li>zoom in: mouse wheel up (or forward)
24 * <li>zoom out: mouse wheel down (or backward)
25 * </ul>
f8177ba2
FC
26 *
27 * @version 1.1
b544077e 28 * @author Francois Chouinard
c392540b
FC
29 */
30public class TimeRangeHistogram extends Histogram {
31
32 // ------------------------------------------------------------------------
33 // Attributes
34 // ------------------------------------------------------------------------
35
b544077e 36 private HistogramZoom fZoom = null;
c392540b
FC
37
38 // ------------------------------------------------------------------------
39 // Constructor
40 // ------------------------------------------------------------------------
b544077e 41 /**
f8177ba2 42 * Constructor
b544077e
BH
43 * @param view The parent histogram view
44 * @param parent The parent composite
45 */
c392540b
FC
46 public TimeRangeHistogram(HistogramView view, Composite parent) {
47 super(view, parent);
48 fZoom = new HistogramZoom(this, fCanvas, getStartTime(), getTimeLimit());
49 }
50
51 // ------------------------------------------------------------------------
52 // Operations
53 // ------------------------------------------------------------------------
54
55 @Override
56 public void updateTimeRange(long startTime, long endTime) {
57 ((HistogramView) fParentView).updateTimeRange(startTime, endTime);
58 }
59
60 @Override
61 public synchronized void clear() {
f8177ba2 62 if (fZoom != null) {
1be49d83
PT
63 fZoom.setFullRange(0L, 0L);
64 fZoom.setNewRange(0L, 0L);
f8177ba2 65 }
c392540b
FC
66 super.clear();
67 }
68
b544077e
BH
69 /**
70 * Sets the time range of the histogram
f8177ba2 71 * @param startTime The start time
b544077e
BH
72 * @param duration The duration of the time range
73 */
c392540b
FC
74 public synchronized void setTimeRange(long startTime, long duration) {
75 fZoom.setNewRange(startTime, duration);
15844a4e
PT
76 if (getDataModel().getNbEvents() == 0) {
77 getDataModel().setTimeRange(startTime, startTime + duration);
78 }
c392540b
FC
79 }
80
b544077e
BH
81 /**
82 * Sets the full time range of the whole trace.
f8177ba2 83 * @param startTime The start time
b544077e
BH
84 * @param endTime The end time
85 */
c392540b 86 public void setFullRange(long startTime, long endTime) {
74237cc3
FC
87 long currentFirstEvent = getStartTime();
88 fZoom.setFullRange((currentFirstEvent == 0) ? startTime : currentFirstEvent, endTime);
c392540b
FC
89 }
90
91}
This page took 0.0430700000000001 seconds and 5 git commands to generate.