use of com.biglybt.ui.swt.debug.ObfuscateTab in project BiglyBT by BiglySoftware.
the class TabbedEntry method obfuscatedImage.
// @see com.biglybt.ui.swt.debug.ObfuscateImage#obfuscatedImage(org.eclipse.swt.graphics.Image)
@Override
public Image obfuscatedImage(Image image) {
Rectangle bounds = swtItem == null ? null : swtItem.getBounds();
if (bounds != null) {
boolean isActive = swtItem.getParent().getSelection() == swtItem;
boolean isHeaderVisible = swtItem.isShowing();
Point location = Utils.getLocationRelativeToShell(swtItem.getParent());
bounds.x += location.x;
bounds.y += location.y;
Map<String, Object> map = new HashMap<>();
map.put("image", image);
map.put("obfuscateTitle", false);
if (isActive) {
triggerEvent(UISWTViewEvent.TYPE_OBFUSCATE, map);
if (viewTitleInfo instanceof ObfuscateImage) {
((ObfuscateImage) viewTitleInfo).obfuscatedImage(image);
}
}
if (isHeaderVisible) {
if (viewTitleInfo instanceof ObfuscateTab) {
String header = ((ObfuscateTab) viewTitleInfo).getObfuscatedHeader();
if (header != null) {
UIDebugGenerator.obfuscateArea(image, bounds, header);
}
}
if (MapUtils.getMapBoolean(map, "obfuscateTitle", false)) {
UIDebugGenerator.obfuscateArea(image, bounds);
}
}
}
return image;
}
Aggregations