Class SwingRepaintCallback
- java.lang.Object
-
- org.pushingpixels.radiance.animation.api.callback.TimelineCallbackAdapter
-
- org.pushingpixels.radiance.animation.api.swing.SwingRepaintCallback
-
- All Implemented Interfaces:
TimelineCallback
public class SwingRepaintCallback extends TimelineCallbackAdapter
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.Component
comp
private java.awt.Rectangle
rect
private java.util.concurrent.atomic.AtomicBoolean
repaintGuard
-
Constructor Summary
Constructors Constructor Description SwingRepaintCallback(java.awt.Component comp)
SwingRepaintCallback(java.awt.Component comp, java.awt.Rectangle rect)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
forceRepaintOnNextPulse()
void
onTimelinePulse(float durationFraction, float timelinePosition)
Indicates that the timeline pulse has happened.void
onTimelineStateChanged(Timeline.TimelineState oldState, Timeline.TimelineState newState, float durationFraction, float timelinePosition)
Indicates that the timeline state has changed.private void
repaintAsNecessary()
void
setAutoRepaintMode(boolean autoRepaintMode)
void
setRepaintRectangle(java.awt.Rectangle rect)
-
-
-
Method Detail
-
setAutoRepaintMode
public void setAutoRepaintMode(boolean autoRepaintMode)
-
forceRepaintOnNextPulse
public void forceRepaintOnNextPulse()
-
setRepaintRectangle
public void setRepaintRectangle(java.awt.Rectangle rect)
-
onTimelinePulse
public void onTimelinePulse(float durationFraction, float timelinePosition)
Description copied from interface:TimelineCallback
Indicates that the timeline pulse has happened.- Specified by:
onTimelinePulse
in interfaceTimelineCallback
- Overrides:
onTimelinePulse
in classTimelineCallbackAdapter
- Parameters:
durationFraction
- The current timeline duration fraction. Is guaranteed to be in 0.0-1.0 range. The rate of change of this value is linear, and the value is proportional toTimeline.BaseBuilder.setDuration(long)
.timelinePosition
- The current timeline position. Is guaranteed to be in 0.0-1.0 range. The rate of change of this value is not necessarily linear and is affected by theTimeline.BaseBuilder.setEase(TimelineEase)
.
-
onTimelineStateChanged
public void onTimelineStateChanged(Timeline.TimelineState oldState, Timeline.TimelineState newState, float durationFraction, float timelinePosition)
Description copied from interface:TimelineCallback
Indicates that the timeline state has changed.- Specified by:
onTimelineStateChanged
in interfaceTimelineCallback
- Overrides:
onTimelineStateChanged
in classTimelineCallbackAdapter
- Parameters:
oldState
- The old timeline state.newState
- The new timeline state.durationFraction
- The current timeline duration fraction. Is guaranteed to be in 0.0-1.0 range. The rate of change of this value is linear, and the value is proportional toTimeline.BaseBuilder.setDuration(long)
.timelinePosition
- The current timeline position. Is guaranteed to be in 0.0-1.0 range. The rate of change of this value is not necessarily linear and is affected by theTimeline.BaseBuilder.setEase(TimelineEase)
.
-
repaintAsNecessary
private void repaintAsNecessary()
-
-