tmf: Add support for time range selection
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / widgets / timegraph / TimeGraphTimeEvent.java
1 /*******************************************************************************
2 * Copyright (c) 2012, 2013 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 * Patrick Tasse - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.linuxtools.tmf.ui.widgets.timegraph;
14
15 import java.util.EventObject;
16
17 /**
18 * Time selection event
19 *
20 * @version 1.0
21 * @author Patrick Tasse
22 */
23 public class TimeGraphTimeEvent extends EventObject {
24
25 /**
26 * Default serial version UID for this class.
27 * @since 1.0
28 */
29 private static final long serialVersionUID = 1L;
30
31 /**
32 * The selection begin time.
33 */
34 private final long fBeginTime;
35
36 /**
37 * The selection end time.
38 */
39 private final long fEndTime;
40
41 /**
42 * Standard constructor
43 *
44 * @param source
45 * The source of this event
46 * @param time
47 * The time that was requested
48 * @deprecated As of 2.1, use {@link #TimeGraphTimeEvent(Object, long, long)}
49 */
50 @Deprecated
51 public TimeGraphTimeEvent(Object source, long time) {
52 super(source);
53 fBeginTime = time;
54 fEndTime = time;
55 }
56
57 /**
58 * Standard constructor
59 *
60 * @param source
61 * The source of this event
62 * @param beginTime
63 * The selection begin time
64 * @param endTime
65 * The selection end time
66 * @since 2.1
67 */
68 public TimeGraphTimeEvent(Object source, long beginTime, long endTime) {
69 super(source);
70 fBeginTime = beginTime;
71 fEndTime = endTime;
72 }
73
74 /**
75 * @return the selected time
76 * @deprecated As of 2.1, use {@link #getBeginTime()} and {@link #getEndTime()}
77 */
78 @Deprecated
79 public long getTime() {
80 return fBeginTime;
81 }
82
83 /**
84 * @return the selection begin time
85 * @since 2.1
86 */
87 public long getBeginTime() {
88 return fBeginTime;
89 }
90
91 /**
92 * @return the selection end time
93 * @since 2.1
94 */
95 public long getEndTime() {
96 return fEndTime;
97 }
98
99 }
This page took 0.032078 seconds and 5 git commands to generate.