主要内容

本页采用了机器翻译。点击此处可查看最新英文版本。

move

在交互中移动生命线

自 R2024b 起

    说明

    move(lifeline, Before=beforeLifeline)lifeline 指定的生命线置于 beforeLifeline 指定的生命线之前。

    move(lifeline, After=afterLifeline)lifeline 指定的生命线紧接在 afterLifeline 指定的生命线之后。

    示例

    示例

    全部折叠

    您可以通过编程移动序列图中的生命线。本示例假定您已打开 以编程方式创建序列图 中的 TLExample 模型。您可以使用 move 函数将 poller 生命线放在 source 生命线之前。

    打开 Inhibit 序列图。

    model = systemcomposer.openModel("TLExample");
    diagram = getInteraction(model, "Inhibit");

    Inhibit sequence diagram.

    从交互中获取 poller 生命线和 source 生命线。

    pollerLifeline = findLifeline(diagram, Name="poller");
    sourceLifeline = findLifeline(diagram, Name="source");

    pollerLifeline 救生绳放在 sourceLifeline 救生绳之前。

    move(pollerLifeline, Before=sourceLifeline);

    Inhibit sequence diagram with the source lifeline placed to the right of the poller lifeline.

    diagram.open;

    输入参数

    全部折叠

    要移动的生命线,指定为 systemcomposer.interaction.Lifeline 对象。

    在交互中将生命线置于其之前的现有生命线,指定为 systemcomposer.interaction.Lifeline 对象。该生命线必须与 lifeline 生命线处于相同的交互中,并且与 lifeline 生命线具有相同的父生命线。

    在交互中将生命线置于其后的现有生命线,指定为 systemcomposer.interaction.Lifeline 对象。该生命线必须与 lifeline 生命线处于相同的交互中,并且与 lifeline 生命线具有相同的父生命线。

    详细信息

    全部折叠

    版本历史记录

    在 R2024b 中推出