Browse Source

Add #toString implementation for svg icons.

pull/235/head
weisj 4 years ago
parent
commit
c931ccac75
No known key found for this signature in database
GPG Key ID: 31124CB75461DA2A
  1. 19
      property-loader/src/main/java/com/github/weisj/darklaf/icons/DarkSVGIcon.java
  2. 9
      property-loader/src/main/java/com/github/weisj/darklaf/icons/ThemedSVGIcon.java

19
property-loader/src/main/java/com/github/weisj/darklaf/icons/DarkSVGIcon.java

@ -184,7 +184,7 @@ public class DarkSVGIcon implements DerivableIcon<DarkSVGIcon>, RotateIcon, Seri
double effectiveScaleX = loadedWithExtraScale ? scaleX * extraScale : scaleX;
double effectiveScaleY = loadedWithExtraScale ? scaleY * extraScale : scaleY;
LOGGER.finer(() -> String.format("Creating Image with size (w=%s, h=%s, scaleW=%s, scaleH=%s) for icon '%s'",
getSize().width, getSize().height, effectiveScaleX, effectiveScaleX, icon.getSvgURI().toASCIIString()));
getSize().width, getSize().height, effectiveScaleX, effectiveScaleX, getName(getUri())));
image = createImage(Scale.scale(effectiveScaleX, effectiveScaleY, getSize()));
}
@ -338,4 +338,21 @@ public class DarkSVGIcon implements DerivableIcon<DarkSVGIcon>, RotateIcon, Seri
ensureSVGLoaded();
return icon;
}
@Override
public String toString() {
return "DarkSVGIcon{" +
"loaded=" + loaded +
", iconSize=" + iconSize +
", icon=" + icon +
", uriSupplier=" + uriSupplier +
", uri=" + uri +
", iconKey=" + iconKey +
", directRendering=" + directRendering +
", loadedWithExtraScale=" + loadedWithExtraScale +
", scaleX=" + scaleX +
", scaleY=" + scaleY +
", image=" + image +
'}';
}
}

9
property-loader/src/main/java/com/github/weisj/darklaf/icons/ThemedSVGIcon.java

@ -85,6 +85,15 @@ public class ThemedSVGIcon extends DarkSVGIcon implements ThemedIcon {
return false;
}
@Override
public String toString() {
return "ThemedSVGIcon{" +
"parentState= " + super.toString() +
"currentTheme=" + currentTheme +
", updatedNotDuringPaint=" + updatedNotDuringPaint +
'}';
}
protected void invalidate() {
currentTheme = new Object();
}

Loading…
Cancel
Save