-
Notifications
You must be signed in to change notification settings - Fork 0
/
personElement.sj
41 lines (36 loc) · 1.01 KB
/
personElement.sj
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
@heap
personElement #element #clickable (
id : empty'string
_rect := rect()
_clickGesture := clickGesture() // TODO:
getSize(maxSize : 'size) { maxSize }
getRect()'rect { _rect }
setRect(r : 'rect) {
if _rect != r {
_rect = r
_clickGesture.rect = r
}
void
}
render(scene : 'scene2d) {
void
}
onClickGestureEnter(element : '#element) { void }
onClickGestureLeave(element : '#element) { void }
onClickGesturePress(element : '#element) { void }
onClickGestureClick(element : '#element) {
log.trace(parent.type, ^{ "clicked" })
ifValid id {
fieldController.selectPerson(id)
forestController.selectPerson(id)
}
void
}
fireMouseEvent(mouseEvent : 'mouseEvent) {
log.trace(parent.type, ^{ mouseEvent.asString() })
_clickGesture.fireMouseEvent(mouseEvent)
}
) {
_clickGesture = clickGesture(this as #element, this as #clickable)
this
}