1111public class DecompilerSettings {
1212 private final Decompiler decompiler ;
1313
14- private final JScrollPane dialog ;
15- private final JPanel dialogPane ;
14+ private final JScrollPane dialogPane ;
15+ private final JPanel dialog ;
1616
1717 /**
1818 * Stores all of the individual settings. Should not be modified after initialization.
@@ -25,20 +25,20 @@ public class DecompilerSettings {
2525
2626 public DecompilerSettings (Decompiler decompiler ) {
2727 this .decompiler = decompiler ;
28- dialogPane = new JPanel ();
29- dialogPane .setLayout (new MigLayout ("gap rel 0" , "grow" ));
30- dialog = new JScrollPane (dialogPane );
31- dialog .setBorder (BorderFactory .createEmptyBorder ());
32- dialog .setPreferredSize (new Dimension (400 , 375 ));
28+ dialog = new JPanel ();
29+ dialog .setLayout (new MigLayout ("gap rel 0" , "grow" ));
30+ dialogPane = new JScrollPane (dialog );
31+ dialogPane .setBorder (BorderFactory .createEmptyBorder ());
32+ dialogPane .setPreferredSize (new Dimension (400 , 375 ));
3333 }
3434
3535 public void displayDialog () {
36- Dimension oldSize = dialog .getPreferredSize ();
37- if (oldSize .height > dialogPane .getPreferredSize ().height )
38- dialog .setPreferredSize (new Dimension (oldSize .width , dialogPane .getPreferredSize ().height ));
39- if (oldSize .width > dialogPane .getPreferredSize ().width )
40- dialog .setPreferredSize (new Dimension (dialogPane .getPreferredSize ().width + 50 , oldSize .height ));
41- if (JOptionPane .showConfirmDialog (null , dialog , decompiler .getName () + " Settings" , JOptionPane .OK_CANCEL_OPTION , JOptionPane .PLAIN_MESSAGE ) == JOptionPane .OK_OPTION ) {
36+ Dimension oldSize = dialogPane .getPreferredSize ();
37+ if (oldSize .height > dialog .getPreferredSize ().height )
38+ dialogPane .setPreferredSize (new Dimension (oldSize .width , dialog .getPreferredSize ().height ));
39+ if (oldSize .width > dialog .getPreferredSize ().width )
40+ dialogPane .setPreferredSize (new Dimension (dialog .getPreferredSize ().width + 50 , dialogPane . getPreferredSize () .height ));
41+ if (JOptionPane .showConfirmDialog (null , dialogPane , decompiler .getName () + " Settings" , JOptionPane .OK_CANCEL_OPTION , JOptionPane .PLAIN_MESSAGE ) == JOptionPane .OK_OPTION ) {
4242 for (Map .Entry <SettingsEntry , JCheckBox > entry : booleanSettings .entrySet ()) {
4343 entry .getKey ().set (entry .getValue ().isSelected ());
4444 }
@@ -51,7 +51,7 @@ public void displayDialog() {
5151 entry .getKey ().set (entry .getValue ().getValue ());
5252 }
5353 }
54- dialog .setPreferredSize (oldSize );
54+ dialogPane .setPreferredSize (oldSize );
5555 }
5656
5757 public SettingsEntry getEntry (String key ) {
@@ -93,8 +93,8 @@ public void registerSetting(SettingsEntry entry) {
9393 throw new IllegalArgumentException ();
9494 }
9595
96- dialogPane .add (item , "align right" );
97- dialogPane .add (new JLabel (entry .name ), "wrap" );
96+ dialog .add (item , "align right" );
97+ dialog .add (new JLabel (entry .name ), "wrap" );
9898 }
9999
100100 public void loadFrom (JsonObject rootSettings ) {
0 commit comments