* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Intel Corporation - Initial API and implementation
- * Ruslan A. Scherbakov, Intel - Initial API and implementation
- * Alvaro Sanchez-Leon - Udpated for TMF
- * Patrick Tasse - Refactoring
+ * Intel Corporation - Initial API and implementation
+ * Ruslan A. Scherbakov, Intel - Initial API and implementation
+ * Alvaro Sanchez-Leon - Udpated for TMF
+ * Patrick Tasse - Refactoring
+ * Marc-Andre Laperle - Add time zone preference
*****************************************************************************/
package org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
+import java.util.TimeZone;
+import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimePreferences;
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeEvent;
import org.eclipse.linuxtools.tmf.ui.widgets.timegraph.model.ITimeGraphEntry;
import org.eclipse.swt.graphics.Color;
private static final long SEC_IN_NS = 1000000000;
private static final long MILLISEC_IN_NS = 1000000;
+ /**
+ * Update the time and date formats to use the current time zone
+ *
+ * @since 2.1
+ */
+ public static void updateTimeZone() {
+ TimeZone timeZone = TmfTimePreferences.getInstance().getTimeZone();
+ TIME_FORMAT.setTimeZone(timeZone);
+ DATE_FORMAT.setTimeZone(timeZone);
+ }
+
static Rectangle clone(Rectangle source) {
return new Rectangle(source.x, source.y, source.width, source.height);
}