forked from HEL/chronos
refactored sequences, sync and gaps
This commit is contained in:
@ -379,13 +379,9 @@
|
||||
// Draw elements
|
||||
for elmt in elements {
|
||||
if not is-elmt(elmt) {
|
||||
shapes.push(elmt)
|
||||
|
||||
// Sequences
|
||||
} else if elmt.type == "seq" {
|
||||
let shps
|
||||
(y, lifelines, shps) = draw-seq(elmt, y, lifelines)
|
||||
shapes += shps
|
||||
(elmt,)
|
||||
} else if "draw" in elmt and elmt.type != "par" {
|
||||
(elmt.draw)(elmt)
|
||||
|
||||
// Groups (start) -> reserve space for labels + store position
|
||||
} else if elmt.type == "grp" {
|
||||
@ -440,10 +436,6 @@
|
||||
let shps
|
||||
(y, shps) = draw-sep(elmt, y)
|
||||
shapes += shps
|
||||
|
||||
// Gap
|
||||
} else if elmt.type == "gap" {
|
||||
y -= elmt.size
|
||||
|
||||
// Delay
|
||||
} else if elmt.type == "delay" {
|
||||
@ -465,30 +457,6 @@
|
||||
}
|
||||
y = y1
|
||||
|
||||
// Event
|
||||
} else if elmt.type == "evt" {
|
||||
let par-name = elmt.participant
|
||||
let i = pars-i.at(par-name)
|
||||
let par = participants.at(i)
|
||||
let line = lifelines.at(i)
|
||||
if elmt.event == "disable" {
|
||||
line.level -= 1
|
||||
line.lines.push(("disable", y))
|
||||
|
||||
} else if elmt.event == "destroy" {
|
||||
line.lines.push(("destroy", y))
|
||||
|
||||
} else if elmt.event == "enable" {
|
||||
line.level += 1
|
||||
line.lines.push(("enable", y, elmt.lifeline-style))
|
||||
|
||||
} else if elmt.event == "create" {
|
||||
y -= CREATE-OFFSET
|
||||
shapes += participant.render(x-pos, par, y: y)
|
||||
line.lines.push(("create", y))
|
||||
}
|
||||
lifelines.at(i) = line
|
||||
|
||||
// Note
|
||||
} else if elmt.type == "note" {
|
||||
if not elmt.linked {
|
||||
@ -499,12 +467,6 @@
|
||||
(y, shps) = draw-note(elmt, y, lifelines)
|
||||
shapes += shps
|
||||
}
|
||||
|
||||
// Synched sequences
|
||||
} else if elmt.type == "sync" {
|
||||
let shps
|
||||
(y, lifelines, shps) = draw-sync(elmt, y, lifelines)
|
||||
shapes += shps
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user