/**********************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
- * Copyright (c) 2011, 2012 Ericsson.
- *
+ * Copyright (c) 2005, 2013 IBM Corporation, Ericsson
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * IBM - Initial API and implementation
- * Bernd Hufmann - Updated for TMF
- *
+ * IBM - Initial API and implementation
+ * Bernd Hufmann - Updated for TMF
**********************************************************************/
+
package org.eclipse.linuxtools.tmf.ui.views.uml2sd;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.linuxtools.internal.tmf.ui.Activator;
-import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp;
-import org.eclipse.linuxtools.tmf.core.event.TmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.timestamp.ITmfTimestamp;
+import org.eclipse.linuxtools.tmf.core.timestamp.TmfTimestamp;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.AsyncMessage;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.AsyncMessageReturn;
import org.eclipse.linuxtools.tmf.ui.views.uml2sd.core.BaseMessage;
for (int i = firstVisible; i < fFrame.syncMessageCount(); i = i + messageArraysStep) {
SyncMessage m = fFrame.getSyncMessage(i);
if (m.hasTimeInfo()) {
- SDTimeEvent t = new SDTimeEvent(m.getStartTime(), m.getEventOccurrence(), (ITimeRange) m);
+ SDTimeEvent t = new SDTimeEvent(m.getStartTime(), m.getEventOccurrence(), m);
fNodeList.add(t);
if (m.getY() * fZoomValue > getContentsY() + getVisibleHeight()) {
break;
for (int i = firstVisible; i < fFrame.syncMessageReturnCount(); i = i + messageArraysStep) {
SyncMessage m = fFrame.getSyncMessageReturn(i);
if (m.hasTimeInfo()) {
- SDTimeEvent t = new SDTimeEvent(m.getStartTime(), m.getEventOccurrence(), (ITimeRange) m);
+ SDTimeEvent t = new SDTimeEvent(m.getStartTime(), m.getEventOccurrence(), m);
fNodeList.add(t);
if (m.getY() * fZoomValue > getContentsY() + getVisibleHeight()) {
break;
for (int i = firstVisible; i < fFrame.asyncMessageCount(); i = i + messageArraysStep) {
AsyncMessage m = fFrame.getAsyncMessage(i);
if (m.hasTimeInfo()) {
- SDTimeEvent t = new SDTimeEvent(m.getStartTime(), m.getStartOccurrence(), (ITimeRange) m);
+ SDTimeEvent t = new SDTimeEvent(m.getStartTime(), m.getStartOccurrence(), m);
fNodeList.add(t);
- t = new SDTimeEvent(m.getEndTime(), m.getEndOccurrence(), (ITimeRange) m);
+ t = new SDTimeEvent(m.getEndTime(), m.getEndOccurrence(), m);
fNodeList.add(t);
if (m.getY() * fZoomValue > getContentsY() + getVisibleHeight()) {
break;
for (int i = firstVisible; i < fFrame.asyncMessageReturnCount(); i = i + messageArraysStep) {
AsyncMessageReturn m = fFrame.getAsyncMessageReturn(i);
if (m.hasTimeInfo()) {
- SDTimeEvent t = new SDTimeEvent(m.getStartTime(), m.getStartOccurrence(), (ITimeRange) m);
+ SDTimeEvent t = new SDTimeEvent(m.getStartTime(), m.getStartOccurrence(), m);
fNodeList.add(t);
- t = new SDTimeEvent(m.getEndTime(), m.getEndOccurrence(), (ITimeRange) m);
+ t = new SDTimeEvent(m.getEndTime(), m.getEndOccurrence(), m);
fNodeList.add(t);
if (m.getY() * fZoomValue > getContentsY() + getVisibleHeight()) {
break;
}
gcim = new GC(dbuffer);
for (int i = 0; i < fNodeList.size() - 1; i++) {
- SDTimeEvent m1 = (SDTimeEvent) fNodeList.get(i);
- SDTimeEvent m2 = (SDTimeEvent) fNodeList.get(i + 1);
+ SDTimeEvent m1 = fNodeList.get(i);
+ SDTimeEvent m2 = fNodeList.get(i + 1);
if ((SDViewPref.getInstance().excludeExternalTime()) && ((m1.getGraphNode() instanceof BaseMessage) && (m2.getGraphNode() instanceof BaseMessage))) {
BaseMessage mes1 = (BaseMessage) m1.getGraphNode();
/**
* Checks for focus of children.
*
- * @param children Control to check
+ * @param children
+ * Control to check
* @return true if child is on focus else false
*/
- protected boolean checkFocusOnChilds(Control childs) {
- if (childs instanceof Composite) {
- Control[] child = ((Composite) childs).getChildren();
+ protected boolean checkFocusOnChilds(Control children) {
+ if (children instanceof Composite) {
+ Control[] child = ((Composite) children).getChildren();
for (int i = 0; i < child.length; i++) {
if (child[i].isFocusControl()) {
return true;
- } else {
- checkFocusOnChilds(child[i]);
}
+ checkFocusOnChilds(child[i]);
}
}
return false;
for (int i = 0; i < child.length; i++) {
if (child[i].isFocusControl()) {
return true;
- } else {
- checkFocusOnChilds(child[i]);
}
+ checkFocusOnChilds(child[i]);
}
return false;
}
if (fFrame != null) {
setFocus(0);
for (int i = 0; i < fNodeList.size() - 1; i++) {
- SDTimeEvent m1 = (SDTimeEvent) fNodeList.get(i);
- SDTimeEvent m2 = (SDTimeEvent) fNodeList.get(i + 1);
+ SDTimeEvent m1 = fNodeList.get(i);
+ SDTimeEvent m2 = fNodeList.get(i + 1);
if ((SDViewPref.getInstance().excludeExternalTime()) && ((m1.getGraphNode() instanceof BaseMessage) && (m2.getGraphNode() instanceof BaseMessage))) {
BaseMessage mes1 = (BaseMessage) m1.getGraphNode();
}
/**
- * Force the time compression bar to highlight the event occurrences between the two given messages. The event
- * occurrences are highlighted on the first message's end lifeline
+ * Force the time compression bar to highlight the event occurrences between
+ * the two given messages. The event occurrences are highlighted on the
+ * first message's end lifeline
*
- * @param mes1 the first message
- * @param localMes2 the second message
+ * @param mes1
+ * the first message
+ * @param mes2
+ * the second message
*/
public void highlightRegion(BaseMessage mes1, BaseMessage mes2) {
BaseMessage localMes1 = mes1;
colIndex = 0;
}
for (int j = 0; j < fListenerList.size(); j++) {
- ITimeCompressionListener list = (ITimeCompressionListener) fListenerList.get(j);
+ ITimeCompressionListener list = fListenerList.get(j);
if (localMes1.getEndLifeline() != null) {
list.deltaSelected(localMes1.getEndLifeline(), event1, event2 - event1, fColors[colIndex]);
} else if (localMes2.getStartLifeline() != null) {
}
if ((fFrame != null) && (fNextNodeY == 0)) {
for (int i = 0; i < fNodeList.size() - 1 && i < 1; i++) {
- SDTimeEvent m1 = (SDTimeEvent) fNodeList.get(i);
- SDTimeEvent m2 = (SDTimeEvent) fNodeList.get(i + 1);
+ SDTimeEvent m1 = fNodeList.get(i);
+ SDTimeEvent m2 = fNodeList.get(i + 1);
if ((SDViewPref.getInstance().excludeExternalTime()) && ((m1.getGraphNode() instanceof BaseMessage) && (m2.getGraphNode() instanceof BaseMessage))) {
BaseMessage mes1 = (BaseMessage) m1.getGraphNode();
BaseMessage mes2 = (BaseMessage) m2.getGraphNode();
if (fLifeline != null) {
for (int j = 0; j < fListenerList.size(); j++) {
- ITimeCompressionListener list = (ITimeCompressionListener) fListenerList.get(j);
+ ITimeCompressionListener list = fListenerList.get(j);
list.deltaSelected(fLifeline, fLifelineStart, fLifelineNumEvents, fLifelineColor);
}
}
boolean done = false;
if (fFrame != null) {
for (int i = 0; i < fNodeList.size() - 1; i++) {
- SDTimeEvent m1 = (SDTimeEvent) fNodeList.get(i);
- SDTimeEvent m2 = (SDTimeEvent) fNodeList.get(i + 1);
+ SDTimeEvent m1 = fNodeList.get(i);
+ SDTimeEvent m2 = fNodeList.get(i + 1);
if ((SDViewPref.getInstance().excludeExternalTime()) && ((m1.getGraphNode() instanceof BaseMessage) && (m2.getGraphNode() instanceof BaseMessage))) {
BaseMessage mes1 = (BaseMessage) m1.getGraphNode();
BaseMessage mes2 = (BaseMessage) m2.getGraphNode();
}
}
for (int j = 0; j < fListenerList.size(); j++) {
- ITimeCompressionListener list = (ITimeCompressionListener) fListenerList.get(j);
+ ITimeCompressionListener list = fListenerList.get(j);
list.deltaSelected(fLifeline, fLifelineStart, fLifelineNumEvents, fLifelineColor);
}
break;
- } else {
- lastM1 = m1;
- lastM2 = m2;
- lastY1 = m1Y;
- lastY2 = m2Y;
}
+ lastM1 = m1;
+ lastM2 = m2;
+ lastY1 = m1Y;
+ lastY2 = m2Y;
}
}
}
if (fFrame != null) {
setFocus(0);
for (int i = 0; i < fNodeList.size() - 1; i++) {
- SDTimeEvent m1 = (SDTimeEvent) fNodeList.get(i);
- SDTimeEvent m2 = (SDTimeEvent) fNodeList.get(i + 1);
+ SDTimeEvent m1 = fNodeList.get(i);
+ SDTimeEvent m2 = fNodeList.get(i + 1);
if ((SDViewPref.getInstance().excludeExternalTime()) && ((m1.getGraphNode() instanceof BaseMessage) && (m2.getGraphNode() instanceof BaseMessage))) {
BaseMessage mes1 = (BaseMessage) m1.getGraphNode();