当前位置: 首页>>代码示例>>Java>>正文


Java Animator.start方法代码示例

本文整理汇总了Java中org.jdesktop.animation.timing.Animator.start方法的典型用法代码示例。如果您正苦于以下问题:Java Animator.start方法的具体用法?Java Animator.start怎么用?Java Animator.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jdesktop.animation.timing.Animator的用法示例。


在下文中一共展示了Animator.start方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: hideMessageLayer

import org.jdesktop.animation.timing.Animator; //导入方法依赖的package包/类
/**
 * 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();
    }
}
 
开发者ID:freeseawind,项目名称:littleluck,代码行数:19,代码来源:Stacker.java

示例2: setExpanded

import org.jdesktop.animation.timing.Animator; //导入方法依赖的package包/类
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();            
    }
}
 
开发者ID:freeseawind,项目名称:littleluck,代码行数:19,代码来源:AnimatingSplitPane.java

示例3: buildPulsatingField

import org.jdesktop.animation.timing.Animator; //导入方法依赖的package包/类
private JComponent buildPulsatingField() {
    JTextField field = new JTextField(20);
    
    PulsatingBorder border = new PulsatingBorder(field);
    field.setBorder(new CompoundBorder(field.getBorder(), border));
    
    PropertySetter setter = new PropertySetter(
            border, "thickness", 0.0f, 1.0f);
    Animator animator = new Animator(900, Animator.INFINITE,
            Animator.RepeatBehavior.REVERSE, setter);
    animator.start();
    
    JPanel panel = new JPanel(new FlowLayout());
    panel.add(field);
    panel.add(new JButton("OK"));
    panel.add(new JButton("Cancel"));
    return panel;
}
 
开发者ID:romainguy,项目名称:filthy-rich-clients,代码行数:19,代码来源:PulseFieldDemo.java

示例4: setTextAndAnimate

import org.jdesktop.animation.timing.Animator; //导入方法依赖的package包/类
public static void setTextAndAnimate(final JTextComponent textComponent,
        final String text) {
   Color c = textComponent.getForeground();

   KeyFrames keyFrames = new KeyFrames(KeyValues.create(
               new Color(c.getRed(), c.getGreen(), c.getBlue(), 255),
               new Color(c.getRed(), c.getGreen(), c.getBlue(), 0),
               new Color(c.getRed(), c.getGreen(), c.getBlue(), 255)
           ));
   PropertySetter setter = new PropertySetter(textComponent, "foreground",
           keyFrames);

   Animator animator = new Animator(200, setter);
   animator.addTarget(new TimingTargetAdapter() {
       private boolean textSet = false;

       public void timingEvent(float fraction) {
           if (fraction >= 0.5f && !textSet) {
               textComponent.setText(text);
               textSet = true;
           }
       } 
   });
   animator.start();
}
 
开发者ID:romainguy,项目名称:filthy-rich-clients,代码行数:26,代码来源:FadingDemo.java

示例5: setExpanded

import org.jdesktop.animation.timing.Animator; //导入方法依赖的package包/类
public void setExpanded(boolean expanded) {
    if (expanded != this.firstExpanded) {
        if (!this.firstExpanded) {
            this.lastDividerLocation = getDividerLocation();
        }

        this.firstExpanded = expanded;

        Animator animator = new Animator(500,
                new PropertySetter(this, "dividerLocation",
                        new Integer[]{
                                getDividerLocation(),
                                expanded ? getHeight() : this.lastDividerLocation
                        }));

        animator.setStartDelay(10);
        animator.setAcceleration(0.2F);
        animator.setDeceleration(0.3F);
        animator.start();
    }
}
 
开发者ID:Jakegogo,项目名称:concurrent,代码行数:22,代码来源:AnimatingSplitPane.java

示例6: animate

import org.jdesktop.animation.timing.Animator; //导入方法依赖的package包/类
/**
 * Performs the animation itself based on the parameters provided in the
 * constructor method. Keep in mind this method is synchronized. Check
 * the following example:
 * @code
 * JWindow window = new JWindow();
 * Notification note = new Notification(window, WindowPosition.BOTTOMRIGHT, 25, 25, 1000);
 * note.animate();
 * @endcode
 * Wherever possible, please use the new notification queue manager
 * <b>net.sf.jcarrierpigeon.NotificationQueue</b>.
 */
public synchronized void animate() {

    // set the animation state
    animationFrame = AnimationFrame.ONSHOW;

    // define some window properties
    setCurrentWindowAlwaysOnTop(true);
    setCurrentWindowVisible(true);

    // defines the animator handler from Timing Framework
    // first animator handler
    animatorHandlerOnShow = new Animator(timeToAnimate, 1, Animator.RepeatBehavior.LOOP, this);

    // start animation
    animatorHandlerOnShow.start();
}
 
