本文整理汇总了Java中org.jdesktop.animation.timing.triggers.TimingTrigger.addTrigger方法的典型用法代码示例。如果您正苦于以下问题:Java TimingTrigger.addTrigger方法的具体用法?Java TimingTrigger.addTrigger怎么用?Java TimingTrigger.addTrigger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jdesktop.animation.timing.triggers.TimingTrigger
的用法示例。
在下文中一共展示了TimingTrigger.addTrigger方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DemoPanel
import org.jdesktop.animation.timing.triggers.TimingTrigger; //导入方法依赖的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();
}
}
示例2: Triggers
import org.jdesktop.animation.timing.triggers.TimingTrigger; //导入方法依赖的package包/类
/** Creates a new instance of Triggers */
public Triggers() {
setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
action = new SpherePanel("yellow-sphere.png");
focus = new SpherePanel("blue-sphere.png");
armed = new SpherePanel("red-sphere.png");
over = new SpherePanel("green-sphere.png");
timing = new SpherePanel("gray-sphere.png");
add(action);
add(focus);
add(armed);
add(over);
add(timing);
// Add triggers for each sphere, depending on what we want to
// trigger them
ActionTrigger.addTrigger(triggerButton, action.getAnimator());
FocusTrigger.addTrigger(triggerButton,
focus.getAnimator(), FocusTriggerEvent.IN);
MouseTrigger.addTrigger(triggerButton,
armed.getAnimator(), MouseTriggerEvent.PRESS);
MouseTrigger.addTrigger(triggerButton,
over.getAnimator(), MouseTriggerEvent.ENTER);
TimingTrigger.addTrigger(action.getAnimator(),
timing.getAnimator(), TimingTriggerEvent.STOP);
}
示例3: questionSwipeEvent1
import org.jdesktop.animation.timing.triggers.TimingTrigger; //导入方法依赖的package包/类
public void questionSwipeEvent1(TextZone tZone) {
if(tZone.isHSwipeable()){
animQuestion11[animIndex1].stop();
animQuestion11[animIndex1] = new Animator(FINAL_TIME, tZone);
start1x[animIndex1] = tZone.getX();
end1x[animIndex1] = tZone.getX() + (sketch.getWidth() - tZone.getX());
start1y[animIndex1] = tZone.getY();
end1y[animIndex1] = tZone.getY();
animQuestion11[animIndex1].setResolution(5);
animQuestion11[animIndex1].start();
int oldAnimIndex = animIndex1;
animIndex1 = animIndex1 + 1;
if(animIndex1 >= Sketch.NUM_QUESTIONS) {
animIndex1 = 0;
}
animQuestion11[animIndex1] = new Animator(TIME, questionZone1[animIndex1]);
animQuestion11[animIndex1].setResolution(5);
questionZone1[animIndex1].setXY(sketch.lineX, sketch.getHeight());
start1x[animIndex1] = sketch.lineX;
end1x[animIndex1] = xMaxTranslation1[animIndex1] + sketch.lineX;
start1y[animIndex1] = sketch.getHeight();
end1y[animIndex1] = sketch.getHeight() + yMaxTranslation1[animIndex1];
TimingTrigger.addTrigger(animQuestion11[oldAnimIndex], animQuestion11[animIndex1], TimingTriggerEvent.STOP);
questionZone1[animIndex1].setGestureEnabled("HSwipe", true);
tZone.setGestureEnabled("HSwipe", false);
}
}
示例4: questionSwipeEvent2
import org.jdesktop.animation.timing.triggers.TimingTrigger; //导入方法依赖的package包/类
public void questionSwipeEvent2(TextZone tZone) {
if(tZone.isHSwipeable()){
animQuestion12[animIndex2].stop();
animQuestion12[animIndex2] = new Animator(FINAL_TIME, tZone);
animQuestion12[animIndex2].setResolution(5);
start2x[animIndex2] = tZone.getX();
end2x[animIndex2] = tZone.getX() - (sketch.getWidth() - tZone.getX());
start2y[animIndex2] = tZone.getY();
end2y[animIndex2] = tZone.getY();
animQuestion12[animIndex2].start();
int oldAnimIndex = animIndex2;
animIndex2 = animIndex2 + 1;
if(animIndex2 >= Sketch.NUM_QUESTIONS) {
animIndex2 = 0;
}
animQuestion12[animIndex2] = new Animator(TIME, questionZone2[animIndex2]);
animQuestion12[animIndex2].setResolution(5);
questionZone2[animIndex2].setXY(sketch.lineX, sketch.getHeight());
start2x[animIndex2] = sketch.lineX;
end2x[animIndex2] = xMaxTranslation2[animIndex2] + sketch.lineX;
start2y[animIndex2] = -zoneHeight2[animIndex2];
end2y[animIndex2] = -zoneHeight2[animIndex2] + yMaxTranslation2[animIndex2];
TimingTrigger.addTrigger(animQuestion12[oldAnimIndex], animQuestion12[animIndex2], TimingTriggerEvent.STOP);
questionZone2[animIndex2].setGestureEnabled("HSwipe", true);
tZone.setGestureEnabled("HSwipe", false);
}
}