// + existing.getValue().start + ":"
// + existing.getValue().end + "]");
// }
// }
this.transitionTimeline.addCallback(new TimelineCallbackAdapter() {
@Override
public void onTimelineStateChanged(final TimelineState oldState,
final TimelineState newState, final float durationFraction,
final float timelinePosition) {
if (newState == TimelineState.DONE) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
modelStateInfo.clear();
// repaint after the model state info has
// been cleared
repaintCallback.getRepaintCallback()
.onTimelineStateChanged(oldState, newState,
durationFraction, timelinePosition);
}
});
}
}
});
// notify listeners on model state transition
this.transitionTimeline.addCallback(new TimelineCallbackAdapter() {
@Override
public void onTimelineStateChanged(final TimelineState oldState,
final TimelineState newState, float durationFraction,
float timelinePosition) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
fireModelStateTransitionEvent(oldState, newState);
}
});
}
});
// Add fix for issue 297 - menu items partially covered by lightweight
// popups (such as tooltips).
this.transitionTimeline.addCallback(new TimelineCallbackAdapter() {
@Override
public void onTimelineStateChanged(TimelineState oldState,
TimelineState newState, float durationFraction,
float timelinePosition) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
if (component instanceof JMenuItem) {
if (SubstanceCoreUtilities
.isCoveredByLightweightPopups(component)) {
component
.putClientProperty(
SubstanceCoreUtilities.IS_COVERED_BY_LIGHTWEIGHT_POPUPS,
Boolean.TRUE);
} else {
component
.putClientProperty(
SubstanceCoreUtilities.IS_COVERED_BY_LIGHTWEIGHT_POPUPS,
null);
}
}
}
});
}
@Override
public void onTimelinePulse(float durationFraction,
float timelinePosition) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
if (component instanceof JMenuItem) {
if (SubstanceCoreUtilities
.isCoveredByLightweightPopups(component)) {
component
.putClientProperty(
SubstanceCoreUtilities.IS_COVERED_BY_LIGHTWEIGHT_POPUPS,
Boolean.TRUE);
} else {
component
.putClientProperty(
SubstanceCoreUtilities.IS_COVERED_BY_LIGHTWEIGHT_POPUPS,
null);
}
}
}
});
}
});
this.transitionTimeline.addCallback(new TimelineCallbackAdapter() {
@Override
public void onTimelineStateChanged(TimelineState oldState,
TimelineState newState, float durationFraction,
float timelinePosition) {
updateActiveStates(timelinePosition);