Java Code Examples for org.jdesktop.animation.timing.Animator#setStartDelay()

The following examples show how to use org.jdesktop.animation.timing.Animator#setStartDelay() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Stacker.java    From littleluck with Apache License 2.0 6 votes vote down vote up
/**
 * Fades out and removes the current message component
 */
public void hideMessageLayer() {
    if (messageLayer != null && messageLayer.isShowing()) {
        Animator animator = new Animator(500,
                new PropertySetter(messageAlpha, "alpha", messageAlpha.getAlpha(), 0.0f) {
                    public void end() {
                        remove(messageLayer);
                        revalidate();
                    }
                });
        animator.setStartDelay(300);
        animator.setAcceleration(.2f);
        animator.setDeceleration(.5f);
        animator.start();
    }
}
 
Example 2
Source File: AnimatingSplitPane.java    From littleluck with Apache License 2.0 6 votes vote down vote up
public void setExpanded(boolean expanded) {
    if (expanded != firstExpanded) {
        
        if (!firstExpanded) {
            lastDividerLocation = getDividerLocation();
        }
        
        this.firstExpanded = expanded;

        Animator animator = new Animator(500, new PropertySetter(this, "dividerLocation",
               getDividerLocation(), (expanded? getHeight() : lastDividerLocation)));
        
        animator.setStartDelay(10);
        animator.setAcceleration(.2f);
        animator.setDeceleration(.3f);
        animator.start();            
    }
}
 
Example 3
Source File: Stacker.java    From beautyeye with Apache License 2.0 6 votes vote down vote up
/**
 * Fades out and removes the current message component
 */
public void hideMessageLayer() {
    if (messageLayer != null && messageLayer.isShowing()) {
        Animator animator = new Animator(500,
                new PropertySetter(messageAlpha, "alpha", messageAlpha.getAlpha(), 0.0f) {
                    public void end() {
                        remove(messageLayer);
                        revalidate();
                    }
                });
        animator.setStartDelay(300);
        animator.setAcceleration(.2f);
        animator.setDeceleration(.5f);
        animator.start();
    }
}
 
Example 4
Source File: AnimatingSplitPane.java    From beautyeye with Apache License 2.0 6 votes vote down vote up
public void setExpanded(boolean expanded) {
    if (expanded != firstExpanded) {
        
        if (!firstExpanded) {
            lastDividerLocation = getDividerLocation();
        }
        
        this.firstExpanded = expanded;

        Animator animator = new Animator(500, new PropertySetter(this, "dividerLocation",
               getDividerLocation(), (expanded? getHeight() : lastDividerLocation)));
        
        animator.setStartDelay(10);
        animator.setAcceleration(.2f);
        animator.setDeceleration(.3f);
        animator.start();            
    }
}
 
Example 5
Source File: Stacker.java    From Darcula with Apache License 2.0 6 votes vote down vote up
/**
 * Fades out and removes the current message component
 */
public void hideMessageLayer() {
    if (messageLayer != null && messageLayer.isShowing()) {
        Animator animator = new Animator(500,
                new PropertySetter(messageAlpha, "alpha", messageAlpha.getAlpha(), 0.0f) {
                    public void end() {
                        remove(messageLayer);
                        revalidate();
                    }
                });
        animator.setStartDelay(300);
        animator.setAcceleration(.2f);
        animator.setDeceleration(.5f);
        animator.start();
    }
}
 
Example 6
Source File: AnimatingSplitPane.java    From Darcula with Apache License 2.0 6 votes vote down vote up
public void setExpanded(boolean expanded) {
    if (expanded != firstExpanded) {
        
        if (!firstExpanded) {
            lastDividerLocation = getDividerLocation();
        }
        
        this.firstExpanded = expanded;

        Animator animator = new Animator(500, new PropertySetter(this, "dividerLocation",
               getDividerLocation(), (expanded? getHeight() : lastDividerLocation)));
        
        animator.setStartDelay(10);
        animator.setAcceleration(.2f);
        animator.setDeceleration(.3f);
        animator.start();            
    }
}
 
Example 7
Source File: DemoPanel.java    From littleluck with Apache License 2.0 5 votes vote down vote up
public LoadAnimationPanel() {
    super(10);
    setBorder(roundedBorder);
    setBackground(Utilities.deriveColorHSB(
            UIManager.getColor("Panel.background"), 0, 0, -.06f));

    // remind(aim): get from resource map
    message = "demo loading";

    PropertySetter rotator = new PropertySetter(this, "triState", 0, 3);
    animator = new Animator(500, Animator.INFINITE,
            Animator.RepeatBehavior.LOOP, rotator);
    // Don't animate gears if loading is quick
    animator.setStartDelay(200);
}
 
