diff --git a/bin/BillGUI/ButtonListenerManager.class b/bin/BillGUI/ButtonListenerManager.class index a064d34..bbff05f 100644 Binary files a/bin/BillGUI/ButtonListenerManager.class and b/bin/BillGUI/ButtonListenerManager.class differ diff --git a/bin/BillGUI/ManagerGui$1.class b/bin/BillGUI/ManagerGui$1.class index 4368c43..9db698e 100644 Binary files a/bin/BillGUI/ManagerGui$1.class and b/bin/BillGUI/ManagerGui$1.class differ diff --git a/bin/BillGUI/ManagerGui$2.class b/bin/BillGUI/ManagerGui$2.class index a6f9468..987e31b 100644 Binary files a/bin/BillGUI/ManagerGui$2.class and b/bin/BillGUI/ManagerGui$2.class differ diff --git a/bin/BillGUI/ManagerGui.class b/bin/BillGUI/ManagerGui.class index bc89d98..33ba8c4 100644 Binary files a/bin/BillGUI/ManagerGui.class and b/bin/BillGUI/ManagerGui.class differ diff --git a/bin/BillGUI/Row.class b/bin/BillGUI/Row.class index f5075da..58322f7 100644 Binary files a/bin/BillGUI/Row.class and b/bin/BillGUI/Row.class differ 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;