Build documentation index
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.core / src / org / eclipse / tracecompass / tmf / core / signal / TmfRangeSynchSignal.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 time range has been selected.
20 *
21 * This is the visible (zoom) time range. To synchronize on the selection range,
22 * use {@link TmfTimeSynchSignal}.
23 *
24 * @author Francois Chouinard
25 */
26 public class TmfRangeSynchSignal extends TmfSignal {
27
28 private final TmfTimeRange fCurrentRange;
29
30 /**
31 * Constructor
32 *
33 * @param source
34 * Object sending this signal
35 * @param range
36 * The new time range
37 */
38 public TmfRangeSynchSignal(Object source, TmfTimeRange range) {
39 super(source);
40 fCurrentRange = range;
41 }
42
43 /**
44 * @return This signal's time range
45 */
46 public TmfTimeRange getCurrentRange() {
47 return fCurrentRange;
48 }
49
50 @Override
51 public String toString() {
52 StringBuilder sb = new StringBuilder("TmfRangeSynchSignal [source="); //$NON-NLS-1$
53
54 if (getSource() != null) {
55 sb.append(getSource().toString());
56 } else {
57 sb.append("null"); //$NON-NLS-1$
58 }
59
60 sb.append(", range="); //$NON-NLS-1$
61
62 if (fCurrentRange != null) {
63 sb.append(fCurrentRange.toString());
64 } else {
65 sb.append("null"); //$NON-NLS-1$
66 }
67 sb.append(']');
68 return sb.toString();
69 }
70 }
This page took 0.034085 seconds and 5 git commands to generate.