From 69b88053e4f2e77478422ebdb33c2e5d907bc4b1 Mon Sep 17 00:00:00 2001 From: nathan Date: Sat, 8 Jul 2017 23:57:06 +0200 Subject: [PATCH] Code polish --- src/dorkbox/util/FontUtil.java | 1 + src/dorkbox/util/SwingUtil.java | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/dorkbox/util/FontUtil.java b/src/dorkbox/util/FontUtil.java index e275ff5..26fa2e2 100644 --- a/src/dorkbox/util/FontUtil.java +++ b/src/dorkbox/util/FontUtil.java @@ -34,6 +34,7 @@ import java.util.Enumeration; /** * Java Font utilities */ +@SuppressWarnings("unused") public class FontUtil { /** Default location where all the fonts are stored */ diff --git a/src/dorkbox/util/SwingUtil.java b/src/dorkbox/util/SwingUtil.java index 8512979..fcba998 100644 --- a/src/dorkbox/util/SwingUtil.java +++ b/src/dorkbox/util/SwingUtil.java @@ -45,6 +45,7 @@ import javax.swing.JOptionPane; import javax.swing.SwingUtilities; import javax.swing.UIManager; +@SuppressWarnings("unused") public class SwingUtil { static { @@ -67,7 +68,11 @@ class SwingUtil { */ public static void setLookAndFeel(final Class lookAndFeel) { - setLookAndFeel(lookAndFeel.getName()); + if (lookAndFeel == null) { + setLookAndFeelByName(null); + } else { + setLookAndFeelByName(lookAndFeel.getName()); + } } @@ -81,7 +86,7 @@ class SwingUtil { * @param lookAndFeel the simple name or null for the system default */ public static - void setLookAndFeel(final String lookAndFeel) { + void setLookAndFeelByName(final String lookAndFeel) { if (lookAndFeel == null) { try { // NOTE: On Linux + swing if the SystemLookAndFeel is the GtkLookAndFeel, this will cause GTK2 to get loaded first, which @@ -238,7 +243,7 @@ class SwingUtil { int height = (int) button.getPreferredSize() .getHeight(); -// System.out.println(imageIcon.getIconHeight() + "x" + imageIcon.getIconHeight() + " icon \t>>>>>>>>> " + height + "px tall item"); + // System.err.println(imageIcon.getIconHeight() + "x" + imageIcon.getIconHeight() + " icon \t>>>>>>>>> " + height + "px tall item") if (minHeight == 0) { minHeight = height;