Search in sources :

Example 1 with ObfuscateTab

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;
}
Also used : HashMap(java.util.HashMap) ObfuscateTab(com.biglybt.ui.swt.debug.ObfuscateTab) Rectangle(org.eclipse.swt.graphics.Rectangle) ObfuscateImage(com.biglybt.ui.swt.debug.ObfuscateImage) SWTSkinObject(com.biglybt.ui.swt.skin.SWTSkinObject) Point(org.eclipse.swt.graphics.Point)

Aggregations

ObfuscateImage (com.biglybt.ui.swt.debug.ObfuscateImage)1 ObfuscateTab (com.biglybt.ui.swt.debug.ObfuscateTab)1 SWTSkinObject (com.biglybt.ui.swt.skin.SWTSkinObject)1 HashMap (java.util.HashMap)1 Point (org.eclipse.swt.graphics.Point)1 Rectangle (org.eclipse.swt.graphics.Rectangle)1