mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 14:37:13 -06:00
use LoggingFacade instead of printStackTrace() in flatlaf-extras and flatlaf-demo
This commit is contained in:
@@ -42,6 +42,7 @@ import com.formdev.flatlaf.FlatLaf.DisabledIconProvider;
|
||||
import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||
import com.formdev.flatlaf.util.Graphics2DProxy;
|
||||
import com.formdev.flatlaf.util.GrayFilter;
|
||||
import com.formdev.flatlaf.util.LoggingFacade;
|
||||
import com.formdev.flatlaf.util.MultiResolutionImageSupport;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
import com.kitfox.svg.SVGDiagram;
|
||||
@@ -335,7 +336,7 @@ public class FlatSVGIcon
|
||||
try {
|
||||
diagram = svgUniverse.getDiagram( url.toURI() );
|
||||
} catch( URISyntaxException ex ) {
|
||||
ex.printStackTrace();
|
||||
LoggingFacade.INSTANCE.logSevere( "FlatLaf: Failed to load SVG icon '" + url + "'.", ex );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ import com.formdev.flatlaf.ui.FlatUIUtils;
|
||||
import com.formdev.flatlaf.util.DerivedColor;
|
||||
import com.formdev.flatlaf.util.GrayFilter;
|
||||
import com.formdev.flatlaf.util.HSLColor;
|
||||
import com.formdev.flatlaf.util.LoggingFacade;
|
||||
import com.formdev.flatlaf.util.ScaledEmptyBorder;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
|
||||
@@ -377,11 +378,12 @@ public class FlatUIDefaultsInspector
|
||||
}
|
||||
|
||||
private Properties loadDerivedColorKeys() {
|
||||
String name = "/com/formdev/flatlaf/extras/resources/DerivedColorKeys.properties";
|
||||
Properties properties = new Properties();
|
||||
try( InputStream in = getClass().getResourceAsStream( "/com/formdev/flatlaf/extras/resources/DerivedColorKeys.properties" ) ) {
|
||||
try( InputStream in = getClass().getResourceAsStream( name ) ) {
|
||||
properties.load( in );
|
||||
} catch( IOException ex ) {
|
||||
ex.printStackTrace();
|
||||
LoggingFacade.INSTANCE.logSevere( "FlatLaf: Failed to load '" + name + "'.", ex );
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import java.awt.Color;
|
||||
import java.awt.Insets;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.UIManager;
|
||||
import com.formdev.flatlaf.util.LoggingFacade;
|
||||
|
||||
/**
|
||||
* Base interface for all FlatLaf component extensions.
|
||||
@@ -87,7 +88,7 @@ public interface FlatComponentExtension
|
||||
try {
|
||||
return Enum.valueOf( enumType, (String) value );
|
||||
} catch( IllegalArgumentException ex ) {
|
||||
ex.printStackTrace();
|
||||
LoggingFacade.INSTANCE.logSevere( "FlatLaf: Unknown enum value '" + value + "' in enum '" + enumType.getName() + "'.", ex );
|
||||
}
|
||||
}
|
||||
return defaultValue;
|
||||
|
||||
Reference in New Issue
Block a user