Example 8
Source File: IntroPanel.java    From littleluck with Apache License 2.0 5 votes vote down vote up
public void slideTextIn() {
    Animator animator = new Animator(800, 
            new PropertySetter(introText, "x", getWidth(), 30));
    animator.setStartDelay(800);
    animator.setAcceleration(.2f);
    animator.setDeceleration(.5f);
    animator.start();
}
 
Example 9
Source File: IntroPanel.java    From littleluck with Apache License 2.0 5 votes vote down vote up
public void slideTextOut() {
    Animator animator = new Animator(600, 
            new PropertySetter(introText, "x", introText.getX(), -introText.getWidth()));
    animator.setStartDelay(10);
    animator.setAcceleration(.5f);
    animator.setDeceleration(.2f);
    animator.start();        
}
 
Example 10
Source File: DemoPanel.java    From beautyeye with Apache License 2.0 5 votes vote down vote up
public LoadAnimationPanel() {
    super(10);
    setBorder(roundedBorder);
    setBackground(Utilities.deriveColorHSB(
            UIManager.getColor("Panel.background"), 0, 0, -.06f));

    // remind(aim): get from resource map
    message = "demo loading";

    PropertySetter rotator = new PropertySetter(this, "triState", 0, 3);
    animator = new Animator(500, Animator.INFINITE,
            Animator.RepeatBehavior.LOOP, rotator);
    // Don't animate gears if loading is quick
    animator.setStartDelay(200);
}
 
Example 11
Source File: IntroPanel.java    From beautyeye with Apache License 2.0 5 votes vote down vote up
public void slideTextIn() {
    Animator animator = new Animator(800, 
            new PropertySetter(introText, "x", getWidth(), 30));
    animator.setStartDelay(800);
    animator.setAcceleration(.2f);
    animator.setDeceleration(.5f);
    animator.start();
}
 
Example 12
Source File: IntroPanel.java    From beautyeye with Apache License 2.0 5 votes vote down vote up
public void slideTextOut() {
    Animator animator = new Animator(600, 
            new PropertySetter(introText, "x", introText.getX(), -introText.getWidth()));
    animator.setStartDelay(10);
    animator.setAcceleration(.5f);
    animator.setDeceleration(.2f);
    animator.start();        
}
 
Example 13
Source File: SplineInterpolatorTest.java    From filthy-rich-clients with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
public static void main(String args[]) {
    Animator animator = 
            new Animator(DURATION, new SplineInterpolatorTest());
    SplineInterpolator interpolator = new SplineInterpolator(1f, 0f, 0f, 1f);
    animator.setInterpolator(interpolator);
    // Note that you could get similar behavior by setting the following
    // acceleration/deceleration properties instead of the interpolator
    // above:
    //animator.setAcceleration(.5f);
    //animator.setDeceleration(.5f);
    animator.setStartDelay(1000);
    animator.setResolution(DURATION / 10);
    animator.start();
}
 
Example 14
Source File: DemoPanel.java    From Darcula with Apache License 2.0 5 votes vote down vote up
public LoadAnimationPanel() {
    super(10);
    setBorder(roundedBorder);
    setBackground(Utilities.deriveColorHSB(
            UIManager.getColor("Panel.background"), 0, 0, -.06f));

    // remind(aim): get from resource map
    message = "demo loading";

    PropertySetter rotator = new PropertySetter(this, "triState", 0, 3);
    animator = new Animator(500, Animator.INFINITE,
            Animator.RepeatBehavior.LOOP, rotator);
    // Don't animate gears if loading is quick
    animator.setStartDelay(200);
}
 
Example 15
Source File: IntroPanel.java    From Darcula with Apache License 2.0 5 votes vote down vote up
public void slideTextIn() {
    Animator animator = new Animator(800, 
            new PropertySetter(introText, "x", getWidth(), 30));
    animator.setStartDelay(800);
    animator.setAcceleration(.2f);
    animator.setDeceleration(.5f);
    animator.start();
}
 
Example 16
Source File: IntroPanel.java    From Darcula with Apache License 2.0 5 votes vote down vote up
public void slideTextOut() {
    Animator animator = new Animator(600, 
            new PropertySetter(introText, "x", introText.getX(), -introText.getWidth()));
    animator.setStartDelay(10);
    animator.setAcceleration(.5f);
    animator.setDeceleration(.2f);
    animator.start();        
}