@Override protected void onStart() { offsetHeight = curPanel.getOffsetHeight(); offsetWidth = curPanel.getOffsetWidth(); curPanel.getElement().getStyle().setProperty("overflow", "hidden"); super.onStart(); }
// Fade out the "Loading application" pop-up private void hideLoadingPopup() { final Element e = RootPanel.get("loading").getElement(); Animation r = new Animation() { @Override protected void onUpdate(double progress) { e.getStyle().setOpacity(1.0 - progress); } @Override protected void onComplete() { e.getStyle().setVisibility(Visibility.HIDDEN); } }; r.run(500); }
///////////////////////////////////////////////////////////////////////////////////////// // METHODS ///////////////////////////////////////////////////////////////////////////////////////// public void fade(final int duration, final double targetOpacity) { double theTargetOpacity = 0.0; if (targetOpacity > 1.0) { theTargetOpacity = 1.0; } else if (targetOpacity < 0.0) { theTargetOpacity = 0.0; } else { theTargetOpacity = targetOpacity; } _targetOpacity = theTargetOpacity; String opacityStr = _element.getStyle().getOpacity(); try { _baseOpacity = new BigDecimal(opacityStr).doubleValue(); _opacityIncrement = targetOpacity - _baseOpacity; super.run(duration); } catch (NumberFormatException nfEx) { this.onComplete(); // set opacity directly } }
@Override protected void onComplete() { super.onComplete(); _element.getStyle().setOpacity(_targetOpacity); }
@Override protected void onStart() { super.onStart(); startButton.setEnabled(false); cancelButton.setEnabled(true); }
@Override public void cancel() { isCancelled = true; super.cancel(); }