use of org.eclipse.titan.log.viewer.views.msc.ui.core.Lifeline in project titan.EclipsePlug-ins by eclipse.
the class MSCWidget method contentsMouseUpEvent.
@Override
protected void contentsMouseUpEvent(final MouseEvent event) {
this.toolTip.hideToolTip();
if (this.dragAndDrop != null) {
if ((this.overView != null) && !this.overView.isDisposed()) {
this.overView.dispose();
}
this.overView = null;
Lifeline node = this.frame.getCloserLifeline(this.dragX);
if (node != null) {
Lifeline currLifeline = ((LifelineHeader) this.dragAndDrop).getLifeline();
int rx = Math.round(node.getX() * this.zoomValue);
if ((rx <= event.x) && (Math.round(rx + (node.getWidth() * this.zoomValue)) >= event.x)) {
// Do nothing
} else {
this.frame.moveLifeLineToPosition(currLifeline, node.getIndex());
}
}
((LifelineHeader) this.dragAndDrop).setDragAndDropMode(false);
this.dragAndDrop = null;
}
redraw();
if (this.frame == null) {
return;
}
super.contentsMouseUpEvent(event);
}
use of org.eclipse.titan.log.viewer.views.msc.ui.core.Lifeline in project titan.EclipsePlug-ins by eclipse.
the class MSCModel method addEnqueued.
private MSCNode[] addEnqueued(final String ref, final String target, final String name, final String time, final int occurrence) {
Enqueued message = new Enqueued();
Lifeline source = this.lifelines.get(ref);
Lifeline dest = this.lifelines.get(target);
if ((source == null) || (dest == null)) {
return new MSCNode[] {};
}
source.setCurrentEventOccurrence(occurrence);
dest.setCurrentEventOccurrence(occurrence);
message.setStartLifeline(source);
message.setEndLifeline(dest);
message.setName(name);
return new MSCNode[] { message, new TimeStampNode(occurrence, time) };
}
use of org.eclipse.titan.log.viewer.views.msc.ui.core.Lifeline in project titan.EclipsePlug-ins by eclipse.
the class MSCModel method addFunctionNode.
private MSCNode[] addFunctionNode(FunctionNode function, String ref, String target, String name, String time, int occurrence) {
Lifeline source = this.lifelines.get(ref);
Lifeline destination = this.lifelines.get(target);
if ((source == null) || (destination == null)) {
return new MSCNode[] {};
}
source.setCurrentEventOccurrence(occurrence);
destination.setCurrentEventOccurrence(occurrence);
function.setStartLifeline(source);
function.setEndLifeline(destination);
function.setName(name);
// Create and add Time Stamp
return new MSCNode[] { function, new TimeStampNode(occurrence, time) };
}
use of org.eclipse.titan.log.viewer.views.msc.ui.core.Lifeline in project titan.EclipsePlug-ins by eclipse.
the class MSCModel method extractLifeLineAndHeaderNodes.
/**
* Extracts the lifeline and lifelineheader nodes from the provided event object.
*
* @param ievent the event to extract the data from.
* @param occurrence the number at which time this event happened in its order.
*/
private void extractLifeLineAndHeaderNodes(final IEventObject ievent, final int occurrence) {
if (!(ievent instanceof EventObject)) {
return;
}
EventObject event = (EventObject) ievent;
String ref = event.getReference();
String time = event.getTime();
switch(event.getType()) {
// Creation of System Component
case SYSTEM_CREATE:
ref = Constants.SUT_REFERENCE;
createLifelineAndHeaderComponent(ref, time, this.sutLifeline, occurrence);
break;
// Creation of Host Controller (HC)
case HC_CREATE:
ref = Constants.HC_REFERENCE;
createLifelineAndHeaderComponent(ref, time, new Lifeline(), occurrence);
break;
// Creation of Main Test Component (MTC)
case MTC_CREATE:
ref = Constants.MTC_REFERENCE;
if (this.lifelines.get(ref) == null) {
createLifelineAndHeaderComponent(ref, time, new Lifeline(), occurrence);
} else {
createLifelineAndHeaderComponent(ref, time, this.lifelines.get(ref), occurrence);
}
break;
// Creation of Parallel Test Component (PTC)
case PTC_CREATE:
createLifelineAndHeaderComponent(ref, time, new Lifeline(), occurrence);
break;
// Termination of System Component
case SYSTEM_TERMINATE:
ref = Constants.SUT_REFERENCE;
terminateLifeLineComponent(ref, time, occurrence);
break;
// Termination of Host Controller (HC)
case HC_TERMINATE:
ref = Constants.HC_REFERENCE;
terminateLifeLineComponent(ref, time, occurrence);
break;
// Termination of Main Test Component (MTC)
case MTC_TERMINATE:
ref = Constants.MTC_REFERENCE;
terminateLifeLineComponent(ref, time, occurrence);
break;
// Termination of Parallel Test Component (PTC)
case PTC_TERMINATE:
terminateLifeLineComponent(ref, time, occurrence);
break;
default:
break;
}
}
use of org.eclipse.titan.log.viewer.views.msc.ui.core.Lifeline in project titan.EclipsePlug-ins by eclipse.
the class MSCModel method addPortEventNode.
private MSCNode[] addPortEventNode(PortEventNode portEventNode, String ref, String target, String time, int occurrence) {
Lifeline source = this.lifelines.get(ref);
Lifeline destination = this.lifelines.get(target);
if ((source == null) || (destination == null)) {
return new MSCNode[] {};
}
source.setCurrentEventOccurrence(occurrence);
destination.setCurrentEventOccurrence(occurrence);
portEventNode.setStartLifeline(source);
portEventNode.setEndLifeline(destination);
// Create and add Time Stamp
return new MSCNode[] { portEventNode, new TimeStampNode(occurrence, time) };
}
Aggregations