+
/*****************************************************************************
* Copyright (c) 2007, 2008 Intel Corporation, 2009, 2010, 2011, 2012 Ericsson.
* All rights reserved. This program and the accompanying materials
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.TimeGraphScale;
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.TimeGraphTooltipHandler;
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.Utils;
+import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets.Utils.TimeFormat;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ControlAdapter;
import org.eclipse.swt.events.ControlEvent;
ArrayList<ITimeGraphTimeListener> fTimeListeners = new ArrayList<ITimeGraphTimeListener>();
ArrayList<ITimeGraphRangeListener> fRangeListeners = new ArrayList<ITimeGraphRangeListener>();
- // Calender Time format, using Epoch reference or Relative time
- // format(default
- private boolean calendarTimeFormat = false;
+ // Time format, using Epoch reference, Relative time format(default) or Number
+ private TimeFormat timeFormat = TimeFormat.RELATIVE;
private int borderWidth = 0;
private int timeScaleHeight = 22;
_time1_extSynch = _time1;
}
+ @Override
+ @Deprecated
+ public boolean isCalendarFormat() {
+ return timeFormat == TimeFormat.CALENDAR;
+ }
+
/**
- * Set the calendar format
- *
- * @param toAbsoluteCaltime
- * True for absolute time, false for relative
+ * @since 2.0
*/
- public void setTimeCalendarFormat(boolean toAbsoluteCaltime) {
- calendarTimeFormat = toAbsoluteCaltime;
+ @Override
+ public TimeFormat getTimeFormat() {
+ return timeFormat;
}
- @Override
- public boolean isCalendarFormat() {
- return calendarTimeFormat;
+ /**
+ * @param tf the {@link TimeFormat} used to display timestamps
+ * @since 2.0
+ */
+ public void setTimeFormat(TimeFormat tf) {
+ this.timeFormat = tf;
}
/**