Package edu.umd.cs.piccolo.activities

Examples of edu.umd.cs.piccolo.activities.PActivity


  public void fadeAndDestroy() {
    if (isDestroyed()) {
      return;
    }

    PActivity fadeOutActivity = new Fader(this, 100, 0);
    if (fadeInActivity != null) {

      if ((fadeInActivity.getStartTime() + fadeInActivity.getDuration()) > System
          .currentTimeMillis())
        fadeOutActivity.startAfter(fadeInActivity);

    }
    if (fadeInPhase2Activity != null) {
      fadeInPhase2Activity.terminate(PActivity.TERMINATE_WITHOUT_FINISHING);
    }

    UIEnvironment.getInstance().addActivity(fadeOutActivity);

    PActivity destroyActivity = new PActivity(0) {

      @Override
      protected void activityStarted() {
        TooltipWrapper.this.destroy();
      }

    };

    UIEnvironment.getInstance().addActivity(destroyActivity);
    destroyActivity.startAfter(fadeOutActivity);

  }
View Full Code Here


  public void popup(long delayMS) {
    long startTime = System.currentTimeMillis() + delayMS;
    this.setVisible(false);

    PActivity showPopupActivity = new PActivity(0) {

      @Override
      protected void activityFinished() {
        TransientMessage.this.setVisible(true);
        Point2D startingOffset = getOffset();
        animateToPositionScaleRotation(startingOffset.getX(),
            startingOffset.getY() - 50, 1, 0, ANIMATE_MSG_DURATION);

        PActivity fadeOutActivity = new Fader(TransientMessage.this,
            ANIMATE_MSG_DURATION, 0f);
        UIEnvironment.getInstance().addActivity(fadeOutActivity);

        PActivity removeActivity = new PActivity(0) {

          @Override
          protected void activityStarted() {
            TransientMessage.this.removeFromParent();
          }

        };
        removeActivity.startAfter(fadeOutActivity);
        UIEnvironment.getInstance().addActivity(removeActivity);
      }
    };
    showPopupActivity.setStartTime(startTime);
    UIEnvironment.getInstance().addActivity(showPopupActivity);
View Full Code Here

TOP

Related Classes of edu.umd.cs.piccolo.activities.PActivity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.