From a156a87733285f21f14740f925514406d88607ed Mon Sep 17 00:00:00 2001 From: Fastium <79766552+Fastium@users.noreply.github.com> Date: Wed, 18 May 2022 09:52:25 +0200 Subject: [PATCH] =?UTF-8?q?Co-authored-by:=20R=C3=A9mi=20Heredero=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/launch.json | 7 +++++ bin/BillGUI/App.class | Bin 649 -> 0 bytes bin/BillGUI/HesSoGarage.class | Bin 0 -> 845 bytes bin/BillGUI/ManagerGui.class | Bin 664 -> 1915 bytes bin/BillGUI/Row.class | Bin 0 -> 522 bytes src/BillGUI/App.java | 11 ------- src/BillGUI/HesSoGarage.java | 12 ++++++++ src/BillGUI/ManagerGui.java | 56 ++++++++++++++++++++++++++++++++-- 8 files changed, 72 insertions(+), 14 deletions(-) delete mode 100644 bin/BillGUI/App.class create mode 100644 bin/BillGUI/HesSoGarage.class create mode 100644 bin/BillGUI/Row.class delete mode 100644 src/BillGUI/App.java create mode 100644 src/BillGUI/HesSoGarage.java diff --git a/.vscode/launch.json b/.vscode/launch.json index 04c4a81..56147c4 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,5 +1,12 @@ { "configurations": [ + { + "type": "java", + "name": "Launch HesSoGarage", + "request": "launch", + "mainClass": "BillGUI.HesSoGarage", + "projectName": "Lab15_OOP_79fdc875" + }, { "type": "java", "name": "Launch GUI2", diff --git a/bin/BillGUI/App.class b/bin/BillGUI/App.class deleted file mode 100644 index 5ed50fbe591648e8f6257157583f85480ab3f944..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 649 zcmZuuU279T6g`vdW;ffdjY+>7HPx3yu=^qiwiQ$`1Y#{z^U?>ItiyK7W;RSV?VJC} zr-Fh%z#k<&yHP4c2JZJg=iWQNet-W7;02y|s0ggQ(P`TMG>BeLryd-E#-+THQ7TOm zeHdS=I2WiLX`}O30@ZGBB;dTwzNi3I)I+$a39JpZQ77}sS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N=l3lr0S~z@;w0A|D6CH#nUTgs8e`z2rGC*=>=me5?$fVZLle+aCl}2 k$__q9lLnz-&HuU(lwF{AhYfE$VA1$Y;0$p~JR5-bKl^&ixBvhE delta 331 zcmX9&%Syvg6r7VZO^r!S6K$#N2jP_hwpA>yt?ipxTm@qt7%f<{|G@EhcA{0$c+ zpx_7iO9kR5=32bK*o7hhlVAB z?D<0#HG+K|KgD4@&cgnEaxsXX?;bM^ChWqvOi(!O4;MhF>rhZuu}ZLt&?I~qC+Ssq zGKkMEZ!|QpR%BY@RC3B~9V#kfCigW;2^8_Y700EXs3&72yNHAo3{DoUC_qx`#(-WPL zA?b2QxD3m-dV96{LrJd}w#rr+wEna7JP|MyW`SmuCuHtOdNMp_$d@KaRKFPpRH#~R zF(m5#gU}I2#y|=S4DnLAr6J3Z``=TCiJao}6iAhUB<3^}D4b!Z?RDglQQ(>Z4f719 zEj@8HcydH=%Nx5Wdg?$cx|HtuuUBp=}>=ne*lR`Zu0;D literal 0 HcmV?d00001 diff --git a/src/BillGUI/App.java b/src/BillGUI/App.java deleted file mode 100644 index 0812c0a..0000000 --- a/src/BillGUI/App.java +++ /dev/null @@ -1,11 +0,0 @@ -package BillGUI; - -public class App { - public static void main(String[] args) { - int rows = 9; - int cols = 2; - String name = "Garage manager \n Prestations"; - String logoFilePath = "src/logo_garage.png"; - new ManagerGui(rows, cols, name, logoFilePath); - } -} diff --git a/src/BillGUI/HesSoGarage.java b/src/BillGUI/HesSoGarage.java new file mode 100644 index 0000000..90e3c50 --- /dev/null +++ b/src/BillGUI/HesSoGarage.java @@ -0,0 +1,12 @@ +package BillGUI; + +public class HesSoGarage { + public static void main(String[] args) { + GarageManager garageManager = new GarageManager(); + ManagerGui managerGui; + String name = "Garage manager
Prestations"; + String logoFilePath = "src/logo_garage.png"; + managerGui = new ManagerGui(name, logoFilePath, garageManager.getServices()); + } +} + diff --git a/src/BillGUI/ManagerGui.java b/src/BillGUI/ManagerGui.java index 10d0432..0d38a1b 100644 --- a/src/BillGUI/ManagerGui.java +++ b/src/BillGUI/ManagerGui.java @@ -2,6 +2,7 @@ package BillGUI; import java.awt.*; import java.awt.event.*; +import java.util.Vector; import javax.swing.*; /** @@ -11,13 +12,62 @@ public class ManagerGui extends JFrame{ GridLayout grid; JLabel Jname; JLabel Jlogo; + ImageIcon logo; + + Vector prestations = new Vector<>(); - public ManagerGui(int n,int m, String name, String logoFilePath){ - grid = new GridLayout(n,m); + /** + * + */ + public ManagerGui(String name, String logoFilePath, String[] prestationsName){ + this.setSize(400,600); + this.setLocation(600,200); + this.setVisible(true); + + grid = new GridLayout(prestationsName.length + 2,2); + this.setLayout(grid); + + //Create and add header + logo = new ImageIcon(logoFilePath); + Jlogo = new JLabel(name); Jname = new JLabel(name); + this.add(Jname); + this.add(Jlogo); + + + //Create rows for prestations + for(String s : prestationsName){ + prestations.add(new Row(s)); + + } + //add rows on the Jframe + for(Row r : prestations){ + this.add(r.label); + this.add(r.spinner); + } + + //Create and add button + JButton ButtonBill = new JButton(); + JButton ButtonQuit = new JButton(); + this.add(ButtonBill); + this.add(ButtonQuit); + + + } - +} + +class Row { + JLabel label; + JSpinner spinner; + + Row(String title){ + label = new JLabel(title); + spinner = new JSpinner(); + } } + +