Search in sources :

Example 6 with MSCNode

use of org.eclipse.titan.log.viewer.views.msc.ui.core.MSCNode in project titan.EclipsePlug-ins by eclipse.

the class MSCWidget method contentsMouseDownEvent.

@Override
protected void contentsMouseDownEvent(final MouseEvent event) {
    this.toolTip.hideToolTip();
    if (((this.zoomInMode) || (this.zoomOutMode)) && (event.button == 1)) {
        int cx = Math.round(event.x / this.zoomValue);
        int cy = Math.round(event.y / this.zoomValue);
        if (this.zoomInMode) {
            if (this.zoomValue < 64) {
                this.zoomValue = this.zoomValue * (float) 1.25;
            }
        } else {
            this.zoomValue = this.zoomValue / (float) 1.25;
        }
        int x = Math.round(cx * this.zoomValue - (float) getVisibleWidth() / 2);
        int y = Math.round(cy * this.zoomValue - (float) getVisibleHeight() / 2);
        int width = Math.round(this.frame.getWidth() * this.zoomValue);
        int height = Math.round(this.frame.getHeight() * this.zoomValue);
        resizeContents(width, height);
        setContentsPos(x, y);
        redraw();
    } else {
        this.dragAndDropEnabled = true;
        if (this.frame != null) {
            int oldSelectedLine = frame.getSelectedLine();
            int x = Math.round(event.x / this.zoomValue);
            int y = Math.round(event.y / this.zoomValue);
            MSCNode node = this.frame.getNodeAt(x, y);
            if (event.button == 1 || (node != null)) {
                this.currentGraphNode = node;
                if (node instanceof LifelineHeader) {
                    this.dragAndDropOffsetX = node.getX() - x;
                }
            }
            // Header
            int selectedLine = y / MSCConstants.ROW_HEIGHT - 1;
            this.frame.setSelectedLine(selectedLine);
            if (frame.getSelectedLine() != oldSelectedLine) {
                fireSelectionChangeEvent();
                redraw();
            }
        }
    }
    if (this.dragAndDrop == null) {
        super.contentsMouseDownEvent(event);
    }
}
Also used : MSCNode(org.eclipse.titan.log.viewer.views.msc.ui.core.MSCNode) LifelineHeader(org.eclipse.titan.log.viewer.views.msc.ui.core.LifelineHeader)

Example 7 with MSCNode

use of org.eclipse.titan.log.viewer.views.msc.ui.core.MSCNode in project titan.EclipsePlug-ins by eclipse.

the class MSCWidget method contentsMouseHover.

@Override
protected void contentsMouseHover(final MouseEvent event) {
    if (this.frame != null) {
        int x = Math.round(event.x / this.zoomValue);
        int y = Math.round(event.y / this.zoomValue);
        MSCNode graphNode = this.frame.getNodeAt(x, y);
        if (graphNode != null) {
            this.toolTip.showToolTip(graphNode.getName());
        } else {
            this.toolTip.hideToolTip();
        }
    }
}
Also used : MSCNode(org.eclipse.titan.log.viewer.views.msc.ui.core.MSCNode)

Example 8 with MSCNode

use of org.eclipse.titan.log.viewer.views.msc.ui.core.MSCNode in project titan.EclipsePlug-ins by eclipse.

the class MSCModel method addSetVerdict.

private MSCNode[] addSetVerdict(final String ref, final String name, final String time, final int occurrence) {
    MSCNode[] temp = new MSCNode[2];
    if ((ref == null) || (ref.length() == 0)) {
        SetverdictUnknown setverdictUnknown = new SetverdictUnknown(occurrence, name);
        setverdictUnknown.setName(name);
        temp[0] = setverdictUnknown;
    } else {
        // Get life line
        Lifeline tmpLifeline = this.lifelines.get(ref);
        if (tmpLifeline == null) {
            return new MSCNode[] {};
        }
        SetverdictComp setverdictComp = new SetverdictComp(occurrence, tmpLifeline, name);
        setverdictComp.setName(name);
        temp[0] = setverdictComp;
    }
    // Create and add Time Stamp
    temp[1] = new TimeStampNode(occurrence, time);
    return temp;
}
Also used : TimeStampNode(org.eclipse.titan.log.viewer.views.msc.ui.core.TimeStampNode) SetverdictUnknown(org.eclipse.titan.log.viewer.views.msc.ui.core.SetverdictUnknown) Lifeline(org.eclipse.titan.log.viewer.views.msc.ui.core.Lifeline) MSCNode(org.eclipse.titan.log.viewer.views.msc.ui.core.MSCNode) SetverdictComp(org.eclipse.titan.log.viewer.views.msc.ui.core.SetverdictComp)

