}
// make sure the fold menu occurs as expected then set the current
// to the correct parent!
if(current != null && current instanceof Dialog && ((Dialog)current).isMenu()) {
Transition t = current.getTransitionOutAnimator();
if(t != null) {
// go back to the parent form first
initTransition(t.copy(), current, ((Dialog)current).getPreviousForm());
}
current = ((Dialog)current).getPreviousForm();
}
// prevent the transition from occuring from a form into itself
if(newForm != current) {
if((current != null && current.getTransitionOutAnimator() != null) || newForm.getTransitionInAnimator() != null) {
if(animationQueue == null) {
animationQueue = new Vector();
}
// prevent form transitions from breaking our dialog based
// transitions which are a bit sensitive
if(current != null && (!(newForm instanceof Dialog))) {
Transition t = current.getTransitionOutAnimator();
if(current != null && t != null) {
initTransition(t.copy(), current, newForm);
transitionExists = true;
}
}
if(current != null && !(current instanceof Dialog)) {
Transition t = newForm.getTransitionInAnimator();
if(t != null) {
initTransition(t.copy(), current, newForm);
transitionExists = true;
}
}
}
}
lock.notify();
if(!transitionExists) {
if(animationQueue == null || animationQueue.size() == 0) {
setCurrentForm(newForm);
} else {
// we need to add an empty transition to "serialize" this
// screen change...
Transition t = CommonTransitions.createEmpty();
initTransition(t, current, newForm);
}
}
}
}