@Override public void setValueAnimated(final double VALUE) { if (timeline.getState() == Timeline.TimelineState.PLAYING_FORWARD || timeline.getState() == Timeline.TimelineState.PLAYING_REVERSE) { timeline.abort(); } timeline = new Timeline(this); timeline.addPropertyToInterpolate("value", value, VALUE); timeline.setEase(new Spline(0.5f)); timeline.setDuration(800); timeline.play(); }
@Override public void updateStatus(String text, int level) { label.setText(text); if (level == LEVEL_NORMAL) { label.setBackground(colorNormal); } else { Color blinkColor = (level == LEVEL_WARNING) ? colorWarning : colorError; Timeline timeline = new Timeline(label); timeline.setDuration(200); timeline.setEase(new Sine()); timeline.addPropertyToInterpolate("background", colorNormal, blinkColor); timeline.playLoop(8, RepeatBehavior.REVERSE); } }
/** * Simple constructor. * * @param jbutton */ private RootPaneDefaultButtonTracker(JButton jbutton) { // Create weak reference. this.buttonRef = new WeakReference<JButton>(jbutton); // Create coalesced timer. this.timeline = new Timeline(this); this.timeline.addCallback(this); // Store event handler and initial cycle count. RootPaneDefaultButtonTracker.trackers.put(jbutton, this); }
public float getFocusStrength(boolean hasFocus) { if (this.focusTimeline == null) return 0.0f; TimelineState focusTimelineState = this.focusTimeline.getState(); if ((focusTimelineState == TimelineState.READY) || (focusTimelineState == TimelineState.PLAYING_FORWARD) || (focusTimelineState == TimelineState.PLAYING_REVERSE)) { return this.focusTimeline.getTimelinePosition(); } return hasFocus ? 1.0f : 0.0f; }
private void initAnimationTimers() { this.showAnimation = new Timeline(this); this.showAnimation.setDuration(SHOW_TIME); this.showAnimation.addPropertyToInterpolate("opacity", this.minOpacity, this.maxOpacity); this.hideAnimation = new Timeline(this); this.hideAnimation.setDuration(HIDE_TIME); this.hideAnimation.addPropertyToInterpolate("opacity", this.maxOpacity, this.minOpacity); }
public void configureModifiedTimeline(Timeline timeline) { timeline.setDuration(5 * this.timelineDuration); timeline.setEase(new TimelineEase() { @Override public float map(float durationFraction) { if (durationFraction < 0.8f) { return 0.0f; } return 5.0f * (durationFraction - 0.8f); } }); } }
/** * Animates the radar beam of the component. This has no effect * on the functionality but is only eye candy. * @param RUN enables/disables the animation of the beam */ public void animate(final boolean RUN) { if (isEnabled()) { if (RUN) { if (timeline.getState() != Timeline.TimelineState.PLAYING_FORWARD && timeline.getState() != Timeline.TimelineState.SUSPENDED) { timeline = new Timeline(this); timeline.addPropertyToInterpolate("rotationAngle", this.rotationAngle, 2 * Math.PI); timeline.setEase(new org.pushingpixels.trident.ease.Linear()); timeline.setDuration((long) (5000)); timeline.playLoop(Timeline.RepeatBehavior.LOOP); } else if (timeline.getState() == Timeline.TimelineState.SUSPENDED) { timeline.resume(); } } else { timeline.suspend(); } } }
@Override protected void startAnimationTimer() { this.indeterminateLoopTimeline = new Timeline(this); Integer cycleDuration = UIManager.getInt("ProgressBar.cycleTime"); if (cycleDuration == null) cycleDuration = 1000; this.indeterminateLoopTimeline.setDuration(cycleDuration); this.indeterminateLoopTimeline.addCallback(new TimelineCallback() { @Override public void onTimelineStateChanged(TimelineState oldState, this.indeterminateLoopTimeline.addPropertyToInterpolate(Timeline .<Float> property("animationPosition").from(0.0f).to(1.0f) .setWith(new PropertySetter<Float>() { @Override this.indeterminateLoopTimeline.playLoop(RepeatBehavior.LOOP);
if (horizontalScrollTimeline != null) { horizontalScrollTimeline.abort(); horizontalScrollTimeline = new Timeline(tree); horizontalScrollTimeline .addCallback(new UIThreadTimelineCallbackAdapter() { @Override public void onTimelinePulse( .setEase(new TimelineEase() { @Override public float map(float durationFraction) { .configureTimeline(horizontalScrollTimeline); horizontalScrollTimeline .setDuration(2 * horizontalScrollTimeline .getDuration()); horizontalScrollTimeline.play();
private void trackModificationFlag() { this.modifiedTimeline = new Timeline(this.button); AnimationConfigurationManager.getInstance().configureModifiedTimeline( modifiedTimeline); this.modifiedTimeline .addCallback(new SwingRepaintCallback(this.button)); this.modifiedTimeline.playLoop(RepeatBehavior.REVERSE); }
/** * Starts the associated timer. */ private void startTimer() { this.timeline.playLoop(RepeatBehavior.REVERSE); }
public IconGlowTracker(Component component) { this.component = component; this.iconGlowTimeline = new Timeline(this.component); AnimationConfigurationManager.getInstance().configureTimeline( this.iconGlowTimeline); this.iconGlowTimeline.setDuration(10 * this.iconGlowTimeline .getDuration()); this.iconGlowTimeline.addCallback(new SwingRepaintCallback(component)); this.iconGlowTimeline.setName("Icon glow"); }
this.index = index; this.overviewPanel = overviewPanel; this.rolloverTimeline = new Timeline( overviewPanel.previewControls[index]); AnimationConfigurationManager.getInstance().configureTimeline( this.rolloverTimeline); this.rolloverTimeline.addPropertyToInterpolate("zoom", 1.0f, 1.2f); this.rolloverTimeline.addCallback(new SwingRepaintCallback( SwingUtilities.getRootPane(overviewPanel))); this.rolloverTimeline .addCallback(new UIThreadTimelineCallbackAdapter() { @Override public void onTimelineStateChanged(
public final <T> void addPropertyToInterpolate(String propName, KeyFrames<T> keyFrames) { this.addPropertyToInterpolate(Timeline.<T> property(propName) .goingThrough(keyFrames)); }
@Override protected void onUpdate() { this.setVisible(this.descriptor.isVisible()); this.progressTl.abort(); this.progressTl.setDuration(1000 / this.descriptor.getFps()); this.progressTl.playLoop(Timeline.RepeatBehavior.LOOP); }
Timeline scrollTimeline = new Timeline(theComponent); AnimationConfigurationManager.getInstance().configureTimeline( scrollTimeline); scrollTimeline.addCallback(new UIThreadTimelineCallbackAdapter() { @Override public void onTimelineStateChanged(TimelineState oldState, scrollTimeline.play(); } else { theComponent.scrollRectToVisible(newRectangle);
@Override public void mouseEntered(MouseEvent e) { currHoverIndex = index; overviewPanel.previewControls[index].setToolTipText(null); this.rolloverTimeline.play(); }