-
Notifications
You must be signed in to change notification settings - Fork 1
/
UML2JavaFX.atlc
65 lines (62 loc) · 1.42 KB
/
UML2JavaFX.atlc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
module UMLClassDiagram2JavaFX;
create OUT : JFX from IN : UML;
rule Package2Rectangle {
from
p : UML!Package
to
r : JFX!Rectangle (
fill <- 'lightblue',
stroke <- 'black'
),
t : JFX!Text (
stroke <- 'black',
text <- p.name,
origin <- #TOP
)
with {
medium stay r.topLeft suggest {90, 120},
weak minimize r.height,
weak minimize r.width,
t.topLeft = r.topLeft.dx(5),
r.width >= 100,
r.height >= 100,
r contains p.packagedElement
}
}
rule Class2Rectangle {
from
c : UML!Class
to
r : JFX!Rectangle (
fill <- 'white',
stroke <- 'black'
),
t : JFX!Text (
stroke <- 'black',
text <- c.name,
origin <- #TOP
)
with {
medium stay r.topLeft suggest {350, 350},
medium minimize r.height,
medium minimize r.width,
r.height >= 25,
r.width >= t.width,
t.topLeft.x = r.topLeft.x,
t.topLeft.y = r.topLeft.y + 5,
r.bottomRight.y >= t.bottomRight.y
}
}
rule Association2Line {
from
a : UML!Association
to
l : JFX!Line (
stroke <- 'black'
)
with {
a.first contains l.start,
a.second contains l.end,
weak l.start minimizeDistance l.end
}
}