-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcie-middleware-cieid-make-window-resizable.patch
More file actions
905 lines (867 loc) · 43.9 KB
/
cie-middleware-cieid-make-window-resizable.patch
File metadata and controls
905 lines (867 loc) · 43.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
From 126454e24c20050c6ac999181f4636cf8102f8cb Mon Sep 17 00:00:00 2001
From: Luca Magrone <luca@magrone.cc>
Date: Sun, 3 Nov 2024 21:37:49 +0100
Subject: [PATCH] CIEID: hack: make MainFrame window resizable
Implement a method that resizes and repositions components when a window
gets resized.
This fixes rendering on tiling window mangers and improves help
tabs UX.
Signed-off-by: Luca Magrone <luca@magrone.cc>
---
CIEID/src/it/ipzs/carousel/carousel.java | 10 +-
.../it/ipzs/cieid/Firma/MoveablePicture.java | 30 +-
CIEID/src/it/ipzs/cieid/Firma/PdfPreview.java | 25 +-
CIEID/src/it/ipzs/cieid/IntroFrame.java | 10 +-
CIEID/src/it/ipzs/cieid/MainApplication.java | 8 +
CIEID/src/it/ipzs/cieid/MainFrame.java | 314 ++++++++++++++----
cie_sign_sdk/src/PdfSignatureGenerator.cpp | 6 +-
7 files changed, 319 insertions(+), 84 deletions(-)
diff --git a/CIEID/src/it/ipzs/carousel/carousel.java b/CIEID/src/it/ipzs/carousel/carousel.java
index 7c2c07b..34c371e 100644
--- a/CIEID/src/it/ipzs/carousel/carousel.java
+++ b/CIEID/src/it/ipzs/carousel/carousel.java
@@ -20,15 +20,15 @@ import javax.swing.ImageIcon;
public class carousel extends JPanel {
private int index;
- private JButton btnRight;
- private JButton btnLeft;
private List<JRadioButton> radioList;
private List<Cie> cieList;
- private JPanel radioButtonPanel;
private Map<String, Cie> cieDictionary;
public CieCard cieLeft;
public CieCard cieCenter;
public CieCard cieRight;
+ public JButton btnRight;
+ public JButton btnLeft;
+ public JPanel radioButtonPanel;
public carousel()
@@ -111,7 +111,7 @@ public class carousel extends JPanel {
btnLeft.setIcon(new ImageIcon(carousel.class.getResource("/it/ipzs/cieid/res/back@2x.png")));
btnLeft.setForeground(new Color(30, 144, 255));
btnLeft.setFont(new Font("Dialog", Font.BOLD, 15));
- btnLeft.setBounds(-12, 150, 52, 48);
+ btnLeft.setBounds(-3, 150, 52, 48);
btnLeft.setOpaque(false);
btnLeft.setBorderPainted(false);
btnLeft.setContentAreaFilled(false);
@@ -163,7 +163,7 @@ public class carousel extends JPanel {
radioButtonPanel = new JPanel();
radioButtonPanel.setBackground(Color.WHITE);
- radioButtonPanel.setBounds(38, 258, 491, 25);
+ radioButtonPanel.setBounds(55, 258, 491, 25);
this.add(radioButtonPanel);
}
diff --git a/CIEID/src/it/ipzs/cieid/Firma/MoveablePicture.java b/CIEID/src/it/ipzs/cieid/Firma/MoveablePicture.java
index e05fdcd..f8190a2 100644
--- a/CIEID/src/it/ipzs/cieid/Firma/MoveablePicture.java
+++ b/CIEID/src/it/ipzs/cieid/Firma/MoveablePicture.java
@@ -13,27 +13,43 @@ import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
+import javax.swing.SwingConstants;
public class MoveablePicture extends JPanel implements MouseListener, MouseMotionListener{
private int x,y;
+ private String signFilePath;
//private JPanel picturePanel;
-
- public MoveablePicture(String signFilePath) {
- // TODO Auto-generated constructor stub
- this.setSize(50, 25);
- this.setBackground(new Color(255, 255, 255, 0));
- this.setBorder(BorderFactory.createDashedBorder(Color.black));
+
+ private void loadImage() {
try {
Image img;
+ int width = this.getWidth();
+ int height = this.getHeight();
img = ImageIO.read(new File(signFilePath));
- JLabel imgLabel = new JLabel(new ImageIcon(img.getScaledInstance(this.getWidth(), this.getHeight(), Image.SCALE_SMOOTH)));
+ JLabel imgLabel = new JLabel(new ImageIcon(img.getScaledInstance(width, -1, Image.SCALE_SMOOTH)));
+ imgLabel.setBounds(0, 0, width, height);
+ imgLabel.setVerticalAlignment(SwingConstants.BOTTOM);
this.add(imgLabel);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
+ }
+ public void reloadImage() {
+ this.removeAll();
+ this.loadImage();
+ }
+
+ public MoveablePicture(String signFilePath) {
+ // TODO Auto-generated constructor stub
+ this.signFilePath = signFilePath;
+ this.setLayout(null);
+ this.setSize(50, 25);
+ this.setBackground(new Color(255, 255, 255, 0));
+ this.setBorder(BorderFactory.createDashedBorder(Color.black));
+ this.loadImage();
this.addMouseListener(this);
this.addMouseMotionListener(this);
diff --git a/CIEID/src/it/ipzs/cieid/Firma/PdfPreview.java b/CIEID/src/it/ipzs/cieid/Firma/PdfPreview.java
index bbfd5b4..286b5c9 100644
--- a/CIEID/src/it/ipzs/cieid/Firma/PdfPreview.java
+++ b/CIEID/src/it/ipzs/cieid/Firma/PdfPreview.java
@@ -47,7 +47,7 @@ public class PdfPreview {
imgPanel.setLayout(new BorderLayout(0,0));
imgPanel.setBackground(Color.white);
signImage = new MoveablePicture(signImagePath);
- imgPanel.add(signImage );
+ imgPanel.add(signImage);
imgPanel.add(imgLabel);
try {
@@ -79,7 +79,7 @@ public class PdfPreview {
}
}
- private void showPreview()
+ public void showPreview()
{
Image tmpImg = images.get(pdfPageIndex);
@@ -89,17 +89,19 @@ public class PdfPreview {
int tmpImgWidth = tmpImg.getWidth(null);
int tmpImgHeight = tmpImg.getHeight(null);
- int imgHeigth = height;
+ int imgHeight = height;
int imgWidth = width;
+ double signImgMult = 1.0;
+
if( tmpImgWidth > tmpImgHeight)
{
- imgHeigth = (int)(width*tmpImgHeight)/tmpImgWidth;
+ imgHeight = (int)(width*tmpImgHeight)/tmpImgWidth;
- if(imgHeigth > height)
+ if(imgHeight > height)
{
imgWidth = (int)(height*tmpImgWidth)/tmpImgHeight;
- imgHeigth = (int)(imgWidth*tmpImgHeight)/tmpImgWidth;
+ imgHeight = (int)(imgWidth*tmpImgHeight)/tmpImgWidth;
}
}else
{
@@ -107,13 +109,16 @@ public class PdfPreview {
if(imgWidth > width)
{
- imgHeigth = (int)(width*imgHeigth)/tmpImgWidth;
- imgWidth = (int)(imgHeigth*tmpImgWidth)/imgHeigth;
+ imgHeight = (int)(width*tmpImgHeight)/tmpImgWidth;
+ imgWidth = (int)(imgHeight*tmpImgWidth)/tmpImgHeight;
}
}
+ signImgMult = imgWidth / 300.0;
- imgIcon.setImage(tmpImg.getScaledInstance(imgWidth, imgHeigth, Image.SCALE_AREA_AVERAGING));
+ signImage.setSize((int)(50.0 * signImgMult), (int)(25.0 * signImgMult));
+ signImage.reloadImage();
+ imgIcon.setImage(tmpImg.getScaledInstance(imgWidth, imgHeight, Image.SCALE_AREA_AVERAGING));
imgLabel.setIcon(imgIcon);
imgLabel.setHorizontalAlignment(JLabel.CENTER);
imgLabel.setVerticalAlignment(JLabel.CENTER);
@@ -121,7 +126,7 @@ public class PdfPreview {
imgLabel.repaint();
//imgPanel.removeAll();
- imgPanel.setMaximumSize(new Dimension(imgWidth, imgHeigth));
+ imgPanel.setMaximumSize(new Dimension(imgWidth, imgHeight));
imgPanel.updateUI();
prPanel.removeAll();
diff --git a/CIEID/src/it/ipzs/cieid/IntroFrame.java b/CIEID/src/it/ipzs/cieid/IntroFrame.java
index 24149f0..481396c 100644
--- a/CIEID/src/it/ipzs/cieid/IntroFrame.java
+++ b/CIEID/src/it/ipzs/cieid/IntroFrame.java
@@ -2,6 +2,8 @@ package it.ipzs.cieid;
import java.awt.BorderLayout;
import java.awt.EventQueue;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import javax.swing.JPanel;
@@ -152,8 +154,14 @@ public class IntroFrame extends JFrame {
Utils.setProperty("nomore", "true");
// TODO open main frame
- JFrame frame = new MainFrame(new String[] { });
+ JFrame frame = new MainFrame(new String[] { });
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ frame.addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosed(WindowEvent e) {
+ System.exit(0);
+ }
+ });
setVisible(false);
frame.setVisible(true);
diff --git a/CIEID/src/it/ipzs/cieid/MainApplication.java b/CIEID/src/it/ipzs/cieid/MainApplication.java
index 58b077b..19faa03 100644
--- a/CIEID/src/it/ipzs/cieid/MainApplication.java
+++ b/CIEID/src/it/ipzs/cieid/MainApplication.java
@@ -6,6 +6,8 @@ import java.awt.Toolkit;
import java.awt.Window;
import java.awt.event.AWTEventListener;
import java.awt.event.KeyEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -106,6 +108,12 @@ public class MainApplication {
}
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ frame.addWindowListener(new WindowAdapter() {
+ @Override
+ public void windowClosed(WindowEvent e) {
+ System.exit(0);
+ }
+ });
}
private static void notifyPinWrong()
diff --git a/CIEID/src/it/ipzs/cieid/MainFrame.java b/CIEID/src/it/ipzs/cieid/MainFrame.java
index fbd9aa0..92597e0 100644
--- a/CIEID/src/it/ipzs/cieid/MainFrame.java
+++ b/CIEID/src/it/ipzs/cieid/MainFrame.java
@@ -2,6 +2,7 @@ package it.ipzs.cieid;
import java.awt.CardLayout;
import java.awt.Color;
+import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.FontFormatException;
@@ -13,6 +14,8 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.io.File;
@@ -179,6 +182,7 @@ public class MainFrame extends JFrame {
private JLabel lblChangePINText;
private JTextPane txtpnThePINOfYourCIE;
private JLabel label_6;
+ private JLabel lblUnlockCard1;
private JCheckBox checkBox_3;
private JLabel labelProgressChangePIN;
private JProgressBar progressBarChangePIN;
@@ -195,7 +199,7 @@ public class MainFrame extends JFrame {
private JTextPane textPane_2;
private JPasswordField puk01;
private JPanel panel_7;
- private JLabel lblUnlockCard;
+ private JLabel lblUnlockCard2;
private JTextPane txtpnTypeThePUKOfYourCIE;
private JLabel label_8;
private JCheckBox checkBox_5;
@@ -410,10 +414,10 @@ public class MainFrame extends JFrame {
loadLogConfigFromFile();
logger.Info("Inizializza frame principale");
signOperation = SignOp.OP_NONE;
- setResizable(false);
setBackground(Color.WHITE);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 800, 600);
+ setMinimumSize(new Dimension(800, 600));
contentPane = new JPanel();
contentPane.setBackground(Color.WHITE);
contentPane.setBorder(new EmptyBorder(0, 0, 0, 0));
@@ -648,8 +652,8 @@ public class MainFrame extends JFrame {
btnSettings.setBackground(SystemColor.window);
btnSettings.setBounds(0, 490, 200, 45);
leftPanel.add(btnSettings);
- tabbedPane = new JTabbedPane(JTabbedPane.TOP);
- tabbedPane.setBounds(200, -65, 600, 635);
+ tabbedPane = new JTabbedPane(JTabbedPane.BOTTOM);
+ tabbedPane.setBounds(200, -4, 603, 669);
tabbedPane.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
@@ -840,7 +844,7 @@ public class MainFrame extends JFrame {
buttonsPanel.setBackground(new Color(255, 255, 255));
FlowLayout flowLayout = (FlowLayout) buttonsPanel.getLayout();
flowLayout.setHgap(100);
- buttonsPanel.setBounds(133, 500, 384, 36);
+ buttonsPanel.setBounds(133, 507, 384, 36);
btnCancel = new JButton("Annulla");
btnCancel.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@@ -908,7 +912,7 @@ public class MainFrame extends JFrame {
cieCarousel.setLocation(0, 170);
pnCIEHomeSelector_Index_3.add(cieCarousel);
btnPanel = new JPanel();
- btnPanel.setBounds(0, 500, 595, 46);
+ btnPanel.setBounds(0, 507, 595, 46);
btnPanel.setBackground(Color.WHITE);
btnRemoveAll = new JButton("Rimuovi tutte");
btnRemoveAll.addActionListener(new ActionListener() {
@@ -1008,7 +1012,7 @@ public class MainFrame extends JFrame {
txtpnCIEPanelsSubtitle.setEditable(false);
txtpnCIEPanelsSubtitle.setFont(new Font("Dialog", Font.PLAIN, 16));
txtpnCIEPanelsSubtitle.setText("Carta di Identità Elettronica abbinata correttamente");
- txtpnCIEPanelsSubtitle.setBounds(63, 84, 492, 46);
+ txtpnCIEPanelsSubtitle.setBounds(50, 84, 492, 46);
pnCIEHomeSelector_Index_3.add(txtpnCIEPanelsSubtitle);
pnChangePINTypingScreen_Index_4 = new JPanel();
pnChangePINTypingScreen_Index_4.setLayout(null);
@@ -1043,7 +1047,7 @@ public class MainFrame extends JFrame {
});
btnPerformChangePIN.setForeground(Color.WHITE);
btnPerformChangePIN.setBackground(new Color(30, 144, 255));
- btnPerformChangePIN.setBounds(206, 507, 114, 25);
+ btnPerformChangePIN.setBounds(223, 507, 114, 25);
pnChangePINTypingScreen_Index_4.add(btnPerformChangePIN);
lblTypeTheOldValue = new JLabel("Inserisci il vecchio PIN");
lblTypeTheOldValue.setHorizontalAlignment(SwingConstants.LEFT);
@@ -1135,11 +1139,11 @@ public class MainFrame extends JFrame {
panel_6.setLayout(null);
panel_6.setBackground(Color.WHITE);
tabbedPane.addTab("New tab", null, panel_6, null);
- lblUnlockCard = new JLabel("Sblocco Carta");
- lblUnlockCard.setHorizontalAlignment(SwingConstants.CENTER);
- lblUnlockCard.setFont(new Font("Dialog", Font.BOLD, 30));
- lblUnlockCard.setBounds(147, 36, 299, 36);
- panel_6.add(lblUnlockCard);
+ lblUnlockCard1 = new JLabel("Sblocco Carta");
+ lblUnlockCard1.setHorizontalAlignment(SwingConstants.CENTER);
+ lblUnlockCard1.setFont(new Font("Dialog", Font.BOLD, 30));
+ lblUnlockCard1.setBounds(147, 36, 299, 36);
+ panel_6.add(lblUnlockCard1);
txtpnUseYourPUK = new JTextPane();
txtpnUseYourPUK.setText("Utilizza il codice PUK ricevuto con la CIE");
txtpnUseYourPUK.setFont(new Font("Dialog", Font.PLAIN, 16));
@@ -1163,7 +1167,7 @@ public class MainFrame extends JFrame {
});
btnUnlockPIN.setForeground(Color.WHITE);
btnUnlockPIN.setBackground(new Color(30, 144, 255));
- btnUnlockPIN.setBounds(206, 507, 114, 25);
+ btnUnlockPIN.setBounds(223, 507, 114, 25);
panel_6.add(btnUnlockPIN);
lblInsertYourPUK = new JLabel("Inserisci il PUK");
lblInsertYourPUK.setHorizontalAlignment(SwingConstants.LEFT);
@@ -1223,11 +1227,11 @@ public class MainFrame extends JFrame {
panel_7.setLayout(null);
panel_7.setBackground(Color.WHITE);
tabbedPane.addTab("New tab", null, panel_7, null);
- lblUnlockCard = new JLabel("Sblocca Carta");
- lblUnlockCard.setHorizontalAlignment(SwingConstants.CENTER);
- lblUnlockCard.setFont(new Font("Dialog", Font.BOLD, 30));
- lblUnlockCard.setBounds(147, 36, 299, 36);
- panel_7.add(lblUnlockCard);
+ lblUnlockCard2 = new JLabel("Sblocca Carta");
+ lblUnlockCard2.setHorizontalAlignment(SwingConstants.CENTER);
+ lblUnlockCard2.setFont(new Font("Dialog", Font.BOLD, 30));
+ lblUnlockCard2.setBounds(147, 36, 299, 36);
+ panel_7.add(lblUnlockCard2);
txtpnTypeThePUKOfYourCIE = new JTextPane();
txtpnTypeThePUKOfYourCIE.setText("Utilizza il codice PUK ricevuto con la CIE");
txtpnTypeThePUKOfYourCIE.setFont(new Font("Dialog", Font.PLAIN, 16));
@@ -1261,7 +1265,7 @@ public class MainFrame extends JFrame {
lblHelp.setBounds(147, 36, 299, 36);
panel_8.add(lblHelp);
MiniWebView webView = new MiniWebView();
- webView.setBounds(12, 99, 571, 362);
+ webView.setBounds(12, 99, 574, 438);
panel_8.add(webView);
webView.showPage(MainFrame.class.getResource("/it/ipzs/cieid/res/tutorial_linux.html"));
panel_9 = new JPanel();
@@ -1274,7 +1278,7 @@ public class MainFrame extends JFrame {
label_11.setBounds(147, 36, 299, 36);
panel_9.add(label_11);
miniWebView = new MiniWebView();
- miniWebView.setBounds(12, 99, 571, 362);
+ miniWebView.setBounds(12, 99, 574, 438);
panel_9.add(miniWebView);
miniWebView.showPage("https://idserver.servizicie.interno.gov.it/idp/aiuto.jsp");
panel_10 = new JPanel();
@@ -1287,7 +1291,7 @@ public class MainFrame extends JFrame {
lblInformation.setBounds(147, 36, 299, 36);
panel_10.add(lblInformation);
miniWebView_1 = new MiniWebView();
- miniWebView_1.setBounds(12, 99, 571, 362);
+ miniWebView_1.setBounds(12, 99, 574, 438);
panel_10.add(miniWebView_1);
miniWebView_1.showPage("https://idserver.servizicie.interno.gov.it/idp/privacy.jsp");
StyledDocument doc = textPane_1.getStyledDocument();
@@ -1314,7 +1318,7 @@ public class MainFrame extends JFrame {
lblDigitalSignature = new JLabel("Firma Elettronica");
lblDigitalSignature.setHorizontalAlignment(SwingConstants.CENTER);
lblDigitalSignature.setFont(new Font("Dialog", Font.BOLD, 30));
- lblDigitalSignature.setBounds(165, 45, 302, 39);
+ lblDigitalSignature.setBounds(147, 45, 302, 39);
selectFile.add(lblDigitalSignature);
panel_24 = new JPanel();
panel_24.setBackground(SystemColor.text);
@@ -1323,7 +1327,7 @@ public class MainFrame extends JFrame {
panel_24.setLayout(null);
panelLoadFile = new JPanel();
panelLoadFile.setBackground(SystemColor.text);
- panelLoadFile.setBounds(12, 12, 513, 300);
+ panelLoadFile.setBounds(12, 12, 516, 300);
panel_24.add(panelLoadFile);
panelLoadFile.setLayout(null);
panelLoadFile.setBorder(BorderFactory.createDashedBorder(null, 5, 5));
@@ -1417,7 +1421,7 @@ public class MainFrame extends JFrame {
signImage = ImageIO.read(new File(signImagePath));
ImageIcon imageIcon = new ImageIcon();
- imageIcon.setImage(signImage.getScaledInstance(lblCustomizedGraphicSignature.getWidth(), lblCustomizedGraphicSignature.getHeight(), Image.SCALE_SMOOTH));
+ imageIcon.setImage(signImage.getScaledInstance(lblCustomizedGraphicSignature.getWidth(), -1, Image.SCALE_SMOOTH));
lblCustomizedGraphicSignature.setIcon(imageIcon);
tabbedPane.setSelectedIndex(15);
@@ -1463,7 +1467,7 @@ public class MainFrame extends JFrame {
selectOperation.add(lblFirmaElettronica_1);
panel_16 = new JPanel();
panel_16.setBackground(SystemColor.text);
- panel_16.setBounds(76, 132, 449, 415);
+ panel_16.setBounds(76, 132, 449, 375);
selectOperation.add(panel_16);
panel_16.setLayout(null);
panel = new JPanel();
@@ -1636,8 +1640,8 @@ public class MainFrame extends JFrame {
tabbedPane.setSelectedIndex(10);
}
});
- btnCancelOp.setBounds(147, 392, 136, 23);
- panel_16.add(btnCancelOp);
+ btnCancelOp.setBounds(223, 507, 136, 23);
+ selectOperation.add(btnCancelOp);
btnCancelOp.setForeground(Color.WHITE);
btnCancelOp.setBackground(new Color(30, 144, 255));
selectSignatureOperation = new JPanel();
@@ -1651,7 +1655,7 @@ public class MainFrame extends JFrame {
selectSignatureOperation.add(lblFirmaElettronica_2);
panel_23 = new JPanel();
panel_23.setBackground(SystemColor.text);
- panel_23.setBounds(76, 132, 449, 415);
+ panel_23.setBounds(76, 132, 449, 375);
selectSignatureOperation.add(panel_23);
panel_23.setLayout(null);
panel_15 = new JPanel();
@@ -1675,7 +1679,7 @@ public class MainFrame extends JFrame {
panel_15.add(lblPathSignOp);
panel_20 = new JPanel();
panel_20.setBackground(SystemColor.text);
- panel_20.setBounds(0, 120, 448, 249);
+ panel_20.setBounds(0, 70, 448, 249);
panel_23.add(panel_20);
panel_20.setLayout(null);
JLabel lblNewLabel_8_1 = new JLabel("Seleziona il tipo di firma");
@@ -1784,8 +1788,8 @@ public class MainFrame extends JFrame {
panel_19.add(cbGraphicSig);
JPanel panel_17 = new JPanel();
panel_17.setBackground(SystemColor.text);
- panel_17.setBounds(48, 392, 359, 23);
- panel_23.add(panel_17);
+ panel_17.setBounds(124, 507, 359, 23);
+ selectSignatureOperation.add(panel_17);
panel_17.setLayout(null);
JButton btnAnnullaOp_1 = new JButton("Annulla");
btnAnnullaOp_1.addActionListener(new ActionListener() {
@@ -1880,7 +1884,7 @@ public class MainFrame extends JFrame {
pdfPreview.add(lblFirmaElettronica_3);
panel_25 = new JPanel();
panel_25.setBackground(SystemColor.text);
- panel_25.setBounds(76, 132, 449, 415);
+ panel_25.setBounds(76, 132, 449, 375);
pdfPreview.add(panel_25);
panel_25.setLayout(null);
panel_21 = new JPanel();
@@ -1917,14 +1921,14 @@ public class MainFrame extends JFrame {
lblPathPin.setText(filePath);
}
});
- btnAnnullaOp_3.setBounds(147, 392, 136, 23);
- panel_25.add(btnAnnullaOp_3);
+ btnAnnullaOp_3.setBounds(223, 507, 136, 23);
+ pdfPreview.add(btnAnnullaOp_3);
btnAnnullaOp_3.setForeground(Color.WHITE);
btnAnnullaOp_3.setBackground(new Color(30, 144, 255));
panelPdfPreview = new JPanel();
panelPdfPreview.setBorder(null);
panelPdfPreview.setBackground(SystemColor.control);
- panelPdfPreview.setBounds(10, 94, 377, 286);
+ panelPdfPreview.setBounds(10, 104, 377, 246);
panel_25.add(panelPdfPreview);
GridBagLayout gbl_panelPdfPreview = new GridBagLayout();
gbl_panelPdfPreview.columnWidths = new int[] {0};
@@ -1934,7 +1938,7 @@ public class MainFrame extends JFrame {
panelPdfPreview.setLayout(gbl_panelPdfPreview);
panel_22 = new JPanel();
panel_22.setBackground(SystemColor.text);
- panel_22.setBounds(397, 153, 42, 172);
+ panel_22.setBounds(397, 143, 42, 172);
panel_25.add(panel_22);
panel_22.setLayout(null);
btnUp = new JButton("");
@@ -1981,7 +1985,7 @@ public class MainFrame extends JFrame {
panel_26 = new JPanel();
panel_26.setLayout(null);
panel_26.setBackground(Color.WHITE);
- panel_26.setBounds(76, 132, 449, 415);
+ panel_26.setBounds(76, 132, 449, 375);
firmaPin.add(panel_26);
panel_27 = new JPanel();
panel_27.setLayout(null);
@@ -2004,8 +2008,8 @@ public class MainFrame extends JFrame {
panel_27.add(lblPathPin);
panel_28 = new JPanel();
panel_28.setBackground(SystemColor.text);
- panel_28.setBounds(48, 392, 360, 23);
- panel_26.add(panel_28);
+ panel_28.setBounds(124, 507, 360, 23);
+ firmaPin.add(panel_28);
panel_28.setLayout(null);
btnUndoPINTyping = new JButton("Annulla");
btnUndoPINTyping.addMouseListener(new MouseAdapter() {
@@ -2290,13 +2294,13 @@ public class MainFrame extends JFrame {
customizeGraphicSignature.add(lblFirmaElettronica_5);
JPanel panel_30 = new JPanel();
panel_30.setBackground(Color.WHITE);
- panel_30.setBounds(76, 132, 449, 415);
+ panel_30.setBounds(76, 132, 449, 375);
customizeGraphicSignature.add(panel_30);
panel_30.setLayout(null);
panel_31 = new JPanel();
panel_31.setBackground(Color.WHITE);
- panel_31.setBounds(0, 392, 449, 23);
- panel_30.add(panel_31);
+ panel_31.setBounds(76, 507, 449, 23);
+ customizeGraphicSignature.add(panel_31);
panel_31.setLayout(null);
JButton btnSelectImg = new JButton("Seleziona un file");
btnSelectImg.addActionListener(new ActionListener() {
@@ -2317,7 +2321,7 @@ public class MainFrame extends JFrame {
FileUtils.copyFile(new File(source), new File(dest));
Image signImage = ImageIO.read(new File(dest));
ImageIcon imageIcon = new ImageIcon();
- imageIcon.setImage(signImage.getScaledInstance(lblCustomizedGraphicSignature.getWidth(), lblCustomizedGraphicSignature.getHeight(), Image.SCALE_SMOOTH));
+ imageIcon.setImage(signImage.getScaledInstance(lblCustomizedGraphicSignature.getWidth(), -1, Image.SCALE_SMOOTH));
lblCustomizedGraphicSignature.setIcon(imageIcon);
lblCustomize.setText("Aggiorna");
lblHint.setText("Una tua firma personalizzata è già stata caricata. Vuoi aggiornarla?");
@@ -2369,7 +2373,7 @@ public class MainFrame extends JFrame {
signImage = ImageIO.read(new File(signImagePath));
ImageIcon imageIcon = new ImageIcon();
- imageIcon.setImage(signImage.getScaledInstance(lblCustomizedGraphicSignature.getWidth(), lblCustomizedGraphicSignature.getHeight(), Image.SCALE_SMOOTH));
+ imageIcon.setImage(signImage.getScaledInstance(lblCustomizedGraphicSignature.getWidth(), -1, Image.SCALE_SMOOTH));
lblCustomizedGraphicSignature.setIcon(imageIcon);
selectedCie.getCard().setIsCustomSign(false);
cieDictionary.put(selectedCie.getCard().getPan(), selectedCie.getCard());
@@ -2395,7 +2399,7 @@ public class MainFrame extends JFrame {
panel_31.add(btnGenerateGraphicSignature);
lblHint = new JTextArea();
lblHint.setHighlighter(null);
- lblHint.setBounds(0, 133, 449, 80);
+ lblHint.setBounds(0, 224, 449, 60);
panel_30.add(lblHint);
lblHint.setWrapStyleWord(true);
lblHint.setText("Abbiamo creato per te una firma grafica, ma se preferisci puoi personalizzarla. Questo passaggio non \u00E8 indispensabile, ma ti consentir\u00E0 di dare un tocco personale ai documenti firmati.");
@@ -2406,17 +2410,17 @@ public class MainFrame extends JFrame {
lblHint.setBackground(Color.WHITE);
JTextArea txtrAbbiamoCreatoPer_1_1 = new JTextArea();
txtrAbbiamoCreatoPer_1_1.setHighlighter(null);
- txtrAbbiamoCreatoPer_1_1.setBounds(0, 280, 449, 72);
+ txtrAbbiamoCreatoPer_1_1.setBounds(0, 284, 449, 133);
panel_30.add(txtrAbbiamoCreatoPer_1_1);
txtrAbbiamoCreatoPer_1_1.setWrapStyleWord(true);
- txtrAbbiamoCreatoPer_1_1.setText("Puoi caricare un file in formato PNG, se non hai un file contenente una firma grafica puoi realizzarne uno utilizzando l'app CieSign disponibile per smartphone iOS o Android");
+ txtrAbbiamoCreatoPer_1_1.setText("Puoi caricare un file in formato PNG, se non hai un file contenente una firma grafica puoi realizzarne uno utilizzando l'app CieSign disponibile per smartphone iOS o Android.\nSi consiglia di utilizzare un'immagine con rapporto 2:1");
txtrAbbiamoCreatoPer_1_1.setRows(3);
txtrAbbiamoCreatoPer_1_1.setLineWrap(true);
txtrAbbiamoCreatoPer_1_1.setFont(new Font("Dialog", Font.PLAIN, 15));
txtrAbbiamoCreatoPer_1_1.setEditable(false);
txtrAbbiamoCreatoPer_1_1.setBackground(Color.WHITE);
lblCustomizedGraphicSignature = new JLabel("");
- lblCustomizedGraphicSignature.setBounds(0, 0, 449, 93);
+ lblCustomizedGraphicSignature.setBounds(40, 0, 368, 184);
panel_30.add(lblCustomizedGraphicSignature);
pnVerify = new JPanel();
pnVerify.setLayout(null);
@@ -2429,13 +2433,14 @@ public class MainFrame extends JFrame {
pnVerify.add(lblFirmaElettronica_6);
panel_32 = new JPanel();
panel_32.setBackground(Color.WHITE);
- panel_32.setBounds(76, 132, 449, 415);
+ panel_32.setBounds(76, 132, 449, 375);
pnVerify.add(panel_32);
panel_32.setLayout(null);
verifyScrollPane = new JScrollPane();
- verifyScrollPane.setBounds(26, 110, 396, 259);
+ verifyScrollPane.setBounds(26, 120, 396, 219);
verifyScrollPane.setBorder(BorderFactory.createEmptyBorder());
verifyScrollPane.setViewportBorder(BorderFactory.createEmptyBorder());
+ verifyScrollPane.getViewport().setBackground(Color.WHITE);
panel_32.add(verifyScrollPane);
JPanel panel_27_1 = new JPanel();
panel_27_1.setBounds(0, 0, 449, 82);
@@ -2465,8 +2470,8 @@ public class MainFrame extends JFrame {
});
btnConcludiVerifica.setForeground(Color.WHITE);
btnConcludiVerifica.setBackground(new Color(30, 144, 255));
- btnConcludiVerifica.setBounds(257, 392, 136, 23);
- panel_32.add(btnConcludiVerifica);
+ btnConcludiVerifica.setBounds(333, 507, 136, 23);
+ pnVerify.add(btnConcludiVerifica);
btnExtractP7M = new JButton("Estrai");
btnExtractP7M.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
@@ -2515,8 +2520,8 @@ public class MainFrame extends JFrame {
});
btnExtractP7M.setForeground(Color.WHITE);
btnExtractP7M.setBackground(new Color(30, 144, 255));
- btnExtractP7M.setBounds(57, 391, 136, 23);
- panel_32.add(btnExtractP7M);
+ btnExtractP7M.setBounds(133, 507, 136, 23);
+ pnVerify.add(btnExtractP7M);
JLabel lblNewLabel_13 = new JLabel("Verifica firma elettronica");
lblNewLabel_13.setFont(new Font("Dialog", Font.BOLD, 17));
lblNewLabel_13.setBounds(190, 82, 246, 15);
@@ -2527,7 +2532,7 @@ public class MainFrame extends JFrame {
pnSettings.setLayout(null);
JTabbedPane configTabbedPane = new JTabbedPane(JTabbedPane.TOP);
configTabbedPane.setBackground(Color.WHITE);
- configTabbedPane.setBounds(12, 12, 571, 500);
+ configTabbedPane.setBounds(12, 12, 574, 500);
pnSettings.add(configTabbedPane);
JPanel configProxyPanel = new JPanel();
configProxyPanel.setBackground(Color.WHITE);
@@ -2616,7 +2621,7 @@ public class MainFrame extends JFrame {
lblConfigLoggingCaption.setFont(new Font("Dialog", Font.BOLD, 15));
configLoggingPanel.add(lblConfigLoggingCaption);
JPanel configLoggingBodyPanel = new JPanel();
- configLoggingBodyPanel.setBounds(37, 109, 500, 331);
+ configLoggingBodyPanel.setBounds(37, 89, 500, 331);
configLoggingBodyPanel.setLayout(null);
configLoggingBodyPanel.setBackground(Color.WHITE);
configLoggingPanel.add(configLoggingBodyPanel);
@@ -2828,7 +2833,200 @@ public class MainFrame extends JFrame {
} else {
selectHome();
}
-
+
+ class ComponentResizer {
+ public void resizeComponents() {
+ int width = getWidth();
+ int height = getHeight();
+
+ // Helper class to calculate the correct centerd position
+ class Relocator {
+ int x(int x) {
+ return ((width - 200) / 2) - (300 - x);
+ }
+
+ int y(int y) {
+ return (height / 2) - (300 - y);
+ }
+ }
+
+ Relocator r = new Relocator();
+
+ // Make leftPanel full height
+ leftPanel.setSize(200, height);
+ // Make tabbedPane full height and full width
+ tabbedPane.setSize(width - 197, height + 69);
+
+ lblPairYourCIE.setLocation(r.x(147), lblPairYourCIE.getY());
+ txtpnConnectAndPlaceYourCIEOnTheReader.setLocation(r.x(63), txtpnConnectAndPlaceYourCIEOnTheReader.getY());
+ lblNewLabel1.setLocation(r.x(29), r.y(194));
+ passwordField.setLocation(r.x(250), r.y(321));
+ passwordField_1.setLocation(r.x(287), r.y(321));
+ passwordField_2.setLocation(r.x(324), r.y(321));
+ passwordField_3.setLocation(r.x(362), r.y(321));
+ passwordField_4.setLocation(r.x(399), r.y(321));
+ passwordField_5.setLocation(r.x(436), r.y(321));
+ passwordField_6.setLocation(r.x(473), r.y(321));
+ passwordField_7.setLocation(r.x(510), r.y(321));
+ lblTypeYourCIEPIN.setLocation(r.x(252), r.y(259));
+ buttonsPanel.setLocation(r.x(133), height - 93);
+ label.setLocation(r.x(147), label.getY());
+ /* 0 */
+ textPane_1.setLocation(r.x(63), textPane_1.getY());
+ label_1.setLocation(r.x(29), r.y(194));
+ checkBox.setLocation(width, checkBox.getY()); // This is hidden
+ lblProgress.setLocation(r.x(252), r.y(259));
+ progressBar.setLocation(r.x(258), r.y(324));
+ /* 1 */
+ cieCarousel.setLocation(cieCarousel.getX(), r.y(170));
+ cieCarousel.cieRight.setLocation(r.x(408), cieCarousel.cieRight.getY());
+ cieCarousel.cieCenter.setLocation(r.x(190), cieCarousel.cieCenter.getY());
+ cieCarousel.cieLeft.setLocation(r.x(38), cieCarousel.cieLeft.getY());
+ cieCarousel.radioButtonPanel.setLocation(r.x(55), cieCarousel.radioButtonPanel.getY());
+ cieCarousel.setSize(width - 205, height / 2);
+ cieCarousel.btnRight.setLocation(width - 252, cieCarousel.btnRight.getY());
+ btnPanel.setBounds(btnPanel.getX(), height - 93, width - 205, btnPanel.getHeight());
+ lblCieId.setLocation(r.x(147), lblCieId.getY());
+ txtpnCIEPanelsSubtitle.setLocation(r.x(50), txtpnCIEPanelsSubtitle.getY());
+ /* 2 */
+ lblChangePIN.setLocation(r.x(147), lblChangePIN.getY());
+ txtpnThePINOfYourCard.setLocation(r.x(147), txtpnThePINOfYourCard.getY());
+ label_5.setLocation(r.x(29), r.y(194));
+ checkBox_2.setLocation(width, checkBox_2.getY()); // This is hidden
+ btnPerformChangePIN.setLocation(r.x(223), height - 93);
+ lblTypeTheOldValue.setLocation(r.x(252), r.y(201));
+ oldPIN.setLocation(r.x(252), r.y(230));
+ lblTypeTheNewValue.setLocation(r.x(252), r.y(266));
+ newPIN.setLocation(r.x(252), r.y(295));
+ lblTypeAgainTheNewValue.setLocation(r.x(252), r.y(332));
+ repeatNewPIN.setLocation(r.x(252), r.y(361));
+ txtpnThePINOfYourCIEMustContainEightDigits.setLocation(r.x(262), r.y(398));
+ /* 3 */
+ lblChangePINText.setLocation(r.x(147), lblChangePINText.getY());
+ txtpnThePINOfYourCIE.setLocation(r.x(147), txtpnThePINOfYourCIE.getY());
+ label_6.setLocation(r.x(29), r.y(194));
+ checkBox_3.setLocation(width, checkBox_3.getY()); // This is hidden
+ labelProgressChangePIN.setLocation(r.x(252), r.y(259));
+ progressBarChangePIN.setLocation(r.x(258), r.y(324));
+ /* 4 */
+ lblUnlockCard1.setLocation(r.x(147), lblUnlockCard1.getY());
+ label_7.setLocation(r.x(29), r.y(194));
+ txtpnUseYourPUK.setLocation(r.x(126), txtpnUseYourPUK.getY());
+ checkBox_4.setLocation(width, checkBox_4.getY()); // This is hidden
+ btnUnlockPIN.setLocation(r.x(223), height - 93);
+ lblInsertYourPUK.setLocation(r.x(252), r.y(201));
+ puk01.setLocation(r.x(252), r.y(230));
+ label_9.setLocation(r.x(252), r.y(266));
+ pin01.setLocation(r.x(252), r.y(295));
+ label_10.setLocation(r.x(252), r.y(332));
+ pin02.setLocation(r.x(252), r.y(361));
+ textPane_2.setLocation(r.x(262), r.y(398));
+ lblUnlockCard2.setLocation(r.x(147), lblUnlockCard2.getY());
+ txtpnTypeThePUKOfYourCIE.setLocation(r.x(132), txtpnTypeThePUKOfYourCIE.getY());
+ /* 5 */
+ label_8.setLocation(r.x(29), r.y(194));
+ checkBox_5.setLocation(width, checkBox_5.getY()); // This is hidden
+ labelProgressUnlock.setLocation(r.x(252), r.y(259));
+ progressBarUnlock.setLocation(r.x(258), r.y(324));
+ lblHelp.setLocation(r.x(147), lblHelp.getY());
+ webView.setSize(width - 226, height - 162);
+ label_11.setLocation(r.x(147), label_11.getY());
+ miniWebView.setSize(width - 226, height - 162);
+ lblInformation.setLocation(r.x(147), lblInformation.getY());
+ miniWebView_1.setSize(width - 226, height - 162);
+ /* 6,7,8,9 */
+ lblDigitalSignature.setLocation(r.x(147), lblDigitalSignature.getY());
+ panel_24.setSize(width - 260, height - 199);
+ panelLoadFile.setSize(width - 284, height - 300);
+ lblNewLabel.setLocation(r.x(223), r.y(12));
+ txtrDragAndDropDocuments.setLocation(r.x(70), r.y(141));
+ txtrOtherwise.setLocation(r.x(239), r.y(212));
+ btnSelectDocument.setLocation(r.x(161), r.y(265));
+ panel_11.setBounds(panel_11.getX(), height - 264, width - 240, panel_11.getHeight());
+ lblSFP.setSize(width - 454, lblSFP.getHeight());
+ lblCustomize.setLocation(width - 367, lblCustomize.getY());
+ lblFPOK.setSize(width - 354, lblFPOK.getHeight());
+ lblFirmaElettronica_1.setLocation(r.x(165), lblFirmaElettronica_1.getY());
+ /* 10 */
+ panel_16.setSize(width - 351, height - 225);
+ panel.setSize(width - 351, panel.getHeight());
+ lblPathOp.setSize(width - 421, lblPathOp.getHeight());
+ panel_12.setLocation(r.x(102), r.y(121));
+ btnCancelOp.setLocation(r.x(223), height - 93);
+ /* 11 */
+ lblFirmaElettronica_2.setLocation(r.x(165), lblFirmaElettronica_2.getY());
+ panel_23.setSize(width - 351, height - 225);
+ panel_15.setSize(width - 352, panel_15.getHeight());
+ lblPathSignOp.setSize(width - 421, lblPathSignOp.getHeight());
+ panel_20.setBounds(panel_20.getX(), r.y(70), width - 352, panel_20.getHeight());
+ lblNewLabel_8_1.setLocation(r.x(129), lblNewLabel_8_1.getY());
+ panel_18.setLocation(r.x(0), panel_18.getY());
+ panel_19.setLocation(r.x(250), panel_19.getY());
+ panel_17.setLocation(r.x(124), height - 93);
+ lblNewLabel_8.setLocation(r.x(237), lblNewLabel_8.getY());
+ /* 12 */
+ lblFirmaElettronica_3.setLocation(r.x(149), lblFirmaElettronica_3.getY());
+ panel_25.setSize(width - 351, height - 225);
+ panel_21.setSize(width - 352, panel_21.getHeight());
+ lblPathPreview.setSize(width - 421, lblPathPreview.getHeight());
+ panelPdfPreview.setSize(width - 423, height - 354);
+ if (signOperation == signOperation.PADES) {
+ preview.showPreview();
+ }
+ panel_22.setLocation(width - 403, r.y(143));
+ btnAnnullaOp_3.setLocation(r.x(223), height - 93);
+ lblNewLabel_10.setLocation(r.x(35), lblNewLabel_10.getY());
+ /* 13 */
+ lblFirmaElettronica_4.setLocation(r.x(165), lblFirmaElettronica_4.getY());
+ panel_26.setSize(width - 351, height - 225);
+ panel_27.setSize(width - 352, panel_27.getHeight());
+ lblPathPin.setSize(width - 421, lblPathPin.getHeight());
+ panel_28.setLocation(r.x(124), height - 93);
+ panel_29.setLocation(r.x(0), r.y(153));
+ lblNewLabel_12.setLocation(r.x(185), lblNewLabel_12.getY());
+ /* 14 */
+ lblFirmaElettronica_5.setLocation(r.x(149), lblFirmaElettronica_5.getY());
+ lblHint.setSize(width - 351, lblHint.getHeight());
+ txtrAbbiamoCreatoPer_1_1.setSize(width - 351, txtrAbbiamoCreatoPer_1_1.getHeight());
+ lblCustomizedGraphicSignature.setLocation(r.x(40), lblCustomizedGraphicSignature.getY());
+ panel_30.setSize(width - 351, height - 225);
+ panel_31.setBounds(r.x(76), height - 93, width - 351, panel_31.getHeight());
+ /* 15 */
+ lblFirmaElettronica_6.setLocation(r.x(149), lblFirmaElettronica_6.getY());
+ panel_32.setSize(width - 351, height - 225);
+ verifyScrollPane.setSize(width - 404, height - 381);
+ panel_27_1.setSize(width - 351, panel_27_1.getHeight());
+ lblPathVerifica.setSize(width - 421, lblPathVerifica.getHeight());
+ btnConcludiVerifica.setLocation(r.x(333), height - 93);
+ btnExtractP7M.setLocation(r.x(133), height - 93);
+ lblNewLabel_13.setLocation(r.x(190), lblNewLabel_13.getY());
+ /* 16 */
+ configTabbedPane.setSize(width - 226, height - 100);
+ lblConfigProxyTitle.setLocation(r.x(67), lblConfigProxyTitle.getY());
+ lblConfigProxyCaption.setLocation(r.x(53), lblConfigProxyCaption.getY());
+ configProxyBodyPanel.setLocation(r.x(37), configProxyBodyPanel.getY());
+ lblConfigLoggingTitle.setLocation(r.x(73), lblConfigLoggingTitle.getY());
+ lblConfigLoggingCaption.setLocation(r.x(69), lblConfigLoggingCaption.getY());
+ configLoggingBodyPanel.setLocation(r.x(37), configLoggingBodyPanel.getY());
+ configButtonsPanel.setLocation(r.x(0), height - 76);
+ lblConfigPreferencesTitle.setLocation(r.x(72), lblConfigPreferencesTitle.getY());
+ lblConfigPreferencesCaption.setLocation(r.x(40), lblConfigPreferencesCaption.getY());
+ lblConfigPreferencesCaption_1.setLocation(r.x(45), lblConfigPreferencesCaption_1.getY());
+ cboxShowTutorial.setLocation(r.x(94), cboxShowTutorial.getY());
+ btnDeleteLogs.setLocation(r.x(292), btnDeleteLogs.getY());
+ btnCollectLogs.setLocation(r.x(47), btnCollectLogs.getY());
+ /* 17 */
+ }
+ }
+
+ // Listen for resizes
+ addComponentListener(new ComponentAdapter() {
+ @Override
+ public void componentResized(ComponentEvent e) {
+ new ComponentResizer().resizeComponents();
+ };
+ });
+
System.out.println("tabbedPanel: " + tabbedPane);
}
diff --git a/cie_sign_sdk/src/PdfSignatureGenerator.cpp b/cie_sign_sdk/src/PdfSignatureGenerator.cpp
index fa5e038..48714ec 100644
--- a/cie_sign_sdk/src/PdfSignatureGenerator.cpp
+++ b/cie_sign_sdk/src/PdfSignatureGenerator.cpp
@@ -16,7 +16,7 @@
#define MAX_TMP 1000
#define FONT_NAME "DejaVu Sans"
#define FONT_SIZE 5.0
-#define TXT_PAD 5
+#define TXT_PAD 5.5
#ifdef CreateFont
#undef CreateFont
@@ -297,7 +297,7 @@ void PdfSignatureGenerator::InitSignature(int pageIndex, float left, float botto
PdfEncodingFactory::GlobalWinAnsiEncodingInstance(),
// We set no embedding but it doesn't work
PdfFontCache::eFontCreationFlags_AutoSelectBase14, false);
- PdfRect sigRect = PdfRect(left0 + TXT_PAD, bottom0 - (TXT_PAD * 2), width0, height0);
+ PdfRect sigRect = PdfRect(left0 + TXT_PAD, bottom0 - TXT_PAD, width0, height0);
painter.SetFont(font);
font->SetFontSize(FONT_SIZE);
painter.DrawMultiLineText(sigRect, PdfString(signatureStamp));
@@ -361,7 +361,7 @@ void PdfSignatureGenerator::InitSignature(int pageIndex, float left, float botto
}
#else
PdfFont* font = m_pPdfDocument->GetFonts().SearchFont(FONT_NAME);
- Rect sigRect = Rect(left0 + TXT_PAD, bottom0 - (TXT_PAD * 2), width0, height0);
+ Rect sigRect = Rect(left0 + TXT_PAD, bottom0 - TXT_PAD, width0, height0);
painter.TextState.SetFont(*font, FONT_SIZE);
painter.DrawTextMultiLine(signatureStamp, sigRect);
--
2.43.5