|
|
@ -94,10 +94,10 @@ public final class SettingsDialog extends JFrame { |
|
|
|
private JCheckBox vsyncBox = null; |
|
|
|
private JCheckBox vsyncBox = null; |
|
|
|
private JCheckBox gammaBox = null; |
|
|
|
private JCheckBox gammaBox = null; |
|
|
|
private JCheckBox fullscreenBox = null; |
|
|
|
private JCheckBox fullscreenBox = null; |
|
|
|
private JComboBox displayResCombo = null; |
|
|
|
private JComboBox<String> displayResCombo = null; |
|
|
|
private JComboBox colorDepthCombo = null; |
|
|
|
private JComboBox<String> colorDepthCombo = null; |
|
|
|
private JComboBox displayFreqCombo = null; |
|
|
|
private JComboBox<String> displayFreqCombo = null; |
|
|
|
private JComboBox antialiasCombo = null; |
|
|
|
private JComboBox<String> antialiasCombo = null; |
|
|
|
private JLabel icon = null; |
|
|
|
private JLabel icon = null; |
|
|
|
private int selection = 0; |
|
|
|
private int selection = 0; |
|
|
|
private SelectionListener selectionListener = null; |
|
|
|
private SelectionListener selectionListener = null; |
|
|
@ -342,11 +342,11 @@ public final class SettingsDialog extends JFrame { |
|
|
|
|
|
|
|
|
|
|
|
displayResCombo = setUpResolutionChooser(); |
|
|
|
displayResCombo = setUpResolutionChooser(); |
|
|
|
displayResCombo.addKeyListener(aListener); |
|
|
|
displayResCombo.addKeyListener(aListener); |
|
|
|
colorDepthCombo = new JComboBox(); |
|
|
|
colorDepthCombo = new JComboBox<>(); |
|
|
|
colorDepthCombo.addKeyListener(aListener); |
|
|
|
colorDepthCombo.addKeyListener(aListener); |
|
|
|
displayFreqCombo = new JComboBox(); |
|
|
|
displayFreqCombo = new JComboBox<>(); |
|
|
|
displayFreqCombo.addKeyListener(aListener); |
|
|
|
displayFreqCombo.addKeyListener(aListener); |
|
|
|
antialiasCombo = new JComboBox(); |
|
|
|
antialiasCombo = new JComboBox<>(); |
|
|
|
antialiasCombo.addKeyListener(aListener); |
|
|
|
antialiasCombo.addKeyListener(aListener); |
|
|
|
fullscreenBox = new JCheckBox(resourceBundle.getString("checkbox.fullscreen")); |
|
|
|
fullscreenBox = new JCheckBox(resourceBundle.getString("checkbox.fullscreen")); |
|
|
|
fullscreenBox.setSelected(source.isFullscreen()); |
|
|
|
fullscreenBox.setSelected(source.isFullscreen()); |
|
|
@ -628,8 +628,8 @@ public final class SettingsDialog extends JFrame { |
|
|
|
* |
|
|
|
* |
|
|
|
* @return the combo box of display modes. |
|
|
|
* @return the combo box of display modes. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private JComboBox setUpResolutionChooser() { |
|
|
|
private JComboBox<String> setUpResolutionChooser() { |
|
|
|
JComboBox resolutionBox = new JComboBox(); |
|
|
|
JComboBox<String> resolutionBox = new JComboBox<>(); |
|
|
|
|
|
|
|
|
|
|
|
resolutionBox.addActionListener(new ActionListener() { |
|
|
|
resolutionBox.addActionListener(new ActionListener() { |
|
|
|
|
|
|
|
|
|
|
@ -663,11 +663,11 @@ public final class SettingsDialog extends JFrame { |
|
|
|
|
|
|
|
|
|
|
|
// grab available depths
|
|
|
|
// grab available depths
|
|
|
|
String[] depths = getDepths(resolution, modes); |
|
|
|
String[] depths = getDepths(resolution, modes); |
|
|
|
colorDepthCombo.setModel(new DefaultComboBoxModel(depths)); |
|
|
|
colorDepthCombo.setModel(new DefaultComboBoxModel<>(depths)); |
|
|
|
colorDepthCombo.setSelectedItem(colorDepth); |
|
|
|
colorDepthCombo.setSelectedItem(colorDepth); |
|
|
|
// grab available frequencies
|
|
|
|
// grab available frequencies
|
|
|
|
String[] freqs = getFrequencies(resolution, modes); |
|
|
|
String[] freqs = getFrequencies(resolution, modes); |
|
|
|
displayFreqCombo.setModel(new DefaultComboBoxModel(freqs)); |
|
|
|
displayFreqCombo.setModel(new DefaultComboBoxModel<>(freqs)); |
|
|
|
// Try to reset freq
|
|
|
|
// Try to reset freq
|
|
|
|
displayFreqCombo.setSelectedItem(displayFreq); |
|
|
|
displayFreqCombo.setSelectedItem(displayFreq); |
|
|
|
|
|
|
|
|
|
|
@ -686,18 +686,18 @@ public final class SettingsDialog extends JFrame { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void updateResolutionChoices() { |
|
|
|
private void updateResolutionChoices() { |
|
|
|
if (!fullscreenBox.isSelected()) { |
|
|
|
if (!fullscreenBox.isSelected()) { |
|
|
|
displayResCombo.setModel(new DefaultComboBoxModel( |
|
|
|
displayResCombo.setModel(new DefaultComboBoxModel<>( |
|
|
|
getWindowedResolutions(windowModes))); |
|
|
|
getWindowedResolutions(windowModes))); |
|
|
|
if (displayResCombo.getItemCount() > 0) { |
|
|
|
if (displayResCombo.getItemCount() > 0) { |
|
|
|
displayResCombo.setSelectedIndex(displayResCombo.getItemCount()-1); |
|
|
|
displayResCombo.setSelectedIndex(displayResCombo.getItemCount()-1); |
|
|
|
} |
|
|
|
} |
|
|
|
colorDepthCombo.setModel(new DefaultComboBoxModel(new String[]{ |
|
|
|
colorDepthCombo.setModel(new DefaultComboBoxModel<>(new String[]{ |
|
|
|
"24 bpp", "16 bpp"})); |
|
|
|
"24 bpp", "16 bpp"})); |
|
|
|
displayFreqCombo.setModel(new DefaultComboBoxModel( |
|
|
|
displayFreqCombo.setModel(new DefaultComboBoxModel<>( |
|
|
|
new String[]{resourceBundle.getString("refresh.na")})); |
|
|
|
new String[]{resourceBundle.getString("refresh.na")})); |
|
|
|
displayFreqCombo.setEnabled(false); |
|
|
|
displayFreqCombo.setEnabled(false); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
displayResCombo.setModel(new DefaultComboBoxModel( |
|
|
|
displayResCombo.setModel(new DefaultComboBoxModel<>( |
|
|
|
getResolutions(modes, Integer.MAX_VALUE, Integer.MAX_VALUE))); |
|
|
|
getResolutions(modes, Integer.MAX_VALUE, Integer.MAX_VALUE))); |
|
|
|
if (displayResCombo.getItemCount() > 0) { |
|
|
|
if (displayResCombo.getItemCount() > 0) { |
|
|
|
displayResCombo.setSelectedIndex(displayResCombo.getItemCount()-1); |
|
|
|
displayResCombo.setSelectedIndex(displayResCombo.getItemCount()-1); |
|
|
@ -711,7 +711,7 @@ public final class SettingsDialog extends JFrame { |
|
|
|
// maybe in the future will add support for determining this info
|
|
|
|
// maybe in the future will add support for determining this info
|
|
|
|
// through pbuffer
|
|
|
|
// through pbuffer
|
|
|
|
String[] choices = new String[]{resourceBundle.getString("antialias.disabled"), "2x", "4x", "6x", "8x", "16x"}; |
|
|
|
String[] choices = new String[]{resourceBundle.getString("antialias.disabled"), "2x", "4x", "6x", "8x", "16x"}; |
|
|
|
antialiasCombo.setModel(new DefaultComboBoxModel(choices)); |
|
|
|
antialiasCombo.setModel(new DefaultComboBoxModel<>(choices)); |
|
|
|
antialiasCombo.setSelectedItem(choices[Math.min(source.getSamples()/2,5)]); |
|
|
|
antialiasCombo.setSelectedItem(choices[Math.min(source.getSamples()/2,5)]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|