开发者ID:mediathekview,项目名称:MediathekView,代码行数:29,代码来源:Notification.java

示例7: DemoPanel

import org.jdesktop.animation.timing.Animator; //导入方法依赖的package包/类
public DemoPanel(Demo demo) {
    this.demo = demo;
    setLayout(new BorderLayout());
    // remind(aim): how to access resourceMap?
    //resourceMap = getContext().getResourceMap();

    LoadAnimationPanel loadAnimationPanel = new LoadAnimationPanel();

    add(loadAnimationPanel);
    loadAnimationPanel.setAnimating(true);

    LoadedDemoPanel demoPanel = new LoadedDemoPanel(demo);

    try {
        loadAnimationPanel.setAnimating(false);
        Animator fadeOutAnimator = new Animator(400,
                new FadeOut(DemoPanel.this,
                        loadAnimationPanel, demoPanel));
        fadeOutAnimator.setAcceleration(.2f);
        fadeOutAnimator.setDeceleration(.3f);
        Animator fadeInAnimator = new Animator(400,
                new PropertySetter(DemoPanel.this, "alpha", 0.3f, 1.0f));
        TimingTrigger.addTrigger(fadeOutAnimator, fadeInAnimator, TimingTriggerEvent.STOP);
        fadeOutAnimator.start();
    } catch (Exception ignore) {
        System.err.println(ignore);
        ignore.printStackTrace();
    }
}
 
开发者ID:freeseawind,项目名称:littleluck,代码行数:30,代码来源:DemoPanel.java

示例8: slideTextIn

import org.jdesktop.animation.timing.Animator; //导入方法依赖的package包/类
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();
}
 
开发者ID:freeseawind,项目名称:littleluck,代码行数:9,代码来源:IntroPanel.java

示例9: slideTextOut

import org.jdesktop.animation.timing.Animator; //导入方法依赖的package包/类
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();        
}
 
开发者ID:freeseawind,项目名称:littleluck,代码行数:9,代码来源:IntroPanel.java

示例10: slideTextIn

import org.jdesktop.animation.timing.Animator; //导入方法依赖的package包/类
@Action
public void slideTextIn() {
    Animator animator = new Animator(800, 
            new PropertySetter(textImagePainter, "x", getWidth(), 30));
    animator.setStartDelay(800);
    animator.setAcceleration(.2f);
    animator.setDeceleration(.5f);
    animator.start();
    // </snip>
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:11,代码来源:IntroPanelDemo.java

示例11: slideTextOut

import org.jdesktop.animation.timing.Animator; //导入方法依赖的package包/类
public void slideTextOut() {
    Animator animator = new Animator(600, 
            new PropertySetter(textImagePainter, "x", textImagePainter.getX(), -getWidth()));
    animator.setStartDelay(10);
    animator.setAcceleration(.5f);
    animator.setDeceleration(.2f);
    animator.start();        
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:9,代码来源:IntroPanelDemo.java

示例12: main

import org.jdesktop.animation.timing.Animator; //导入方法依赖的package包/类
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();
}
 
开发者ID:romainguy,项目名称:filthy-rich-clients,代码行数:15,代码来源:SplineInterpolatorTest.java

示例13: next

import org.jdesktop.animation.timing.Animator; //导入方法依赖的package包/类
public void next() {
    Animator animator = new Animator(500);
    animator.addTarget(new PropertySetter(this, "alpha", 1.0f));
    animator.setAcceleration(0.2f);
    animator.setDeceleration(0.4f);
    animator.start();
}
 
开发者ID:romainguy,项目名称:filthy-rich-clients,代码行数:8,代码来源:MorphingDemo.java

示例14: previous

import org.jdesktop.animation.timing.Animator; //导入方法依赖的package包/类
public void previous() {
    Animator animator = new Animator(500);
    animator.addTarget(new PropertySetter(this, "alpha", 0.0f));
    animator.setAcceleration(0.2f);
    animator.setDeceleration(0.4f);
    animator.start();
}
 
开发者ID:romainguy,项目名称:filthy-rich-clients,代码行数:8,代码来源:MorphingDemo.java

示例15: next

import org.jdesktop.animation.timing.Animator; //导入方法依赖的package包/类
public void next() {
    Animator animator = new Animator(1000);
    animator.addTarget(new PropertySetter(this, "alpha", 1.0f));
    animator.setAcceleration(0.2f);
    animator.setDeceleration(0.4f);
    animator.start();
}
 
开发者ID:romainguy,项目名称:filthy-rich-clients,代码行数:8,代码来源:FadingDemo.java


注:本文中的org.jdesktop.animation.timing.Animator.start方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。