List of usage examples for com.google.gwt.dom.client Style getOpacity
public String getOpacity()
From source file:com.dom_distiller.client.DomUtil.java
License:Open Source License
public static boolean isVisible(Element e) { Style style = getComputedStyle(e); float opacity = 1.0F; try {/*from w w w . java 2 s . c o m*/ opacity = Float.parseFloat(style.getOpacity()); } catch (NumberFormatException exception) { } return !(style.getDisplay().equals("none") || style.getVisibility().equals("hidden") || opacity == 0.0F); }
From source file:com.dom_distiller.client.FilteringDomVisitor.java
License:Open Source License
private static void logVisibilityInfo(Element e, boolean visible) { if (!LogUtil.isLoggable(LogUtil.DEBUG_LEVEL_VISIBILITY_INFO)) return;/*from w w w. j av a2s . co m*/ Style style = DomUtil.getComputedStyle(e); LogUtil.logToConsole((visible ? "KEEP " : "SKIP ") + e.getTagName() + ": id=" + e.getId() + ", dsp=" + style.getDisplay() + ", vis=" + style.getVisibility() + ", opaq=" + style.getOpacity()); }
From source file:info.magnolia.ui.vaadin.gwt.client.magnoliashell.viewport.ShellAppsTransitionDelegate.java
License:Open Source License
private void initAnimations() { this.fadeInAnimation = new FadeAnimation(ALPHA_MAX, false) { @Override/*from w w w . j ava 2 s . c o m*/ protected void onStart() { super.onStart(); Style style = getCurrentElement().getStyle(); String currentOpacity = style.getOpacity(); if (currentOpacity == null || currentOpacity.isEmpty()) { style.setOpacity(0d); } style.clearDisplay(); } }; this.fadeInAnimation.addCallback(new JQueryCallback() { @Override public void execute(JQueryWrapper query) { viewport.onShellAppLoaded(Util.<Widget>findWidget(query.get(0), null)); } }); this.slideUpAnimation = new SlideAnimation(false); this.slideDownAnimation = new SlideAnimation(false); this.slideDownAnimation.addCallback(new JQueryCallback() { @Override public void execute(JQueryWrapper query) { if (!slideDownAnimation.isCancelled()) { viewport.onShellAppLoaded(viewport.getVisibleChild()); } } }); this.slideUpAnimation.addCallback(new JQueryCallback() { @Override public void execute(JQueryWrapper query) { if (!slideUpAnimation.isCancelled()) { viewport.onShellAppsHidden(); } } }); this.fadeOutAnimation = new FadeAnimation(ALPHA_MIN, false); }
From source file:org.chromium.distiller.DomUtil.java
License:Open Source License
public static boolean isVisible(Element e) { Style style = getComputedStyle(e); double opacity = JavaScript.parseFloat(style.getOpacity()); return !(style.getDisplay().equals("none") || style.getVisibility().equals("hidden") || opacity == 0.0F); }