use of demos.datafx.AnimatedFlowContainer in project JFoenix by jfoenixadmin.
the class MainController method init.
@PostConstruct
public void init() throws FlowException, VetoException {
// init the title hamburger icon
drawer.setOnDrawerOpening((e) -> {
titleBurger.getAnimation().setRate(1);
titleBurger.getAnimation().play();
});
drawer.setOnDrawerClosing((e) -> {
titleBurger.getAnimation().setRate(-1);
titleBurger.getAnimation().play();
});
titleBurgerContainer.setOnMouseClicked((e) -> {
if (drawer.isHidden() || drawer.isHidding())
drawer.open();
else
drawer.close();
});
try {
FXMLLoader loader = new FXMLLoader(getClass().getResource("/resources/fxml/ui/popup/MainPopup.fxml"));
loader.setController(new InputController());
toolbarPopup = new JFXPopup(loader.load());
} catch (IOException e1) {
e1.printStackTrace();
}
optionsBurger.setOnMouseClicked((e) -> {
toolbarPopup.show(optionsBurger, PopupVPosition.TOP, PopupHPosition.RIGHT, -12, 15);
});
// create the inner flow and content
context = new ViewFlowContext();
// set the default controller
Flow innerFlow = new Flow(ButtonController.class);
flowHandler = innerFlow.createHandler(context);
context.register("ContentFlowHandler", flowHandler);
context.register("ContentFlow", innerFlow);
drawer.setContent(flowHandler.start(new AnimatedFlowContainer(Duration.millis(320), ContainerAnimations.SWIPE_LEFT)));
context.register("ContentPane", drawer.getContent().get(0));
// side controller will add links to the content flow
Flow sideMenuFlow = new Flow(SideMenuController.class);
sideMenuFlowHandler = sideMenuFlow.createHandler(context);
drawer.setSidePane(sideMenuFlowHandler.start(new AnimatedFlowContainer(Duration.millis(320), ContainerAnimations.SWIPE_LEFT)));
}
Aggregations