analysis: Move plugins to their own sub-directory
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / tmf / core / signal / TmfWindowRangeUpdatedSignal.java
1 /*******************************************************************************
2 * Copyright (c) 2009, 2014 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 * Francois Chouinard - Initial API and implementation
11 * Patrick Tasse - Deprecate current time
12 *******************************************************************************/
13
14 package org.eclipse.tracecompass.tmf.core.signal;
15
16 import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange;
17
18 /**
19 * A new range has been selected for the visible (zoom) time range.
20 *
21 * To update the selection range instead, use
22 * {@link TmfSelectionRangeUpdatedSignal}.
23 *
24 * @author Francois Chouinard
25 * @since 1.0
26 */
27 public class TmfWindowRangeUpdatedSignal extends TmfSignal {
28
29 private final TmfTimeRange fCurrentRange;
30
31 /**
32 * Constructor
33 *
34 * @param source
35 * Object sending this signal
36 * @param range
37 * The new time range
38 */
39 public TmfWindowRangeUpdatedSignal(Object source, TmfTimeRange range) {
40 super(source);
41 fCurrentRange = range;
42 }
43
44 /**
45 * @return This signal's time range
46 */
47 public TmfTimeRange getCurrentRange() {
48 return fCurrentRange;
49 }
50
51 @Override
52 public String toString() {
53 StringBuilder sb = new StringBuilder(getClass().getSimpleName() + " [source="); //$NON-NLS-1$
54
55 if (getSource() != null) {
56 sb.append(getSource().toString());
57 } else {
58 sb.append("null"); //$NON-NLS-1$
59 }
60
61 sb.append(", range="); //$NON-NLS-1$
62
63 if (fCurrentRange != null) {
64 sb.append(fCurrentRange.toString());
65 } else {
66 sb.append("null"); //$NON-NLS-1$
67 }
68 sb.append(']');
69 return sb.toString();
70 }
71 }
This page took 0.032088 seconds and 5 git commands to generate.