(no commit message)
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.ui / src / org / eclipse / linuxtools / lttng / ui / model / trange / TimeRangeComponent.java
1 /*******************************************************************************
2 * Copyright (c) 2009 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 * Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation
11 *******************************************************************************/
12 package org.eclipse.linuxtools.lttng.ui.model.trange;
13
14
15 /**
16 * @author alvaro
17 *
18 */
19 public abstract class TimeRangeComponent implements ITimeRangeComponent {
20
21 // ========================================================================
22 // Data
23 // =======================================================================
24 protected Long startTime = 0L;
25 protected Long stopTime = Long.MAX_VALUE;
26 protected TimeRangeComposite eventParent = null;
27 private boolean visible = true;
28
29
30
31 // ========================================================================
32 // Constructor
33 // =======================================================================
34 public TimeRangeComponent(Long stime, Long etime,
35 TimeRangeComposite eventParent) {
36 this.startTime = stime;
37 this.stopTime = etime;
38 this.eventParent = eventParent;
39 }
40
41 // ========================================================================
42 // Methods
43 // =======================================================================
44 /**
45 * This method shall not be used to estimate the starting drawing point of
46 * the time range-event. see interface method getTime(). However this method
47 * can be used to retrieve the tool tip information where we need to reflect
48 * that the actual start of this event is unknown
49 *
50 * @param time
51 */
52 public long getStartTime() {
53 return startTime.longValue();
54 }
55
56 public void setStartTime(long time) {
57 if (time > -1) {
58 startTime = time;
59 }
60 }
61
62 public long getStopTime() {
63 return stopTime.longValue();
64 }
65
66 public void setStopTime(long stopTime) {
67 if (stopTime > -1) {
68 this.stopTime = stopTime;
69 }
70 }
71
72 public ITimeRangeComponent getEventParent() {
73 return eventParent;
74 }
75
76 public void setEventParent(TimeRangeComposite eventParent) {
77 this.eventParent = eventParent;
78 }
79
80 public abstract String getName();
81
82
83 public void setVisible(boolean visible) {
84 this.visible = visible;
85 }
86
87 /* (non-Javadoc)
88 * @see org.eclipse.linuxtools.lttng.ui.model.trange.ITimeRangeComponent#isVisible()
89 */
90 public boolean isVisible() {
91 return visible;
92 }
93 }
This page took 0.072924 seconds and 6 git commands to generate.