Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 161620 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/hyades/sd/logc/internal/loader/LogInteractions.java (-1 / +10 lines)
Lines 1-5 Link Here
1
/**********************************************************************
1
/**********************************************************************
2
 * Copyright (c) 2005,2006 IBM Corporation and others.
2
 * Copyright (c) 2005,2007 IBM Corporation and others.
3
 * All rights reserved.   This program and the accompanying materials
3
 * All rights reserved.   This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 1649-1654 Link Here
1649
						/ TIME_CONVERSION_FACTOR);
1649
						/ TIME_CONVERSION_FACTOR);
1650
				node.setEndTime(CBEUtils.computeAdjustedCreationTime(object)
1650
				node.setEndTime(CBEUtils.computeAdjustedCreationTime(object)
1651
						/ TIME_CONVERSION_FACTOR);
1651
						/ TIME_CONVERSION_FACTOR);
1652
				node.setTimeZone();
1652
1653
1653
			} else
1654
			} else
1654
			{
1655
			{
Lines 1677-1682 Link Here
1677
						node.setEndTime(CBEUtils
1678
						node.setEndTime(CBEUtils
1678
								.computeAdjustedCreationTime(object)
1679
								.computeAdjustedCreationTime(object)
1679
								/ TIME_CONVERSION_FACTOR);
1680
								/ TIME_CONVERSION_FACTOR);
1681
						node.setTimeZone();
1680
1682
1681
					} else
1683
					} else
1682
					{
1684
					{
Lines 1698-1703 Link Here
1698
						parentNode.addElement(object);
1700
						parentNode.addElement(object);
1699
						parentNode.setExpanded(true);
1701
						parentNode.setExpanded(true);
1700
						parentNode.setBackgroundColor();
1702
						parentNode.setBackgroundColor();
1703
						parentNode.setTimeZone();
1701
						if (parentNode.getHotSpot() == null)
1704
						if (parentNode.getHotSpot() == null)
1702
						{
1705
						{
1703
							hotSpotNode = new LogHotSpot();
1706
							hotSpotNode = new LogHotSpot();
Lines 1712-1717 Link Here
1712
						node.setEndTime(CBEUtils
1715
						node.setEndTime(CBEUtils
1713
								.computeAdjustedCreationTime(object)
1716
								.computeAdjustedCreationTime(object)
1714
								/ TIME_CONVERSION_FACTOR);
1717
								/ TIME_CONVERSION_FACTOR);
1718
						node.setTimeZone();
1715
					}
1719
					}
1716
1720
1717
				} else
1721
				} else
Lines 1742-1747 Link Here
1742
								node.setEndTime(CBEUtils
1746
								node.setEndTime(CBEUtils
1743
										.computeAdjustedCreationTime(object)
1747
										.computeAdjustedCreationTime(object)
1744
										/ TIME_CONVERSION_FACTOR);
1748
										/ TIME_CONVERSION_FACTOR);
1749
								node.setTimeZone();
1745
1750
1746
							} else
1751
							} else
1747
							{
1752
							{
Lines 1765-1770 Link Here
1765
											.setEndTime(CBEUtils
1770
											.setEndTime(CBEUtils
1766
													.computeAdjustedCreationTime(object)
1771
													.computeAdjustedCreationTime(object)
1767
													/ TIME_CONVERSION_FACTOR);
1772
													/ TIME_CONVERSION_FACTOR);
1773
									node.setTimeZone();
1768
1774
1769
								} else
1775
								} else
1770
								{
1776
								{
Lines 1807-1812 Link Here
1807
											.setEndTime(CBEUtils
1813
											.setEndTime(CBEUtils
1808
													.computeAdjustedCreationTime(object)
1814
													.computeAdjustedCreationTime(object)
1809
													/ TIME_CONVERSION_FACTOR);
1815
													/ TIME_CONVERSION_FACTOR);
1816
									node.setTimeZone();
1810
								}
1817
								}
1811
							}
1818
							}
1812
						}
1819
						}
Lines 1825-1830 Link Here
1825
						node.setEndTime(CBEUtils
1832
						node.setEndTime(CBEUtils
1826
								.computeAdjustedCreationTime(object)
1833
								.computeAdjustedCreationTime(object)
1827
								/ TIME_CONVERSION_FACTOR);
1834
								/ TIME_CONVERSION_FACTOR);
1835
						node.setTimeZone();
1828
1836
1829
					}
1837
					}
1830
				}
1838
				}
Lines 1842-1847 Link Here
1842
					/ TIME_CONVERSION_FACTOR);
1850
					/ TIME_CONVERSION_FACTOR);
1843
			node.setEndTime(CBEUtils.computeAdjustedCreationTime(object)
1851
			node.setEndTime(CBEUtils.computeAdjustedCreationTime(object)
1844
					/ TIME_CONVERSION_FACTOR);
1852
					/ TIME_CONVERSION_FACTOR);
1853
			node.setTimeZone();
1845
1854
1846
		}
1855
		}
1847
1856
(-)src/org/eclipse/hyades/sd/logc/internal/uml2sd/LogGraphNode.java (-2 / +26 lines)
Lines 1-5 Link Here
1
/**********************************************************************
1
/**********************************************************************
2
 * Copyright (c) 2005, 2006 IBM Corporation and others.
2
 * Copyright (c) 2005, 2007 IBM Corporation and others.
3
 * All rights reserved.   This program and the accompanying materials
3
 * All rights reserved.   This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 19-26 Link Here
19
import org.eclipse.emf.ecore.EObject;
19
import org.eclipse.emf.ecore.EObject;
20
import org.eclipse.hyades.models.cbe.CBECommonBaseEvent;
20
import org.eclipse.hyades.models.cbe.CBECommonBaseEvent;
21
import org.eclipse.hyades.sd.logc.internal.util.LogcUtil;
21
import org.eclipse.hyades.sd.logc.internal.util.LogcUtil;
22
import org.eclipse.hyades.ui.internal.util.PreferencesUtil;
22
import org.eclipse.hyades.uml2sd.ui.core.ExecutionOccurrence;
23
import org.eclipse.hyades.uml2sd.ui.core.ExecutionOccurrence;
24
import org.eclipse.hyades.uml2sd.ui.core.ITimeRange2;
23
import org.eclipse.hyades.uml2sd.ui.core.internal.HotSpot;
25
import org.eclipse.hyades.uml2sd.ui.core.internal.HotSpot;
26
import org.eclipse.jface.preference.IPreferenceStore;
27
import org.eclipse.tptp.platform.log.views.internal.LogViewsPlugin;
28
import org.eclipse.tptp.platform.log.views.internal.util.LogUIConstants;
24
import org.eclipse.ui.IActionFilter;
29
import org.eclipse.ui.IActionFilter;
25
30
26
/**
31
/**
Lines 29-40 Link Here
29
 * To change the template for this generated type comment go to
34
 * To change the template for this generated type comment go to
30
 * Window - Preferences - Java - Code Generation - Code and Comments
35
 * Window - Preferences - Java - Code Generation - Code and Comments
31
 */
