29
29
import java .awt .Color ;
30
30
import java .awt .Component ;
31
31
import java .awt .Dimension ;
32
+ import java .awt .Font ;
32
33
33
34
import javax .swing .JFileChooser ;
34
35
import javax .swing .JList ;
@@ -46,26 +47,32 @@ public class JadxecuteDialog extends JDialog {
46
47
private final transient JadxSettings settings ;
47
48
private final transient MainWindow mainWindow ;
48
49
50
+ private static final int DEFAULT_FONT_SIZE = 12 ;
51
+
49
52
public JadxecuteDialog (MainWindow mainWindow ) {
53
+ super (mainWindow , "JADXexecute" , true );
50
54
this .mainWindow = mainWindow ;
51
55
this .settings = mainWindow .getSettings ();
56
+
52
57
initUI ();
53
58
}
54
59
55
60
private void initUI () {
56
61
JPanel mainPanel = new JPanel ();
57
62
mainPanel .setLayout (new BorderLayout ());
58
63
mainPanel .setBorder (new EmptyBorder (10 , 10 , 10 , 10 ));
59
-
64
+
60
65
// Input and output code areas
61
66
JLabel codeInputDescription = new JLabel ("Java Input" );
62
- codeInputDescription .setPreferredSize (new Dimension (80 , 16 ));
67
+ codeInputDescription .setFont (new Font (null , Font .BOLD , DEFAULT_FONT_SIZE ));
68
+ codeInputDescription .setPreferredSize (new Dimension (100 , 16 ));
63
69
RSyntaxTextArea codeInputArea = new RSyntaxTextArea (getDefaultCodeInputText ());
64
70
codeInputArea .setSyntaxEditingStyle (SyntaxConstants .SYNTAX_STYLE_JAVA );
65
71
JScrollPane codeInputScrollPanel = new JScrollPane (codeInputArea );
66
- codeInputScrollPanel .setPreferredSize (new Dimension (550 , 200 ));
72
+ codeInputScrollPanel .setPreferredSize (new Dimension (600 , 200 ));
67
73
68
74
JLabel consoleOutputDescription = new JLabel ("Console Output" );
75
+ consoleOutputDescription .setFont (new Font (null , Font .BOLD , DEFAULT_FONT_SIZE ));
69
76
consoleOutputDescription .setPreferredSize (new Dimension (80 , 16 ));
70
77
consoleOutputDescription .setBorder (new EmptyBorder (10 , 0 , 10 , 0 ));
71
78
JTextArea consoleOutputArea = new JTextArea (" " );
@@ -85,11 +92,14 @@ private void initUI() {
85
92
bottomPan .setLayout (new BorderLayout ());
86
93
JPanel buttonPane = new JPanel ();
87
94
JLabel statusLabel = new JLabel ("Status: Ready" );
88
- statusLabel .setPreferredSize (new Dimension (80 , 16 ));
95
+ statusLabel .setPreferredSize (new Dimension (100 , 16 ));
89
96
JButton run = new JButton ("Run" );
90
97
JButton close = new JButton ("Close" );
91
98
close .addActionListener (event -> close ());
99
+
100
+ // run code
92
101
run .addActionListener (event -> runUserCode (codeInputArea , consoleOutputArea , statusLabel , run ));
102
+
93
103
buttonPane .add (run );
94
104
buttonPane .add (close );
95
105
bottomPan .add (statusLabel , BorderLayout .WEST );
@@ -137,15 +147,16 @@ private JPanel initCodeExamplesPanel(RSyntaxTextArea codeInputArea, JPanel fileP
137
147
codeExamplesPanel .setLayout (new BorderLayout ());
138
148
codeExamplesPanel .setBorder (new EmptyBorder (10 , 10 , 10 , 10 ));
139
149
JLabel scriptSelection = new JLabel ("Select Template:" );
140
-
150
+ scriptSelection .setFont (new Font (null , Font .BOLD , DEFAULT_FONT_SIZE ));
151
+
141
152
JScrollPane exampleScrollPane = initCodeExamplesListeners (codeInputArea );
142
153
JPanel southExamplesPanel = new JPanel ();
143
154
southExamplesPanel .setLayout (new BorderLayout ());
144
155
southExamplesPanel .add (scriptSelection , BorderLayout .NORTH );
145
156
southExamplesPanel .add (exampleScrollPane , BorderLayout .CENTER );
146
157
codeExamplesPanel .add (filePanel , BorderLayout .NORTH );
147
158
codeExamplesPanel .add (southExamplesPanel , BorderLayout .CENTER );
148
- codeExamplesPanel .setPreferredSize (new Dimension (200 , 400 ));
159
+ codeExamplesPanel .setPreferredSize (new Dimension (300 , 400 ));
149
160
150
161
return codeExamplesPanel ;
151
162
}
@@ -156,12 +167,14 @@ private void finishUI(JPanel mainPanel) {
156
167
157
168
setTitle ("JADXecute" );
158
169
pack ();
159
- if (!mainWindow .getSettings ().loadWindowPos (this )) {
160
- setSize (800 , 500 );
161
- }
162
- setLocationRelativeTo (null );
170
+
171
+ // set modal size
172
+ setSize (1024 , 768 );
173
+
174
+ setLocationRelativeTo (mainPanel );
175
+ this .setModal (false );
163
176
setDefaultCloseOperation (WindowConstants .DISPOSE_ON_CLOSE );
164
- setModalityType (ModalityType .APPLICATION_MODAL );
177
+ // setModalityType(ModalityType.APPLICATION_MODAL);
165
178
UiUtils .addEscapeShortCutToDispose (this );
166
179
}
167
180
@@ -190,6 +203,7 @@ private JPanel initFilePanel(RSyntaxTextArea codeInputArea) {
190
203
filePanel .setBorder (new EmptyBorder (10 , 0 , 10 , 0 ));
191
204
192
205
JLabel fileLabel = new JLabel ("Input Java File: " );
206
+ fileLabel .setFont (new Font (null , Font .BOLD , DEFAULT_FONT_SIZE ));
193
207
JTextField fileField = new JTextField (20 );
194
208
JButton fileButton = new JButton ("Browse" );
195
209
fileButton .addActionListener (e -> {
0 commit comments