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


Java PropertySetter类代码示例

本文整理汇总了Java中org.jdesktop.core.animation.timing.PropertySetter的典型用法代码示例。如果您正苦于以下问题:Java PropertySetter类的具体用法?Java PropertySetter怎么用?Java PropertySetter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PropertySetter类属于org.jdesktop.core.animation.timing包,在下文中一共展示了PropertySetter类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: animatedMoveTo

import org.jdesktop.core.animation.timing.PropertySetter; //导入依赖的package包/类
private void animatedMoveTo(Point targetLocation) {
	if (animator != null && animator.isRunning() && animatorTarget != null && animatorTarget.equals(targetLocation)) {
		// animator is already moving the song text to the requested location
		return;
	} else {
		animatorTarget = targetLocation;
	}
	if (animator != null && animator.isRunning()) {
		animator.stop();
		// discard old animator because it takes too long to let it stop completely
		animator = null;
	}
	animator = createAnimator();
	TimingTargetAdapter target = PropertySetter.getTargetTo(text, "location",
		new AccelerationInterpolator(0.5, 0.5), targetLocation);
	animator.addTarget(target);
	animator.start();
}
 
开发者ID:mathisdt,项目名称:sdb2,代码行数:19,代码来源:SongView.java

示例2: setSkin

import org.jdesktop.core.animation.timing.PropertySetter; //导入依赖的package包/类
public void setSkin(BufferedImage skin) {
    previousSkin = this.skin;
    this.skin = MinecraftSkin.getBodySkin(skin);

    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            if (previousSkin != null) {
                TimingSource timer = new SwingTimerTimingSource();
                timer.init();
                Animator skinAnimator = new Animator.Builder(timer)
                        .addTarget(PropertySetter.getTarget(RoundAvatarPanel.this, "avatarDiameter", 0, getWidth() - MaterialShadow.OFFSET_LEFT - MaterialShadow.OFFSET_RIGHT - 10))
                        .addTarget(new TimingTargetAdapter() {
                            @Override
                            public void end(Animator source) {
                                previousSkin = null;
                                repaint();
                            }
                        })
                        .setInterpolator(new SplineInterpolator(0.4, 0, 0.2, 1))
                        .setDuration(250, TimeUnit.MILLISECONDS)
                        .setDisposeTimingSource(true)
                        .build();
                skinAnimator.start();
            } else {
                repaint();
            }
        }
    });
}
 
开发者ID:TeamWertarbyte,项目名称:craften-launcher,代码行数:31,代码来源:RoundAvatarPanel.java


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