Search in sources :

Example 1 with Lifeline

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);
}
Also used : Lifeline(org.eclipse.titan.log.viewer.views.msc.ui.core.Lifeline) LifelineHeader(org.eclipse.titan.log.viewer.views.msc.ui.core.LifelineHeader)

Example 2 with Lifeline

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) };
}
Also used : TimeStampNode(org.eclipse.titan.log.viewer.views.msc.ui.core.TimeStampNode) Lifeline(org.eclipse.titan.log.viewer.views.msc.ui.core.Lifeline) MSCNode(org.eclipse.titan.log.viewer.views.msc.ui.core.MSCNode) Enqueued(org.eclipse.titan.log.viewer.views.msc.ui.core.Enqueued)

Example 3 with Lifeline

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) };
}
Also used : TimeStampNode(org.eclipse.titan.log.viewer.views.msc.ui.core.TimeStampNode) Lifeline(org.eclipse.titan.log.viewer.views.msc.ui.core.Lifeline) MSCNode(org.eclipse.titan.log.viewer.views.msc.ui.core.MSCNode)

Example 4 with Lifeline

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;
    }
}
Also used : Lifeline(org.eclipse.titan.log.viewer.views.msc.ui.core.Lifeline)

Example 5 with Lifeline

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) };
}
Also used : TimeStampNode(org.eclipse.titan.log.viewer.views.msc.ui.core.TimeStampNode) Lifeline(org.eclipse.titan.log.viewer.views.msc.ui.core.Lifeline) MSCNode(org.eclipse.titan.log.viewer.views.msc.ui.core.MSCNode)

Aggregations

Lifeline (org.eclipse.titan.log.viewer.views.msc.ui.core.Lifeline)14 MSCNode (org.eclipse.titan.log.viewer.views.msc.ui.core.MSCNode)9 TimeStampNode (org.eclipse.titan.log.viewer.views.msc.ui.core.TimeStampNode)7 ComponentTermination (org.eclipse.titan.log.viewer.views.msc.ui.core.ComponentTermination)2 Frame (org.eclipse.titan.log.viewer.views.msc.ui.core.Frame)2 LifelineHeader (org.eclipse.titan.log.viewer.views.msc.ui.core.LifelineHeader)2 IOException (java.io.IOException)1 ParseException (java.text.ParseException)1 ArrayList (java.util.ArrayList)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 LogRecord (org.eclipse.titan.log.viewer.parsers.data.LogRecord)1 MSCModel (org.eclipse.titan.log.viewer.views.msc.model.MSCModel)1 Enqueued (org.eclipse.titan.log.viewer.views.msc.ui.core.Enqueued)1 Function (org.eclipse.titan.log.viewer.views.msc.ui.core.Function)1 FunctionDone (org.eclipse.titan.log.viewer.views.msc.ui.core.FunctionDone)1 PortConnection (org.eclipse.titan.log.viewer.views.msc.ui.core.PortConnection)1 PortDisconnection (org.eclipse.titan.log.viewer.views.msc.ui.core.PortDisconnection)1 PortMapping (org.eclipse.titan.log.viewer.views.msc.ui.core.PortMapping)1 PortUnmapping (org.eclipse.titan.log.viewer.views.msc.ui.core.PortUnmapping)1