This repository has been archived by the owner on Aug 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
current-architecture.wsd
99 lines (81 loc) · 1.74 KB
/
current-architecture.wsd
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
@startuml canvas-view-classes
title Drawing App – A rough overview of the most important relationships
interface Page {
onInit()
onDestroy()
getHtml()
}
interface ShapeManager {
updateConfiguration(config: Configuration,applyChangesOnSelection: boolean)
updateZOrder(toForeground:boolean)
deleteSelection()
unselectAll()
getConfiguration(): Configuration
onUpdateCallback((updates: UpdatesFromCanvas) => void)
}
interface ToolManager {
onUpdate(callback: (settings: Settings) => void)
setSettings(settings: Settings)
getSettings(): Settings;
}
interface Shape {
id: number
draw():void
}
abstract AbstractShape{}
abstract AbstractView{}
class CanvasView {
canvas: ShapeManager
toolArea: ToolManager
apiClient: ApiClient
userManager: UserManager
}
note right of CanvasView
Mediator/Controller
end note
class Canvas {
-shapes: Shape[]
-ctx: CanvasRenderingContext2D
-draw()
}
note left of Canvas
Pseudo-implementation as intuition.
end note
class ShapeFactory {
create(): Shape
calculateRadius(from: Point2D, to: Point2D): number
createZOrder(shapes: Shape[], toForeground = true)
}
note bottom of ShapeFactory
Factory Method "create()"
end note
class Circle {
draw(ctx: CanvasRenderingContext2D)
}
note bottom of Circle
Beside Line, Rectangle and Triangle
end note
class ToolArea {}
enum ShapeType {
Circle
Line
Rectangle
Triangle
}
enum ToolType {
Move
Select
Draw
}
ToolArea --|> ToolManager
ShapeFactory *--> Circle : erzeugt
Circle --|> Shape
Circle --|> AbstractShape
Canvas --|> ShapeManager
Canvas "1" o--> "0..*" Circle : zeichnet
Canvas "1" *--> "1" ShapeFactory
CanvasView "1" *--> "1" ToolArea
CanvasView "1" *--> "1" Canvas
CanvasView --|> Page
CanvasView --|> AbstractView
@enduml