From 2e15fc5835d6311201eb234c67a18d72f78b5914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Thu, 19 May 2022 13:04:14 +0200 Subject: [PATCH] partial debug --- .vscode/settings.json | 6 +++++- 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 -> 3649 bytes bin/BillGUI/Row.class | Bin 522 -> 522 bytes src/BillGUI/ManagerGui.java | 18 ++++++++++++++++-- 7 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 37d5d4a..0b84c17 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,5 +5,9 @@ "lib/**/*.jar" ], "liveshare.shareExternalFiles": false, - "liveshare.allowGuestDebugControl": true + "liveshare.allowGuestDebugControl": true, + "cSpell.words": [ + "Jlogo", + "Jname" + ] } diff --git a/bin/BillGUI/ButtonListenerManager.class b/bin/BillGUI/ButtonListenerManager.class index a064d34b3aa8c53f4d9dd26571536debac5f6c24..b0bd01ded00758377cf24598369cbd5890864a7b 100644 GIT binary patch delta 49 zcmZ3$xqx%SB4)t`1{Q`!22O@120n&n24RMl$(xz0Iop7u?Lg6v$>uChjNOx~SkwS0 CV+*qY 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..fe484daafeb254143939d7641376534b86609966 100644 GIT binary patch delta 51 zcmX@Ze};cUJR76+=P`75>JSG_pKyV#i8w5+_Ykh%MVulBNz=Cc)Wk1;<&OD##5bV|!vxB9B~Y zWG98t0)7fX zUB0`#_rialy9Qt<{-UEwL&F|B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b=#GUteDXy18`G{_*0ke=Y_c>S<7T!;yraMuqRdT&55}(d^(*<)=jv7(JewZ<)$u zvpR6M!yQyvv?{7kq)w$`bA?PcmPk(*a(SDL1T|@s!<|%X6meKhwJm6~LpvP`Yc^dN z&74Uq40py8*dBAZSFf*<^^x3ks*uUeXnv=|R<GdhHIq7)&JWIITDREbnbRVja>K^BKgVf@XF208 z8NF@K{eMoU%>rk2&Y~Q?N|_C+^W9rlrXs>ELprS`rPV0n957(bC-PA2;rn0PXJVZw9MLQ?YbgO(c1MzHbj@% zm@Ly)By<~wqc!S6jc1}nG%BWs?@Qbh^_AEnobAbuYsOKdOm~sR9nt6&c9iIqKwq-G z%+4aa1P>%-eOH->iwsxX&1Lo$*{A9IN<1>I!LSA$$sYf;F3a0xenxZ9UvGBy7!nID zGnNcWmqdy2@$;stH|woWSFY<&iOC*eZw#7?S9x6VEn|`sG_LSOrL;!JGzywmc}j6< z<>zH`dZG&p>sgQD1P zB;zNxaGg$m7yJiZ%0ssb%1aC}thUK>>LsD#Oz?tqJxpLxA1N>LlDHb3r%Dc7qn8DF zD(DqyA63k^dna`UYJMlFuOdTIKBl<@E&ABn9MlozXi3pWfOi#03j3x5OE`yXNe diff --git a/bin/BillGUI/Row.class b/bin/BillGUI/Row.class index f5075da54a1e88f87c03f2cbb7fb88a29040b95f..23561888bfc5b5d942d5b967f22b98cc8154e8b4 100644 GIT binary patch delta 25 gcmeBT>0;S%osqYYfrX)nL4cu{L7Jgt@)Jfi098!}NdN!< delta 25 gcmeBT>0;S%osl=0frTN3L4YBZL7E|L@)Jfi08-@!5dZ)H diff --git a/src/BillGUI/ManagerGui.java b/src/BillGUI/ManagerGui.java index b02f5aa..fd9938a 100644 --- a/src/BillGUI/ManagerGui.java +++ b/src/BillGUI/ManagerGui.java @@ -15,6 +15,7 @@ public class ManagerGui extends JFrame { ImageIcon logo; String buttonNameQuit = "Quit"; String buttonNameBill = "Show bill"; + double ratio = 207.0/163.0; Vector prestations = new Vector<>(); @@ -33,10 +34,13 @@ public class ManagerGui extends JFrame { this.setLayout(grid); //Create and add header - logo = new ImageIcon(logoFilePath); - Jlogo = new JLabel(logo); + //logo = new ImageIcon(logoFilePath); Jname = new JLabel(name); this.add(Jname); + + //logo = new ImageIcon(new ImageIcon(logoFilePath).getImage().getScaledInstance(207, 163, Image.SCALE_DEFAULT)); + //Jlogo = new JLabel(logo); + Jlogo = resize(Jname, logoFilePath); this.add(Jlogo); @@ -86,6 +90,16 @@ public class ManagerGui extends JFrame { this.add(buttonQuit); } + + private JLabel resize(JLabel Jlogo, String logoFilePath){ + //TODO put in listener for resize when frame is resize. + int width = (int)Jlogo.getSize().getWidth(); + int height = (int)Jlogo.getSize().getHeight(); + height = height > 0 ? height:65; + System.out.println(width + "x"+ height); + ImageIcon logo = new ImageIcon(new ImageIcon(logoFilePath).getImage().getScaledInstance((int) (height*ratio), height, Image.SCALE_DEFAULT)); + return new JLabel(logo); + } }