Files
Minint/Report/lab2/newuml/dz-v1-editor-animation-flow.puml
2026-04-10 02:21:47 +03:00

57 lines
1.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@startuml dz-v1-editor-animation-flow
title ДЗ.В1 — анимация (EditorViewModel)
skinparam shadowing false
skinparam ActivityFontSize 11
skinparam ActivityBackgroundColor #F8F8F8
start
partition PlayAnimation {
if (Container == null || Documents.Count < 2?) then (да)
stop
endif
if (IsPlaying?) then (да)
stop
endif
:IsPlaying = true;
:_animationFrameIndex = индекс ActiveDocument;
}
partition AdvanceAnimationFrame {
if (Container == null || !IsPlaying?) then (да)
:StopAnimation();
stop
endif
if (Documents.Count == 0?) then (да)
:StopAnimation();
stop
endif
:index %= Count; doc = Documents[index];
:suppress on; ActiveDocument = doc; suppress off;
:RefreshCanvasFor(doc);
:delay = max(FrameDelayMs, 10);
:новый DispatcherTimer(delay);
note right
Tick: Stop timer, index++,
снова AdvanceAnimationFrame
end note
:Start();
}
floating note left
Цикл: каждый Tick на UI-потоке
снова вызывает AdvanceAnimationFrame.
Пауза кадра — FrameDelayMs документа.
end note
stop
legend right
StopAnimation: стоп таймера, IsPlaying=false,
SyncLayersAndCanvas. Команда Stop или
выход из Advance при ошибке состояния.
end legend
@enduml