1 /*******************************************************************************
2 * Copyright (c) 2015 Ericsson
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
10 * Marc-Andre Laperle - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.tmf
.ui
.signal
;
15 import org
.eclipse
.tracecompass
.tmf
.core
.signal
.TmfSignal
;
18 * A signal to inform about the state of time alignment. Typically, the emitter
19 * will inform the receivers about the position of a sash that separates the
20 * time axis on right side and extra information on the left side.
22 * @see TmfTimeViewAlignmentInfo
26 public class TmfTimeViewAlignmentSignal
extends TmfSignal
{
28 private final TmfTimeViewAlignmentInfo fTimeViewAlignmentInfo
;
29 private final boolean fIsSynchronous
;
32 * Creates a new TmfTimeViewAlignmentSignal
35 * the source of the signal
36 * @param alignmentInfo
37 * information about the time alignment
39 public TmfTimeViewAlignmentSignal(Object source
, TmfTimeViewAlignmentInfo alignmentInfo
) {
40 this(source
, alignmentInfo
, false);
44 * Creates a new TmfTimeViewAlignmentSignal
47 * the source of the signal
48 * @param alignmentInfo
49 * information about the time alignment
51 * whether or not the signal should be processed right away. This
52 * is useful for signals that are sent not repetitively.
53 * For example, a sash being dragged would not be synchronous
54 * because the signal gets fired repeatedly. A view that has
55 * completed computing it's data could send a synchronous signal.
57 public TmfTimeViewAlignmentSignal(Object source
, TmfTimeViewAlignmentInfo alignmentInfo
, boolean synchronous
) {
59 fTimeViewAlignmentInfo
= alignmentInfo
;
60 fIsSynchronous
= synchronous
;
64 * Get the time alignment information.
66 * @return the time alignment information
68 public TmfTimeViewAlignmentInfo
getTimeViewAlignmentInfo() {
69 return fTimeViewAlignmentInfo
;
73 public String
toString() {
74 return "[TmfTimeViewAlignmentSignal (" + fTimeViewAlignmentInfo
.toString() + ")]"; //$NON-NLS-1$ //$NON-NLS-2$
78 * Get whether or not the signal should be processed right away, without
81 * @return whether or not the signal should be processed right away
83 public boolean IsSynchronous() {
84 return fIsSynchronous
;