Example 9 with MSCNode

use of org.eclipse.titan.log.viewer.views.msc.ui.core.MSCNode in project titan.EclipsePlug-ins by eclipse.

the class MSCModel method terminateComponent.

private MSCNode[] terminateComponent(final String ref, final String time, final int occurrence) {
    // Get life line
    Lifeline tmpLifeline = this.lifelines.get(ref);
    if (tmpLifeline == null) {
        return new MSCNode[] {};
    }
    // Get name
    String name = getComponentNameFromReference(ref);
    if (!name.contentEquals(this.sutName) && !name.contentEquals(MSCConstants.MTC_NAME) && !name.contentEquals(ref)) {
        // $NON-NLS-1$ //$NON-NLS-2$
        name = name + " (" + ref + ")";
    }
    // Create and add stop
    String verdict = getComponentVerdictFromReference(ref);
    ComponentTermination stop = new ComponentTermination(occurrence, tmpLifeline, verdict);
    stop.setName(name);
    tmpLifeline.setStop(stop);
    // Create and add Time Stamp
    return new MSCNode[] { stop, 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) ComponentTermination(org.eclipse.titan.log.viewer.views.msc.ui.core.ComponentTermination)

Example 10 with MSCNode

use of org.eclipse.titan.log.viewer.views.msc.ui.core.MSCNode in project titan.EclipsePlug-ins by eclipse.

the class MSCModel method addSilentEvent.

private MSCNode[] addSilentEvent(final String ref, final String name, final String type, final String time, final int occurrence) {
    String silentEventType = null;
    Set<String> types = Constants.EVENT_CATEGORIES.keySet();
    for (String currType : types) {
        if (type.startsWith(currType)) {
            silentEventType = currType;
            break;
        }
    }
    if (silentEventType == null) {
        return new MSCNode[] {};
    }
    // Get life line
    Lifeline tmpLifeline = this.lifelines.get(ref);
    if (tmpLifeline == null) {
        return new MSCNode[] {};
    }
    // Create and add silent event
    SilentEvent silentEvent = new SilentEvent(occurrence, tmpLifeline, type);
    // $NON-NLS-1$
    silentEvent.setName(type + "\n" + name);
    // Create and add Time Stamp
    return new MSCNode[] { silentEvent, 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) SilentEvent(org.eclipse.titan.log.viewer.views.msc.ui.core.SilentEvent)

Aggregations

MSCNode (org.eclipse.titan.log.viewer.views.msc.ui.core.MSCNode)14 TimeStampNode (org.eclipse.titan.log.viewer.views.msc.ui.core.TimeStampNode)10 Lifeline (org.eclipse.titan.log.viewer.views.msc.ui.core.Lifeline)9 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 LogRecord (org.eclipse.titan.log.viewer.parsers.data.LogRecord)1 ComponentCreation (org.eclipse.titan.log.viewer.views.msc.ui.core.ComponentCreation)1 ComponentTermination (org.eclipse.titan.log.viewer.views.msc.ui.core.ComponentTermination)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 ReceiveSignal (org.eclipse.titan.log.viewer.views.msc.ui.core.ReceiveSignal)1 SendSignal (org.eclipse.titan.log.viewer.views.msc.ui.core.SendSignal)1 SetverdictComp (org.eclipse.titan.log.viewer.views.msc.ui.core.SetverdictComp)1