1 /*******************************************************************************
2 * Copyright (c) 2009 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 * Alvaro Sanchez-Leon (alvsan09@gmail.com) - Initial API and implementation
11 *******************************************************************************/
12 package org
.eclipse
.linuxtools
.lttng
.ui
.model
.trange
;
19 public abstract class TimeRangeComponent
implements ITimeRangeComponent
{
21 // ========================================================================
23 // =======================================================================
24 protected Long startTime
= 0L;
25 protected Long stopTime
= Long
.MAX_VALUE
;
26 protected TimeRangeComposite eventParent
= null;
27 private boolean visible
= true;
31 // ========================================================================
33 // =======================================================================
34 public TimeRangeComponent(Long stime
, Long etime
,
35 TimeRangeComposite eventParent
) {
36 this.startTime
= stime
;
37 this.stopTime
= etime
;
38 this.eventParent
= eventParent
;
41 // ========================================================================
43 // =======================================================================
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
53 public long getStartTime() {
54 return startTime
.longValue();
58 public void setStartTime(long time
) {
65 public long getStopTime() {
66 return stopTime
.longValue();
70 public void setStopTime(long stopTime
) {
72 this.stopTime
= stopTime
;
77 public ITimeRangeComponent
getEventParent() {
81 public void setEventParent(TimeRangeComposite eventParent
) {
82 this.eventParent
= eventParent
;
86 public abstract String
getName();
89 public void setVisible(boolean visible
) {
90 this.visible
= visible
;
94 * @see org.eclipse.linuxtools.lttng.ui.model.trange.ITimeRangeComponent#isVisible()
97 public boolean isVisible() {
102 @SuppressWarnings("nls")
103 public String
toString() {
104 return "[TimeRangeComponent:" + "startTime=" + startTime
+ ",stopTime=" + stopTime
+
105 ",parent=" + (eventParent
!= null ? eventParent
.id
: "null") + "]";