Package org.jdesktop.animation.timing

Examples of org.jdesktop.animation.timing.Animator.addTarget()


      label.setMinimumSize(dim);
      label.setMaximumSize(dim);
      label.setVisible(false);
    Animator anim = PropertySetter.createAnimator(2500, label, "location",
            from, to);
    anim.addTarget(new TimingTarget(){
      @Override
      public void begin() {
        label.setVisible(true);
      }
     
View Full Code Here


  public final void cast(final Component component, Point from, Point to,
      final Container container, final boolean toEnemy) {
    Animator anim = PropertySetter.createAnimator(2000, component, "location",
        from, to);
    anim.addTarget(new TimingTarget() {

      @Override
      public void timingEvent(float fraction) {
        // not needed
      }
View Full Code Here

    }
   
    private void animateTransition(boolean visible) {
        Animator animator = createAnimator();
        if (visible) {
            animator.addTarget(new TimingTargetAdapter() {

                @Override
                public void timingEvent(float fraction) {
                    currentAlpha = (int) (alpha * fraction);
                    repaint();
View Full Code Here

                    currentAlpha = alpha;
                }
            });
        } else {
            final int alphaStart = currentAlpha;
            animator.addTarget(new TimingTargetAdapter() {

                @Override
                public void timingEvent(float fraction) {
                    int diff = (int) (fraction * alphaStart);
                    currentAlpha = alphaStart - diff;
View Full Code Here

    private Animator createAnimator(boolean isShow) {
        TimingTargetAdapter behavior = isShow ? new ShowAnimation() : new HideAnimation();
        Animator a = new Animator(duration, behavior);
        if (externalTarget != null) {
            a.addTarget(externalTarget);
        }
        a.setAcceleration(acceleration);
        a.setDeceleration(deceleration);
        return a;
    }
View Full Code Here

        final int currentLocation = getDividerLocation();
        Animator animator = new Animator(250);
        animator.setResolution(15);
        animator.setAcceleration(0.3f);
        animator.setDeceleration(0.2f);
        animator.addTarget(new PropertySetter(this, "dividerLocation", Integer.valueOf(location)));
        animator.addTarget(new TimingTargetAdapter() {

            @Override
            public void end() {
                animating = false;
View Full Code Here

        Animator animator = new Animator(250);
        animator.setResolution(15);
        animator.setAcceleration(0.3f);
        animator.setDeceleration(0.2f);
        animator.addTarget(new PropertySetter(this, "dividerLocation", Integer.valueOf(location)));
        animator.addTarget(new TimingTargetAdapter() {

            @Override
            public void end() {
                animating = false;
                isProcessingOneTouch = false;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.