-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUMLClassDiagram.puml
More file actions
153 lines (129 loc) · 3.01 KB
/
Copy pathUMLClassDiagram.puml
File metadata and controls
153 lines (129 loc) · 3.01 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
@startuml
abstract class Shape {
-id <<+get>> : int
+{abstract} calculateArea() : double
+{abstract} calculatePerimeter() : double
}
class Circle {
-r : float
+toString() : String
}
class EquilateralTriangle {
-a : float
+toString() : String
}
class Rectangle {
-a : float
-b : float
+toString() : String
}
class RegularPentagon {
-a : float
+toString() : String
}
class Square {
-a : float
+toString() : String
}
class Triangle {
-a : float
-b : float
-c : float
-s : float
+toString() : String
}
class ShapeCollection {
-tableBuilder : TableBuilder
-shapes : ArrayList<Shape>
+addShape(int, ArrayList<Integer>) : void
-nextId() : int
+getShapesTable() : String
+getLargestShapeByPerimeter() : Shape
+getLargestShapeByArea() : Shape
}
class AsciiArts {
+{static} welcome : String
+{static} shapeAdded : String
+{static} mainMenu : String
+{static} addNewShape : String
+{static} showAllShapes : String
+{static} showShapeWithLargestPerimeter : String
+{static} showShapeWithLargestArea : String
+{static} showFormulas : String : String
+{static} credits : String
+{static} exit : String
+{static} circle : String
+{static} rectangle : String
+{static} triangle : String
+{static} square : String
+{static} equilateralTriangle : String
+{static} regularPentagon : String
}
class ConsoleApplication {
-mainMenu : MainMenu
-isRunning : boolean
-inputWasWrong : boolean
-option : int
+run() : void
-greeting() : void
-askForInputAndShowMainMenu() : void
}
class FormulaProvider {
+{static}getAreaFormulaForShape() : String
+{static}getPerimeterFormulaForShape() : String
}
class MainMenu {
-shapeCollection : ShapeCollection
-inputWasWrong : boolean
-option : int
+addNewShape() : void
+showAllShapes() : void
+showShapeWithLargestPerimeter() : void
+showShapeWithLargestArea() : void
+showFormulas() : void
+credits() : void
+exit() : void
-printFormulasOfShape(int) : void
-getParametersForShapeCreation(int) : ArrayList<Integer>
+showMainMenu(boolean) : void
-shapeOptionsMenu() : String
-askForShapeChoice(String, String) : void
}
class TableBuilder {
-columnNames : String[]
-columnLengths : HashMap<String, Integer>
+buildTable : String
-setTableColumnLengths(ArrayList<Shape>)
-createTopLine() : String
-createBottomLine() : String
-getTableMiddlePartLength() : int
-createLineMiddleSection() : String
-createHeaderRow() : String
-createTableData(ArrayList<Shape>) : String
-createMiddleLine() : String
-createSeparatorLine() : String
-centerText(String, int)() : String
-padLeftText(String, int)() : String
}
class Util {
+{static} console : Console
+{static} pressEnterToContinue() : void
+{static} consoleClear() : void
}
Shape <|-- Circle
Shape <|-- EquilateralTriangle
Shape <|-- Rectangle
Shape <|-- RegularPentagon
Shape <|-- Square
Shape <|-- Triangle
ConsoleApplication o-right- MainMenu
MainMenu o-- ShapeCollection
MainMenu .. AsciiArts
ConsoleApplication .. AsciiArts
ShapeCollection o-- Shape
Util .. ConsoleApplication
Util .. MainMenu
TableBuilder --o ShapeCollection
FormulaProvider .. MainMenu
FormulaProvider .. TableBuilder
@enduml