@@ -19,6 +19,7 @@ public class BobRustSettingsDialog {
19
19
private final JDialog dialog ;
20
20
21
21
private final JComboBox <Integer > alphaCombobox ;
22
+ private final JComboBox <String > scalingCombobox ;
22
23
private final JIntegerField maxShapesField ;
23
24
private final JIntegerField callbackIntervalField ;
24
25
private final JIntegerField clickIntervalField ;
@@ -95,73 +96,105 @@ public BobRustSettingsDialog(BobRustEditor gui, JDialog parent) {
95
96
});
96
97
signPanel .add (btnSign );
97
98
98
- JPanel alphaPanel = new JPanel ();
99
- alphaPanel .setAlignmentX (Component .LEFT_ALIGNMENT );
100
- alphaPanel .setBorder (new EmptyBorder (5 , 5 , 0 , 5 ));
101
- alphaPanel .setPreferredSize (optionSize );
102
- alphaPanel .setMinimumSize (optionSize );
103
- alphaPanel .setMaximumSize (optionSize );
104
- panel .add (alphaPanel );
105
- alphaPanel .setLayout (new BoxLayout (alphaPanel , BoxLayout .Y_AXIS ));
106
-
107
- JLabel alphaLabel = new JLabel (RustUI .getString (Type .SETTINGS_ALPHAINDEX_LABEL ));
108
- alphaLabel .setToolTipText (RustUI .getString (Type .SETTINGS_ALPHAINDEX_TOOLTIP ));
109
- alphaLabel .setHorizontalTextPosition (SwingConstants .CENTER );
110
- alphaLabel .setHorizontalAlignment (SwingConstants .CENTER );
111
- alphaPanel .add (alphaLabel );
112
-
113
- alphaCombobox = new JComboBox <Integer >();
114
- alphaCombobox .setAlignmentX (Component .LEFT_ALIGNMENT );
115
- alphaCombobox .setFocusable (false );
116
- alphaLabel .setLabelFor (alphaCombobox );
117
- alphaCombobox .setMaximumSize (new Dimension (116 , 20 ));
118
- alphaCombobox .setModel (new DefaultComboBoxModel <Integer >(new Integer [] { 0 , 1 , 2 , 3 , 4 , 5 }));
119
- alphaCombobox .setSelectedIndex (gui .getSettingsAlpha ());
120
- alphaPanel .add (alphaCombobox );
121
-
122
- JPanel shapesPanel = new JPanel ();
123
- shapesPanel .setAlignmentX (Component .LEFT_ALIGNMENT );
124
- shapesPanel .setBorder (new EmptyBorder (5 , 5 , 5 , 5 ));
125
- shapesPanel .setPreferredSize (optionSize );
126
- shapesPanel .setMinimumSize (optionSize );
127
- shapesPanel .setMaximumSize (optionSize );
128
- panel .add (shapesPanel );
129
- shapesPanel .setLayout (new BoxLayout (shapesPanel , BoxLayout .Y_AXIS ));
130
-
131
- JLabel shapesLabel = new JLabel (RustUI .getString (Type .SETTINGS_MAXSHAPES_LABEL ));
132
- shapesLabel .setToolTipText (RustUI .getString (Type .SETTINGS_MAXSHAPES_TOOLTIP ));
133
- shapesLabel .setHorizontalTextPosition (SwingConstants .CENTER );
134
- shapesLabel .setHorizontalAlignment (SwingConstants .CENTER );
135
- shapesPanel .add (shapesLabel );
136
-
137
- maxShapesField = new JIntegerField (gui .getSettingsMaxShapes ());
138
- maxShapesField .setAlignmentX (Component .LEFT_ALIGNMENT );
139
- maxShapesField .setFocusable (true );
140
- maxShapesField .setMaximumSize (new Dimension (116 , 20 ));
141
- shapesLabel .setLabelFor (maxShapesField );
142
- shapesPanel .add (maxShapesField );
99
+ {
100
+ JPanel alphaPanel = new JPanel ();
101
+ alphaPanel .setAlignmentX (Component .LEFT_ALIGNMENT );
102
+ alphaPanel .setBorder (new EmptyBorder (5 , 5 , 0 , 5 ));
103
+ alphaPanel .setPreferredSize (optionSize );
104
+ alphaPanel .setMinimumSize (optionSize );
105
+ alphaPanel .setMaximumSize (optionSize );
106
+ panel .add (alphaPanel );
107
+ alphaPanel .setLayout (new BoxLayout (alphaPanel , BoxLayout .Y_AXIS ));
108
+
109
+ JLabel alphaLabel = new JLabel (RustUI .getString (Type .SETTINGS_ALPHAINDEX_LABEL ));
110
+ alphaLabel .setToolTipText (RustUI .getString (Type .SETTINGS_ALPHAINDEX_TOOLTIP ));
111
+ alphaLabel .setHorizontalTextPosition (SwingConstants .CENTER );
112
+ alphaLabel .setHorizontalAlignment (SwingConstants .CENTER );
113
+ alphaPanel .add (alphaLabel );
114
+
115
+ alphaCombobox = new JComboBox <Integer >();
116
+ alphaCombobox .setAlignmentX (Component .LEFT_ALIGNMENT );
117
+ alphaCombobox .setFocusable (false );
118
+ alphaLabel .setLabelFor (alphaCombobox );
119
+ alphaCombobox .setMaximumSize (new Dimension (116 , 20 ));
120
+ alphaCombobox .setModel (new DefaultComboBoxModel <Integer >(new Integer [] { 0 , 1 , 2 , 3 , 4 , 5 }));
121
+ alphaCombobox .setSelectedIndex (gui .getSettingsAlpha ());
122
+ alphaPanel .add (alphaCombobox );
123
+ }
143
124
144
- JPanel callbackPanel = new JPanel ();
145
- callbackPanel .setAlignmentX (Component .LEFT_ALIGNMENT );
146
- callbackPanel .setBorder (new EmptyBorder (5 , 5 , 5 , 5 ));
147
- callbackPanel .setPreferredSize (optionSize );
148
- callbackPanel .setMinimumSize (optionSize );
149
- callbackPanel .setMaximumSize (optionSize );
150
- panel .add (callbackPanel );
151
- callbackPanel .setLayout (new BoxLayout (callbackPanel , BoxLayout .Y_AXIS ));
125
+ {
126
+ JPanel scalingPanel = new JPanel ();
127
+ scalingPanel .setAlignmentX (Component .LEFT_ALIGNMENT );
128
+ scalingPanel .setBorder (new EmptyBorder (5 , 5 , 0 , 5 ));
129
+ scalingPanel .setPreferredSize (optionSize );
130
+ scalingPanel .setMinimumSize (optionSize );
131
+ scalingPanel .setMaximumSize (optionSize );
132
+ panel .add (scalingPanel );
133
+ scalingPanel .setLayout (new BoxLayout (scalingPanel , BoxLayout .Y_AXIS ));
134
+
135
+ JLabel scalingLabel = new JLabel (RustUI .getString (Type .SETTINGS_SCALINGTYPE_LABEL ));
136
+ scalingLabel .setToolTipText (RustUI .getString (Type .SETTINGS_SCALINGTYPE_TOOLTIP ));
137
+ scalingLabel .setHorizontalTextPosition (SwingConstants .CENTER );
138
+ scalingLabel .setHorizontalAlignment (SwingConstants .CENTER );
139
+ scalingPanel .add (scalingLabel );
140
+
141
+ scalingCombobox = new JComboBox <String >();
142
+ scalingCombobox .setAlignmentX (Component .LEFT_ALIGNMENT );
143
+ scalingCombobox .setFocusable (false );
144
+ scalingLabel .setLabelFor (scalingCombobox );
145
+ scalingCombobox .setMaximumSize (new Dimension (116 , 20 ));
146
+ scalingCombobox .setModel (new DefaultComboBoxModel <String >(new String [] { "NEAREST" , "BILINEAR" , "BICUBIC" }));
147
+ scalingCombobox .setSelectedIndex (gui .getSettingsScaling ());
148
+ scalingPanel .add (scalingCombobox );
149
+ }
152
150
153
- JLabel callbackLabel = new JLabel (RustUI .getString (Type .SETTINGS_CALLBACKINTERVAL_LABEL ));
154
- callbackLabel .setToolTipText (RustUI .getString (Type .SETTINGS_CALLBACKINTERVAL_TOOLTIP ));
155
- callbackLabel .setHorizontalTextPosition (SwingConstants .CENTER );
156
- callbackLabel .setHorizontalAlignment (SwingConstants .CENTER );
157
- callbackPanel .add (callbackLabel );
151
+ {
152
+ JPanel shapesPanel = new JPanel ();
153
+ shapesPanel .setAlignmentX (Component .LEFT_ALIGNMENT );
154
+ shapesPanel .setBorder (new EmptyBorder (5 , 5 , 5 , 5 ));
155
+ shapesPanel .setPreferredSize (optionSize );
156
+ shapesPanel .setMinimumSize (optionSize );
157
+ shapesPanel .setMaximumSize (optionSize );
158
+ panel .add (shapesPanel );
159
+ shapesPanel .setLayout (new BoxLayout (shapesPanel , BoxLayout .Y_AXIS ));
160
+
161
+ JLabel shapesLabel = new JLabel (RustUI .getString (Type .SETTINGS_MAXSHAPES_LABEL ));
162
+ shapesLabel .setToolTipText (RustUI .getString (Type .SETTINGS_MAXSHAPES_TOOLTIP ));
163
+ shapesLabel .setHorizontalTextPosition (SwingConstants .CENTER );
164
+ shapesLabel .setHorizontalAlignment (SwingConstants .CENTER );
165
+ shapesPanel .add (shapesLabel );
166
+
167
+ maxShapesField = new JIntegerField (gui .getSettingsMaxShapes ());
168
+ maxShapesField .setAlignmentX (Component .LEFT_ALIGNMENT );
169
+ maxShapesField .setFocusable (true );
170
+ maxShapesField .setMaximumSize (new Dimension (116 , 20 ));
171
+ shapesLabel .setLabelFor (maxShapesField );
172
+ shapesPanel .add (maxShapesField );
173
+ }
158
174
159
- callbackIntervalField = new JIntegerField (gui .getSettingsCallbackInterval ());
160
- callbackIntervalField .setAlignmentX (Component .LEFT_ALIGNMENT );
161
- callbackIntervalField .setFocusable (true );
162
- callbackIntervalField .setMaximumSize (new Dimension (116 , 20 ));
163
- callbackLabel .setLabelFor (callbackIntervalField );
164
- callbackPanel .add (callbackIntervalField );
175
+ {
176
+ JPanel callbackPanel = new JPanel ();
177
+ callbackPanel .setAlignmentX (Component .LEFT_ALIGNMENT );
178
+ callbackPanel .setBorder (new EmptyBorder (5 , 5 , 5 , 5 ));
179
+ callbackPanel .setPreferredSize (optionSize );
180
+ callbackPanel .setMinimumSize (optionSize );
181
+ callbackPanel .setMaximumSize (optionSize );
182
+ panel .add (callbackPanel );
183
+ callbackPanel .setLayout (new BoxLayout (callbackPanel , BoxLayout .Y_AXIS ));
184
+
185
+ JLabel callbackLabel = new JLabel (RustUI .getString (Type .SETTINGS_CALLBACKINTERVAL_LABEL ));
186
+ callbackLabel .setToolTipText (RustUI .getString (Type .SETTINGS_CALLBACKINTERVAL_TOOLTIP ));
187
+ callbackLabel .setHorizontalTextPosition (SwingConstants .CENTER );
188
+ callbackLabel .setHorizontalAlignment (SwingConstants .CENTER );
189
+ callbackPanel .add (callbackLabel );
190
+
191
+ callbackIntervalField = new JIntegerField (gui .getSettingsCallbackInterval ());
192
+ callbackIntervalField .setAlignmentX (Component .LEFT_ALIGNMENT );
193
+ callbackIntervalField .setFocusable (true );
194
+ callbackIntervalField .setMaximumSize (new Dimension (116 , 20 ));
195
+ callbackLabel .setLabelFor (callbackIntervalField );
196
+ callbackPanel .add (callbackIntervalField );
197
+ }
165
198
166
199
{
167
200
JPanel clickIntervalPanel = new JPanel ();
@@ -351,6 +384,7 @@ public void openDialog(Point point) {
351
384
dialog .setVisible (true );
352
385
353
386
gui .setSettingsAlpha (alphaCombobox .getSelectedIndex ());
387
+ gui .setSettingsScaling (scalingCombobox .getSelectedIndex ());
354
388
355
389
try {
356
390
gui .setSettingsMaxShapes (maxShapesField .getNumberValue ());
0 commit comments