36
 */
32
public class LogGraphNode extends ExecutionOccurrence implements IActionFilter {
37
public class LogGraphNode extends ExecutionOccurrence implements IActionFilter, ITimeRange2 {
33
38
34
		private  EObject element;
39
		private  EObject element;
35
		private List elements = null;
40
		private List elements = null;
36
		private boolean expanded = false;
41
		private boolean expanded = false;
37
		private HotSpot hotSpot = null;
42
		private HotSpot hotSpot = null;
43
		private int timeZoneOffset = 0;
38
44
39
		protected LogGraphNode(){
45
		protected LogGraphNode(){
40
		}
46
		}
Lines 68-73 Link Here
68
		}
74
		}
69
		
75
		
70
		public void setBackgroundColor(){
76
		public void setBackgroundColor(){
77
			
71
			short sev=0;
78
			short sev=0;
72
			if(!hasElements() || isExpanded()){
79
			if(!hasElements() || isExpanded()){
73
				sev = ((CBECommonBaseEvent)element).getSeverity();
80
				sev = ((CBECommonBaseEvent)element).getSeverity();
Lines 145-148 Link Here
145
		public HotSpot getHotSpot(){
152
		public HotSpot getHotSpot(){
146
			return hotSpot;
153
			return hotSpot;
147
		}
154
		}
155
		
156
		public int getTimeZone(){
157
			if (timeZoneOffset != 0){
158
			return timeZoneOffset;
159
			}
160
			else {
161
			CBECommonBaseEvent cbe = (CBECommonBaseEvent)this.element;
162
			return cbe.getTimeZone();
163
		}
164
			
165
		}
166
		public void setTimeZone()
167
		{
168
			IPreferenceStore store = LogViewsPlugin.getDefault().getPreferenceStore();
169
			String  timeZone= PreferencesUtil.TIME_ZONE_LIST_OFFSET[store.getInt(LogUIConstants.LA_TZ)];
170
			timeZoneOffset =  com.ibm.icu.util.TimeZone.getTimeZone(timeZone).getRawOffset();
171
		}
148
}
172
}
(-)src-uml2sd/org/eclipse/hyades/uml2sd/ui/view/SDWidget.java (-4 / +18 lines)
Lines 1-5 Link Here
1
/**********************************************************************
1
/**********************************************************************
2
 * Copyright (c) 2005, 2006 IBM Corporation and others.
2
 * Copyright (c) 2005, 2007 IBM Corporation and others.
3
 * All rights reserved.   This program and the accompanying materials
3
 * All rights reserved.   This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 12-20 Link Here
12
package org.eclipse.hyades.uml2sd.ui.view;
12
package org.eclipse.hyades.uml2sd.ui.view;
13
13
14
14
15
import java.text.DateFormat;
15
import java.util.ArrayList;
16
import java.util.ArrayList;
16
import java.util.Date;
17
import java.util.Date;
17
import java.util.List;
18
import java.util.List;
19
import java.util.SimpleTimeZone;
20
import java.util.TimeZone;
18
import java.util.Timer;
21
import java.util.Timer;
19
import java.util.TimerTask;
22
import java.util.TimerTask;
20
23
Lines 25-30 Link Here
25
import org.eclipse.hyades.uml2sd.ui.core.Frame;
28
import org.eclipse.hyades.uml2sd.ui.core.Frame;
26
import org.eclipse.hyades.uml2sd.ui.core.GraphNode;
29
import org.eclipse.hyades.uml2sd.ui.core.GraphNode;
27
import org.eclipse.hyades.uml2sd.ui.core.ITimeRange;
30
import org.eclipse.hyades.uml2sd.ui.core.ITimeRange;
31
import org.eclipse.hyades.uml2sd.ui.core.ITimeRange2;
28
import org.eclipse.hyades.uml2sd.ui.core.Lifeline;
32
import org.eclipse.hyades.uml2sd.ui.core.Lifeline;
29
import org.eclipse.hyades.uml2sd.ui.core.Metrics;
33
import org.eclipse.hyades.uml2sd.ui.core.Metrics;
30
import org.eclipse.hyades.uml2sd.ui.core.SyncMessage;
34
import org.eclipse.hyades.uml2sd.ui.core.SyncMessage;
Lines 75-85 Link Here
75
import org.eclipse.swt.widgets.MenuItem;
79
import org.eclipse.swt.widgets.MenuItem;
76
import org.eclipse.ui.part.ViewPart;
80
import org.eclipse.ui.part.ViewPart;
77
81
78
import com.ibm.icu.text.DateFormat;
79
import com.ibm.icu.text.MessageFormat;
82
import com.ibm.icu.text.MessageFormat;
80
83
81
84
82
85
86
83
/**
87
/**
84
 * 
88
 * 
85
 * @author sveyrier
89
 * @author sveyrier
Lines 655-665 Link Here
655
		}
659
		}
656
		else 
660
		else 
657
		{
661
		{
658
			if (toolTipNode instanceof ITimeRange)
662
			if (toolTipNode instanceof ITimeRange2)
659
			{
663
			{
664
				// if it is an instance of ITimeRange2 then it must be also an instance of ITimeRange
665
				// but not necessarily the converse
666
				// This section was modified to use the getTimeZone vlaues from ITimeRange2
667
				// defect 161620
668
				// Liz Dancy
669
				int zoneRawOffset = ((ITimeRange2)toolTipNode).getTimeZone();
670
				TimeZone timeZone = new SimpleTimeZone(zoneRawOffset, "");
671
				timeZone.setRawOffset(zoneRawOffset);
672
				DateFormat dateTimeFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM);
673
				dateTimeFormat.setTimeZone(timeZone);
660
				double tt = ((ITimeRange)toolTipNode).getLastTime()*1000;
674
				double tt = ((ITimeRange)toolTipNode).getLastTime()*1000;
661
				Date timeDate = new Date ((long)tt);
675
				Date timeDate = new Date ((long)tt);
662
				String time=DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM).format(timeDate);
676
				String time= dateTimeFormat.format(timeDate);
663
//				if (agent.getStartTime() > 0)
677
//				if (agent.getStartTime() > 0)
664
//				{
678
//				{
665
//					Date date = new Date((long)agent.getStartTime() * 1000);
679
//					Date date = new Date((long)agent.getStartTime() * 1000);
(-)src-uml2sd/org/eclipse/hyades/uml2sd/ui/core/ITimeRange2.java (+24 lines)
Added Link Here
1
/**********************************************************************
2
 * Copyright (c) 2007 IBM Corporation and others.
3
 * All rights reserved.   This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * $Id: GraphNode.java,v 1.2 2006/09/20 20:56:25 ewchan Exp $
8
 * 
9
 * Contributors: 
10
 * IBM - Initial API and implementation
11
 **********************************************************************/
12
13
package org.eclipse.hyades.uml2sd.ui.core;
14
/**
15
 * An interface added to synchronize the Log Interactions View time zone
16
 * with the Log View time zone for each LogGraphNode.
17
 * @author ldancy
18
 */
19
public interface ITimeRange2  
20
{
21
	public int getTimeZone();
22
	
23
	public void setTimeZone();
24
}

Return to bug 161620