Browse Source

Add info message for when opaque buffering is used.

Fix loglevel selector for demos not working.
pull/188/head
weisj 4 years ago
parent
commit
ecd4727e16
  1. 4
      core/src/main/java/com/github/weisj/darklaf/graphics/StringPainter.java
  2. 1
      core/src/test/java/ui/ComponentDemo.java

4
core/src/main/java/com/github/weisj/darklaf/graphics/StringPainter.java

@ -29,6 +29,7 @@ import java.awt.image.BufferedImage;
import java.awt.image.FilteredImageSource; import java.awt.image.FilteredImageSource;
import java.awt.image.ImageFilter; import java.awt.image.ImageFilter;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.logging.Logger;
import javax.swing.*; import javax.swing.*;
import javax.swing.plaf.basic.BasicHTML; import javax.swing.plaf.basic.BasicHTML;
@ -41,6 +42,8 @@ import com.github.weisj.darklaf.util.*;
public class StringPainter { public class StringPainter {
private static final Logger LOGGER = LogUtil.getLogger(StringPainter.class);
private static boolean translucentAAPaintingEnabled = true; private static boolean translucentAAPaintingEnabled = true;
private static boolean experimentalAntialiasingEnabled = false; private static boolean experimentalAntialiasingEnabled = false;
@ -146,6 +149,7 @@ public class StringPainter {
boolean paintOpaqueBuffered = window != null; boolean paintOpaqueBuffered = window != null;
if (paintOpaqueBuffered) { if (paintOpaqueBuffered) {
LOGGER.fine(() -> "Using opaque buffering for " + c);
double scaleX = Scale.getScaleX((Graphics2D) g); double scaleX = Scale.getScaleX((Graphics2D) g);
double scaleY = Scale.getScaleX((Graphics2D) g); double scaleY = Scale.getScaleX((Graphics2D) g);

1
core/src/test/java/ui/ComponentDemo.java

@ -188,6 +188,7 @@ public interface ComponentDemo {
Level currentLevel = LafManager.getLogLevel(); Level currentLevel = LafManager.getLogLevel();
for (Level level : levels) { for (Level level : levels) {
JRadioButtonMenuItem mi = new JRadioButtonMenuItem(level.getName()); JRadioButtonMenuItem mi = new JRadioButtonMenuItem(level.getName());
mi.addActionListener(e -> LafManager.setLogLevel(level));
bg.add(mi); bg.add(mi);
logging.add(mi); logging.add(mi);
if (level.equals(currentLevel)) { if (level.equals(currentLevel)) {

Loading…
Cancel
Save