use of com.codename1.ui.animations.Transition in project CodenameOne by codenameone.
the class ChartComponent method zoomToShapeInChartCoords.
/**
* Zooms the view port to show a specified shape. The shape should be
* expressed in chart coordinates (not screen coordinates).
* @param s The shape that should be shown.
* @param duration The duration of the transition.
* @see #zoomTo(double, double, double, double, int)
*/
public void zoomToShapeInChartCoords(Shape s, int duration) {
Rectangle r = s.getBounds();
zoomTransition(r.getX(), r.getX() + r.getWidth(), r.getY(), r.getY() + r.getHeight(), duration);
}
use of com.codename1.ui.animations.Transition in project CodenameOne by codenameone.
the class LazyValueC method reloadForm.
/**
* Useful tool to refresh the current state of a form shown using show form
* without pushing another instance to the back stack
*/
public void reloadForm() {
Form currentForm = Display.getInstance().getCurrent();
Command backCommand = currentForm.getBackCommand();
Form newForm = (Form) createContainer(fetchResourceFile(), currentForm.getName());
if (backCommand != null) {
setBackCommand(newForm, backCommand);
// trigger listener creation if this is the only command in the form
getFormListenerInstance(newForm, null);
for (int iter = 0; iter < currentForm.getCommandCount(); iter++) {
if (backCommand == currentForm.getCommand(iter)) {
newForm.addCommand(backCommand, newForm.getCommandCount());
break;
}
}
}
beforeShow(newForm);
Transition tin = newForm.getTransitionInAnimator();
Transition tout = newForm.getTransitionOutAnimator();
currentForm.setTransitionInAnimator(CommonTransitions.createEmpty());
currentForm.setTransitionOutAnimator(CommonTransitions.createEmpty());
newForm.setTransitionInAnimator(CommonTransitions.createEmpty());
newForm.setTransitionOutAnimator(CommonTransitions.createEmpty());
newForm.layoutContainer();
newForm.show();
postShowImpl(newForm);
newForm.setTransitionInAnimator(tin);
newForm.setTransitionOutAnimator(tout);
}
Aggregations