本文整理汇总了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();
}
示例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();
}
}
});
}