Commit | Line | Data |
---|---|---|
8c8bf09f | 1 | /******************************************************************************* |
be4a197a | 2 | * Copyright (c) 2009, 2014 Ericsson |
4f8ca6a1 | 3 | * |
8c8bf09f ASL |
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 | |
4f8ca6a1 | 8 | * |
8c8bf09f ASL |
9 | * Contributors: |
10 | * Francois Chouinard - Initial API and implementation | |
0fcf3b09 | 11 | * Patrick Tasse - Deprecate current time |
8c8bf09f ASL |
12 | *******************************************************************************/ |
13 | ||
2bdf0193 | 14 | package org.eclipse.tracecompass.tmf.core.signal; |
8c8bf09f | 15 | |
2bdf0193 | 16 | import org.eclipse.tracecompass.tmf.core.timestamp.TmfTimeRange; |
8c8bf09f ASL |
17 | |
18 | /** | |
97c71024 | 19 | * A new range has been selected for the visible (zoom) time range. |
0fcf3b09 | 20 | * |
97c71024 AM |
21 | * To update the selection range instead, use |
22 | * {@link TmfSelectionRangeUpdatedSignal}. | |
4f8ca6a1 | 23 | * |
4b7b3670 | 24 | * @author Francois Chouinard |
97c71024 | 25 | * @since 1.0 |
8c8bf09f | 26 | */ |
97c71024 | 27 | public class TmfWindowRangeUpdatedSignal extends TmfSignal { |
8c8bf09f | 28 | |
c392540b | 29 | private final TmfTimeRange fCurrentRange; |
8c8bf09f | 30 | |
0fcf3b09 PT |
31 | /** |
32 | * Constructor | |
33 | * | |
34 | * @param source | |
35 | * Object sending this signal | |
36 | * @param range | |
37 | * The new time range | |
0fcf3b09 | 38 | */ |
97c71024 | 39 | public TmfWindowRangeUpdatedSignal(Object source, TmfTimeRange range) { |
0fcf3b09 PT |
40 | super(source); |
41 | fCurrentRange = range; | |
c392540b | 42 | } |
8c8bf09f | 43 | |
4f8ca6a1 AM |
44 | /** |
45 | * @return This signal's time range | |
46 | */ | |
c392540b FC |
47 | public TmfTimeRange getCurrentRange() { |
48 | return fCurrentRange; | |
49 | } | |
8c8bf09f | 50 | |
e9681c60 SM |
51 | @Override |
52 | public String toString() { | |
97c71024 | 53 | StringBuilder sb = new StringBuilder(getClass().getSimpleName() + " [source="); //$NON-NLS-1$ |
e9681c60 SM |
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 | } | |
8c8bf09f | 71 | } |