@Override
  public void doShow() {
    if (!isHidden) {
      return;
    }
    this.getElement().getStyle().setOpacity(0);
    setPopupPosition(336, 88);

    NMorphStyle eff = CUtil.opacityEffect(this.getElement(), null, 0, 100);
    eff.play();

    isHidden = false;
  }
  @Override
  public void doHide() {
    if (isHidden) {
      return;
    }
    NMorphStyle eff = CUtil.opacityEffect(this.getElement(), null, 100, 0);
    eff.addEffectCompletedHandler(
        new EffectCompletedHandler() {
          @Override
          public void onEffectCompleted(EffectCompletedEvent event) {
            setPopupPosition(1025, 0);
          }
        });
    eff.play();

    isHidden = true;
  }
Exemplo n.º 3
0
 protected void setUpEffect(final Command command) {
   if (thePanel != null) thePanel.getElement().getStyle().setProperty("overflow", "hidden");
   // Need to call set up first, so that the panel gets hidden before being displayed
   // Dimensions are set up in Deferred Command below, which might take longer to execute than
   // the control back in the NEffect which displays the widget.  BY setting the initial effect to
   // large values in the constructor, we can then immediately hide this panel by position, then
   // the
   // deferred command can do its work and place it where needed for sliding in.
   super.setUpEffect();
   DeferredCommand.addCommand(
       new Command() {
         public void execute() {
           height = effectElements.get(0).getOffsetHeight();
           width = effectElements.get(0).getOffsetWidth();
           command.execute();
           setNewStartStyle(new Rule(newEnd));
         }
       });
   // This change listener will allow the panel to be visible outside of bounding box (for example
   // we would like this on the elastic transition physics so that once the effect is greater than
   // 1.0
   // we display, and below 1.0 we hide overshots.
   // However, since this is only really applicable to the elastic transition physics and would
   // carry an overhead
   // for others, we allow a boolean to indicate if available or not.
   if ((displayOutsideBounds) && (thePanel != null)) {
     this.addEffectSteppingHandler(
         new EffectSteppingHandler() {
           public void onEffectStep(EffectSteppingEvent handler) {
             if (getProgressInterpolated() > 1)
               thePanel.getElement().getStyle().setProperty("overflow", "visible");
             else thePanel.getElement().getStyle().setProperty("overflow", "hidden");
           }
         });
   }
 }
Exemplo n.º 4
0
 public void addEffectElement(Element el) {
   super.addEffectElement(el);
   effectElement = effectElements.get(0);
 }
Exemplo n.º 5
0
 public void setNewStartStyle(Rule start) {
   registerProperties(start, theEnd, null, null);
   theStart = start;
   super.setUpEffect();
 }