Skip to content

Commit

Permalink
Fixed deprecation warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanSweet committed Nov 23, 2022
1 parent 605e636 commit 93e7334
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

/** An OpenGL surface in an applet.
* @author Nathan Sweet */
@SuppressWarnings("removal")
public class LwjglApplet extends Applet {
final Canvas canvas;
LwjglApplication app;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ protected void destroy () {
}
}

@SuppressWarnings("removal")
@Override
protected void finalize () throws Throwable {
if (!destroyed && Bullet.enableLogging)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected void initializeComponents () {
new Insets(0, 0, 0, 6), 0, 0));
}
{
valueSpinner = new JSpinner(new SpinnerNumberModel(new Float(0), new Float(-99999), new Float(99999), new Float(0.1f)));
valueSpinner = new JSpinner(new SpinnerNumberModel(0, -99999, 99999, 0.1f));
contentPanel.add(valueSpinner, new GridBagConstraints(1, 1, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
new Insets(0, 0, 0, 0), 0, 0));
}
Expand Down
26 changes: 12 additions & 14 deletions extensions/gdx-tools/src/com/badlogic/gdx/tools/hiero/Hiero.java
Original file line number Diff line number Diff line change
Expand Up @@ -379,19 +379,19 @@ void open (File file) {

HieroSettings settings = new HieroSettings(file.getAbsolutePath());
fontList.setSelectedValue(settings.getFontName(), true);
fontSizeSpinner.setValue(new Integer(settings.getFontSize()));
fontSizeSpinner.setValue(settings.getFontSize());
boldCheckBox.setSelected(settings.isBold());
italicCheckBox.setSelected(settings.isItalic());
monoCheckBox.setSelected(settings.isMono());
gammaSpinner.setValue(new Float(settings.getGamma()));
padTopSpinner.setValue(new Integer(settings.getPaddingTop()));
padRightSpinner.setValue(new Integer(settings.getPaddingRight()));
padBottomSpinner.setValue(new Integer(settings.getPaddingBottom()));
padLeftSpinner.setValue(new Integer(settings.getPaddingLeft()));
padAdvanceXSpinner.setValue(new Integer(settings.getPaddingAdvanceX()));
padAdvanceYSpinner.setValue(new Integer(settings.getPaddingAdvanceY()));
glyphPageWidthCombo.setSelectedItem(new Integer(settings.getGlyphPageWidth()));
glyphPageHeightCombo.setSelectedItem(new Integer(settings.getGlyphPageHeight()));
gammaSpinner.setValue(settings.getGamma());
padTopSpinner.setValue(settings.getPaddingTop());
padRightSpinner.setValue(settings.getPaddingRight());
padBottomSpinner.setValue(settings.getPaddingBottom());
padLeftSpinner.setValue(settings.getPaddingLeft());
padAdvanceXSpinner.setValue(settings.getPaddingAdvanceX());
padAdvanceYSpinner.setValue(settings.getPaddingAdvanceY());
glyphPageWidthCombo.setSelectedItem(settings.getGlyphPageWidth());
glyphPageHeightCombo.setSelectedItem(settings.getGlyphPageHeight());
if (settings.getRenderType() == RenderType.Native.ordinal())
nativeRadio.setSelected(true);
else if (settings.getRenderType() == RenderType.FreeType.ordinal())
Expand Down Expand Up @@ -918,15 +918,13 @@ public Dimension getPreferredSize () {
GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0));
}
{
glyphPageWidthCombo = new JComboBox(new DefaultComboBoxModel(new Integer[] {new Integer(32), new Integer(64),
new Integer(128), new Integer(256), new Integer(512), new Integer(1024), new Integer(2048)}));
glyphPageWidthCombo = new JComboBox(new DefaultComboBoxModel(new Integer[] {32, 64, 128, 256, 512, 1024, 2048}));
glyphCachePanel.add(glyphPageWidthCombo, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0));
glyphPageWidthCombo.setSelectedIndex(4);
}
{
glyphPageHeightCombo = new JComboBox(new DefaultComboBoxModel(new Integer[] {new Integer(32), new Integer(64),
new Integer(128), new Integer(256), new Integer(512), new Integer(1024), new Integer(2048)}));
glyphPageHeightCombo = new JComboBox(new DefaultComboBoxModel(new Integer[] {32, 64, 128, 256, 512, 1024, 2048}));
glyphCachePanel.add(glyphPageHeightCombo, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
GridBagConstraints.NONE, new Insets(0, 0, 5, 5), 0, 0));
glyphPageHeightCombo.setSelectedIndex(4);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public UnicodeFont (Font font, int size, boolean bold, boolean italic) {

private void initializeFont (Font baseFont, int size, boolean bold, boolean italic) {
Map attributes = baseFont.getAttributes();
attributes.put(TextAttribute.SIZE, new Float(size));
attributes.put(TextAttribute.SIZE, size);
attributes.put(TextAttribute.WEIGHT, bold ? TextAttribute.WEIGHT_BOLD : TextAttribute.WEIGHT_REGULAR);
attributes.put(TextAttribute.POSTURE, italic ? TextAttribute.POSTURE_OBLIQUE : TextAttribute.POSTURE_REGULAR);
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private void initializeComponents () {
new Insets(0, 0, 0, 6), 0, 0));
}
{
valueSpinner = new JSpinner(new SpinnerNumberModel(new Float(0), new Float(-99999), new Float(99999), new Float(0.1f)));
valueSpinner = new JSpinner(new SpinnerNumberModel(0, -99999, 99999, 0.1f));
contentPanel.add(valueSpinner, new GridBagConstraints(1, 1, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE,
new Insets(0, 0, 0, 0), 0, 0));
}
Expand Down
25 changes: 12 additions & 13 deletions gdx/src/com/badlogic/gdx/utils/Json.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,29 @@

package com.badlogic.gdx.utils;

import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.utils.IntSet.IntSetIterator;
import com.badlogic.gdx.utils.JsonValue.PrettyPrintSettings;
import com.badlogic.gdx.utils.JsonWriter.OutputType;
import com.badlogic.gdx.utils.ObjectMap.Entry;
import com.badlogic.gdx.utils.reflect.ArrayReflection;
import com.badlogic.gdx.utils.reflect.ClassReflection;
import com.badlogic.gdx.utils.reflect.Constructor;
import com.badlogic.gdx.utils.reflect.Field;
import com.badlogic.gdx.utils.reflect.ReflectionException;

import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.io.StringWriter;
import java.io.Writer;
import java.security.AccessControlException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.utils.IntSet.IntSetIterator;
import com.badlogic.gdx.utils.JsonValue.PrettyPrintSettings;
import com.badlogic.gdx.utils.JsonWriter.OutputType;
import com.badlogic.gdx.utils.ObjectMap.Entry;
import com.badlogic.gdx.utils.reflect.ArrayReflection;
import com.badlogic.gdx.utils.reflect.ClassReflection;
import com.badlogic.gdx.utils.reflect.Constructor;
import com.badlogic.gdx.utils.reflect.Field;
import com.badlogic.gdx.utils.reflect.ReflectionException;

/** Reads/writes Java objects to/from JSON, automatically. See the wiki for usage:
* https://libgdx.com/wiki/utils/reading-and-writing-json
* @author Nathan Sweet */
Expand Down Expand Up @@ -211,7 +210,7 @@ private OrderedMap<String, FieldMetadata> getFields (Class type) {
if (!field.isAccessible()) {
try {
field.setAccessible(true);
} catch (AccessControlException ex) {
} catch (RuntimeException ex) {
continue;
}
}
Expand Down

0 comments on commit 93e7334

Please sign in to comment.