Skip to content
Snippets Groups Projects
Commit 5391e924 authored by martiivGylden's avatar martiivGylden
Browse files

Working on front end, will implement associated comps for metrics

parent 83a0118b
No related branches found
No related tags found
No related merge requests found
...@@ -93,7 +93,7 @@ def tempTestFunction(): ...@@ -93,7 +93,7 @@ def tempTestFunction():
top.geometry("1250x1200") top.geometry("1250x1200")
top.minsize(windowWidth, windowHeight) top.minsize(windowWidth, windowHeight)
mainFrame = customtkinter.CTkScrollableFrame(top, width=windowWidth, height=windowHeight) mainFrame = customtkinter.CTkScrollableFrame(top, width=windowWidth, height=windowHeight, bg_color="#155E53")
mainFrame.grid() mainFrame.grid()
mainFrame.grid_rowconfigure(0, weight=1) mainFrame.grid_rowconfigure(0, weight=1)
...@@ -103,13 +103,27 @@ def tempTestFunction(): ...@@ -103,13 +103,27 @@ def tempTestFunction():
def createMetrics(diagram: Diagram, frame, canvasWidth): def createMetrics(diagram: Diagram, frame, canvasWidth):
s = ttk.Style() s = ttk.Style()
s.theme_use('classic') s.theme_use('classic')
s.configure('RankFrame.TFrame', background='red', relief='raised') s.configure('Test.TFrame', background='#51D88F',foreground="#1A323B", relief='raised')
s.configure('Head.TLabel', background='#51D88F', foreground="#1A323B" ,font=('Helvetica', 20, 'bold'))
s.configure('Test.TLabel', background='#51D88F', foreground="#1A323B" ,font=('Helvetica', 20))
metrics = diagram.metrics.values() metrics = diagram.metrics.values()
rowIndex = 0 rowIndex = 0
topLabel = ttk.Label(frame, text="Ranked metrics", font=("Helvetica", 20, "bold")) scoreFrame = ttk.Frame(frame, height=100, width=canvasWidth, padding=10, style='Test.TFrame')
topLabel.grid(row=0, column=0, sticky="nw") scoreFrame.grid(padx=10, pady=25, sticky="nsew")
scoreFrame.grid_columnconfigure(0, weight=1)
headerLabel = ttk.Label(scoreFrame, text="Diagram scorecard", font=("Helvetica", 25, "bold"), style="Head.TLabel")
label1 = ttk.Label(scoreFrame, text=f"Diagrams parsed! Below is the list of found metrics along with the amount of relationships. Further down you will find the list of metrics with usage and associated components", wraplength=0.5*canvasWidth ,font=("Helvetica", 20), style="Test.TLabel")
label2 = ttk.Label(scoreFrame, text=f"Number of metrics: {len(diagram.metrics)}", font=("Helvetica", 20), style="Test.TLabel")
label3 = ttk.Label(scoreFrame, text=f"Number of annotated relationships: {len(diagram.dynamics)}", font=("Helvetica", 20), style="Test.TLabel")
headerLabel.grid(row=0, column=0, sticky="nw")
label1.grid(row=1, column=0, sticky="nw", pady=10)
label2.grid(row=2, column=0, sticky="nw")
label3.grid(row=3, column=0, sticky="nw")
associatedList = {} # Needed to keep track of the number of associated components per metric associatedList = {} # Needed to keep track of the number of associated components per metric
...@@ -126,15 +140,12 @@ def createMetrics(diagram: Diagram, frame, canvasWidth): ...@@ -126,15 +140,12 @@ def createMetrics(diagram: Diagram, frame, canvasWidth):
metricValue = diagram.metrics[metricID].value metricValue = diagram.metrics[metricID].value
metricDate = diagram.metrics[metricID].date metricDate = diagram.metrics[metricID].date
s.configure('Test.TFrame', background='white', relief='raised')
s.configure('Head.TLabel', background='white', font=('Helvetica', 20, 'bold'))
s.configure('Test.TLabel', background='white', font=('Helvetica', 20))
metricFrame = ttk.Frame(frame ,style='Test.TFrame', height= 200, width=canvasWidth, padding=5) # Frame for each metric, should cover 80% of the window and stack vertically metricFrame = ttk.Frame(frame ,style='Test.TFrame', height= 200, width=canvasWidth, padding=5) # Frame for each metric, should cover 80% of the window and stack vertically
metricFrame.grid(padx=10, pady=10, sticky="nsew") metricFrame.grid(padx=10, pady=10, sticky="nsew")
metricFrame.grid_rowconfigure(0, weight=1) metricFrame.grid_rowconfigure(0, weight=1)
metricFrame.grid_columnconfigure(0, weight=1) metricFrame.grid_columnconfigure(0, weight=1)
rowIndex +=1 # Increment the row index for the next frame rowIndex +=1 # Increment the row index for the next frame
ttk.Label(metricFrame, text= f"Metric number: {rowIndex}", style="Head.TLabel").grid(row=0, column=0, sticky="nw") ttk.Label(metricFrame, text= f"Metric number: {rowIndex}", style="Head.TLabel").grid(row=0, column=0, sticky="nw")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment