From 21070c07be0dbf3a58c129fe719bda8303cbb8b5 Mon Sep 17 00:00:00 2001 From: Fastium <79766552+Fastium@users.noreply.github.com> Date: Thu, 19 May 2022 11:34:04 +0200 Subject: [PATCH 1/4] comment on managerGui --- bin/BillGUI/ButtonListenerManager.class | Bin 1184 -> 1184 bytes bin/BillGUI/ManagerGui$1.class | Bin 1996 -> 1996 bytes bin/BillGUI/ManagerGui$2.class | Bin 878 -> 878 bytes bin/BillGUI/ManagerGui.class | Bin 2665 -> 2665 bytes bin/BillGUI/Row.class | Bin 522 -> 522 bytes src/BillGUI/ManagerGui.java | 23 ++++++++++++----------- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/bin/BillGUI/ButtonListenerManager.class b/bin/BillGUI/ButtonListenerManager.class index a064d34b3aa8c53f4d9dd26571536debac5f6c24..bbff05fa0048a979dc86111df302c25ae4d45727 100644 GIT binary patch delta 49 zcmZ3$xqx%SB4)v21{Q`A22O@j20n%|24RNs$(xz0IV*vpRY1||$>uChjCGT%SkwR= CcndxN delta 49 zcmZ3$xqx%SB4)uN1{Q{522O?&20n&T24RM>$(xz0IV*sol|a#|$>uChjJ1=iSkwR< Cp$jzt diff --git a/bin/BillGUI/ManagerGui$1.class b/bin/BillGUI/ManagerGui$1.class index 4368c43328603378f5bd0a76fb061307d0deb9b1..9db698e233eb9aec7f279926581a93609398c882 100644 GIT binary patch delta 51 zcmX@Ze};cUJR76cidpa_%*J81 zd&@Z|oKly%@YT6Vl{z&nLrnu4j}{}^#B`YAvZBixp929$dYtH!F(7Bi&72S8Cn0Yl jK8*RA{xOjXu{bQmV<{0EN!ZGa9VxI!fy}vF@9Omj^o18J delta 139 zcmaDU@=|1j24}rA0}F!y0~doJkQ8B%W)NjiV~}AmV31|7Vvu97XHa19XHaAaXHa2C zW>94)0?O7gs57)PXfRA*&|z4@pv$loNbd*gxXxh6@Q}fX;Wd!`mBEaWiNTyvlEI5n ljlrAIgdvpCnjwtQi6Mfak%56BhJllTfzg?vY4UQ;Ljc=h7SsR$ diff --git a/bin/BillGUI/Row.class b/bin/BillGUI/Row.class index f5075da54a1e88f87c03f2cbb7fb88a29040b95f..58322f72b990dbda07bd7fe936a8d0a5c02e1283 100644 GIT binary patch delta 25 gcmeBT>0;S%osl<%frTNJL4YBRL7E|b@)Jfi080;S%osl=0frTN3L4YBZL7E|L@)Jfi08-@!5dZ)H diff --git a/src/BillGUI/ManagerGui.java b/src/BillGUI/ManagerGui.java index b02f5aa..60520d9 100644 --- a/src/BillGUI/ManagerGui.java +++ b/src/BillGUI/ManagerGui.java @@ -6,7 +6,7 @@ import java.util.Vector; import javax.swing.*; /** - * + * HMI for calculate the bill */ public class ManagerGui extends JFrame { GridLayout grid; @@ -22,13 +22,17 @@ public class ManagerGui extends JFrame { /** - * + * initialize the window + * @param name name of the garage + * @param logoFilePath file of the garage's logo + * @param prestationsName array with the name of the prestations + * @param garageManager a new garage application */ public ManagerGui(String name, String logoFilePath, String[] prestationsName, GarageManager garageManager){ + //set up the window with the layout this.setSize(400,600); this.setLocation(600,200); this.setVisible(true); - grid = new GridLayout(prestationsName.length + 2,2); this.setLayout(grid); @@ -39,7 +43,6 @@ public class ManagerGui extends JFrame { this.add(Jname); this.add(Jlogo); - //Create rows for prestations for(String s : prestationsName){ prestations.add(new Row(s)); @@ -54,7 +57,7 @@ public class ManagerGui extends JFrame { JButton buttonBill = new JButton(buttonNameBill); buttonBill.addActionListener(new ButtonListenerManager(valuePrestations, prestations, garageManager){ /** - * + * add the number of prestations when it is used */ @Override public void actionPerformed(ActionEvent e){ @@ -66,7 +69,7 @@ public class ManagerGui extends JFrame { } System.out.println(value); } - + //Create the bill new BillGui(garageManager.generateHTMLBill(valuePrestations)); }; }); @@ -74,7 +77,7 @@ public class ManagerGui extends JFrame { JButton buttonQuit = new JButton(buttonNameQuit); buttonQuit.addActionListener(new ButtonListenerManager(this){ /** - * + * quit the window */ @Override public void actionPerformed(ActionEvent e){ @@ -84,18 +87,16 @@ public class ManagerGui extends JFrame { this.add(buttonBill); this.add(buttonQuit); - } } /** - * + * Create a row in the windows with a label and a spinner */ class Row { JLabel label; JSpinner spinner; - Row(String title){ label = new JLabel(title); spinner = new JSpinner(); @@ -103,7 +104,7 @@ class Row { } /** - * + * listener for detect the button */ class ButtonListenerManager implements ActionListener { JFrame Jf; From e245dcba5224a0dfc6b3242e1d6f859c3cd8e615 Mon Sep 17 00:00:00 2001 From: Fastium <79766552+Fastium@users.noreply.github.com> Date: Thu, 19 May 2022 12:35:53 +0200 Subject: [PATCH 2/4] comment in hessoGarage and biullGui --- .vscode/launch.json | 14 ++++++++++++++ bin/BillGUI/HesSoGarage.class | Bin 841 -> 841 bytes bin/GUI/ButtonListener.class | Bin 1126 -> 1126 bytes bin/GUI/GUI1.class | Bin 1320 -> 1320 bytes bin/GUI/GUI2.class | Bin 1497 -> 1497 bytes bin/GUI/Listener.class | Bin 1136 -> 1136 bytes src/BillGUI/HesSoGarage.java | 2 ++ src/GUI/GUI1.java | 1 - src/GUI/GUI2.java | 1 - 9 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index bbb66eb..61d0a31 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,5 +1,19 @@ { "configurations": [ + { + "type": "java", + "name": "Launch GUI2", + "request": "launch", + "mainClass": "GUI.GUI2", + "projectName": "Lab15_OOP_79fdc875" + }, + { + "type": "java", + "name": "Launch GUI1", + "request": "launch", + "mainClass": "GUI.GUI1", + "projectName": "Lab15_OOP_79fdc875" + }, { "type": "java", "name": "Launch HesSoGarage", diff --git a/bin/BillGUI/HesSoGarage.class b/bin/BillGUI/HesSoGarage.class index ae13f61289e41dfc67418f60b99d49f96de01816..41797021427f22c20f152b37df0ad12d6758d6f9 100644 GIT binary patch delta 29 jcmX@fc9LzwKPEvo1`Y;x25un9$H2uP&A>gGpVi_@% delta 83 zcmZ3%wSsHIFJ@Lj1~vwv$^V&G*a|bSFo-g6F^DmUFo-kAF-S0IFi0~PFvu{NGRQO7 mGbk{4GAJ?xGbk}cGAJ{|GpI16GN>|S1636;Xia{?;sO9i+6?^w diff --git a/bin/GUI/GUI2.class b/bin/GUI/GUI2.class index c550513a48821ae3974f5a5283042e921621c0f5..798431555684ef24154276432994ba2329d1726e 100644 GIT binary patch delta 87 zcmWN{s}4Y50D#di{1hAJHrKIX1YJ=yT~Q@T(-fxYUPSaN-iDLUtGvp62uVdoyH4@6 oIsyX~6BmmJn*xUlj~btbfR2!!n305ul$nf$ob{g@<+V%02T?~1)c^nh delta 87 zcmcb~eUp1bGYcy}0~>?D Hv8Vw65V8qY delta 51 zcmeys@quH*5@t~=1{MZm22KWR20jKG24MzU1_=hc$vc@_cwHH|8Qd6@8QdB47(6F? Hv8Vw65u^!V diff --git a/src/BillGUI/HesSoGarage.java b/src/BillGUI/HesSoGarage.java index a3fee25..32e6e9a 100644 --- a/src/BillGUI/HesSoGarage.java +++ b/src/BillGUI/HesSoGarage.java @@ -2,9 +2,11 @@ package BillGUI; public class HesSoGarage { public static void main(String[] args) { + //Create a new garage GarageManager garageManager = new GarageManager(); String name = "Garage manager
Prestations"; String logoFilePath = "src/logo_garage.png"; //TODO redimensionnement automatique + //Create a new HMI for calculate and print the bill new ManagerGui(name, logoFilePath, garageManager.getServices(), garageManager); //TODO affichage sans redimensionnement } } diff --git a/src/GUI/GUI1.java b/src/GUI/GUI1.java index 04024be..e0dfb53 100644 --- a/src/GUI/GUI1.java +++ b/src/GUI/GUI1.java @@ -1,5 +1,4 @@ package GUI; -//TODO mettre commentaire import javax.swing.*; diff --git a/src/GUI/GUI2.java b/src/GUI/GUI2.java index aad4fb6..4ab0810 100644 --- a/src/GUI/GUI2.java +++ b/src/GUI/GUI2.java @@ -1,5 +1,4 @@ package GUI; -//TODO mettre commentaire import javax.swing.*; import javax.swing.event.ChangeEvent; From 91320444a5fa80eefa2114c2644d4aa8027fd62e Mon Sep 17 00:00:00 2001 From: Fastium <79766552+Fastium@users.noreply.github.com> Date: Thu, 19 May 2022 12:51:06 +0200 Subject: [PATCH 3/4] comment on BillGUI --- src/BillGUI/BillGui.java | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/BillGUI/BillGui.java b/src/BillGUI/BillGui.java index d7e3b3d..aebb821 100644 --- a/src/BillGUI/BillGui.java +++ b/src/BillGUI/BillGui.java @@ -6,10 +6,17 @@ import javax.swing.*; import java.awt.print.*; import java.awt.image.BufferedImage; +/** + * generate the bill in a window + */ public class BillGui extends JFrame{ String bill; JPanel jP; + /** + * initialize the bill in a window + * @param bill string who contains the bill + */ BillGui(String bill){ this.bill = bill; @@ -20,17 +27,19 @@ public class BillGui extends JFrame{ FlowLayout fl = new FlowLayout(); this.setLayout(fl); + //Create the label who contain the label with the bill jP = new JPanel(); - JLabel jBill = new JLabel(bill); jP.add(jBill); - this.add(jP); + //Create the button for print the bill JButton buttonPrint = new JButton("Print"); - buttonPrint.addActionListener( - - new ButtonListenerBill(this) { + buttonPrint.addActionListener(new ButtonListenerBill(this) { + //TODO : describe the prozess to print and resize the bill + /** + * + */ @Override public void actionPerformed(ActionEvent e){ @@ -77,17 +86,19 @@ public class BillGui extends JFrame{ } /** - * + * listener to detect the button to print the bill */ class ButtonListenerBill implements ActionListener { JFrame Jf; - + /** + * initialize the listener + * @param Jf //TODO : do we always use the JFrame ? + */ ButtonListenerBill(JFrame Jf){ this.Jf = Jf; } - @Override - public void actionPerformed(ActionEvent e){ }; + public void actionPerformed(ActionEvent e){}; } From 354ea04dff5ad0fbcf1c18e0df2f426873ee3940 Mon Sep 17 00:00:00 2001 From: Fastium <79766552+Fastium@users.noreply.github.com> Date: Thu, 19 May 2022 12:51:26 +0200 Subject: [PATCH 4/4] comment on BillGUI --- bin/BillGUI/BillGui$1$1.class | Bin 1714 -> 1714 bytes bin/BillGUI/BillGui$1.class | Bin 1891 -> 1891 bytes bin/BillGUI/BillGui.class | Bin 1254 -> 1246 bytes bin/BillGUI/ButtonListenerBill.class | Bin 570 -> 570 bytes 4 files changed, 0 insertions(+), 0 deletions(-) diff --git a/bin/BillGUI/BillGui$1$1.class b/bin/BillGUI/BillGui$1$1.class index b28fa7adc19c57fcf206def4e9e00ddcc20da993..3897c8519dcfd076206636ea547f693ed9c9622a 100644 GIT binary patch delta 47 zcmdnQyNP#0E-RzqFO53|0(|K+=!Fh9Q~3Zn8RCHvsho B2@?PS delta 47 zcmdnQyNP#0E-RzPVU d7|7tm5Xs=r5X%t2ki-x;c@oK8MGK=81xzB j8LSu-7@Qdt8GL}Ep$w`F2@Glsc?`h}r3@jH+gK6+C{heq delta 89 zcmcb|`HXYJc4kJ7$vc?a-Q5@j85kIN8CV$j7&w7!VFn=vSs