use of io.datafx.controller.flow.FlowException in project JFoenix by jfoenixadmin.
the class IconsController method init.
@PostConstruct
public void init() throws FlowException, VetoException {
bindAction(burger1);
bindAction(burger2);
bindAction(burger3);
bindAction(burger4);
snackbar.registerSnackbarContainer(root);
badge1.setOnMouseClicked((e) -> {
int value = Integer.parseInt(badge1.getText());
if (e.getButton() == MouseButton.PRIMARY) {
value++;
} else if (e.getButton() == MouseButton.SECONDARY) {
value--;
}
if (value == 0) {
badge1.setEnabled(false);
} else {
badge1.setEnabled(true);
}
badge1.setText(String.valueOf(value));
// trigger snackbar
if (count++ % 2 == 0) {
snackbar.fireEvent(new SnackbarEvent("Toast Message " + count));
} else {
if (count % 4 == 0) {
snackbar.fireEvent(new SnackbarEvent("Snackbar Message Persistant " + count, "CLOSE", 3000, true, (b) -> {
snackbar.close();
}));
} else {
snackbar.fireEvent(new SnackbarEvent("Snackbar Message " + count, "UNDO", 3000, false, (b) -> {
}));
}
}
});
}
use of io.datafx.controller.flow.FlowException in project JFoenix by jfoenixadmin.
the class SVGLoaderController method init.
@PostConstruct
public void init() throws FlowException, VetoException, Exception {
final Stage stage = (Stage) context.getRegisteredObject("Stage");
glyphDetailViewer = new GlyphDetailViewer();
detailsContainer.getChildren().add(glyphDetailViewer);
ScrollPane scrollableGlyphs = allGlyphs();
scrollableGlyphs.setStyle("-fx-background-insets: 0;");
iconsContainer.getChildren().add(scrollableGlyphs);
browseFont.setOnAction((action) -> {
FileChooser fileChooser = new FileChooser();
FileChooser.ExtensionFilter extFilter = new FileChooser.ExtensionFilter("SVG files (*.svg)", "*.svg");
fileChooser.getExtensionFilters().add(extFilter);
File file = fileChooser.showOpenDialog(stage);
if (file != null) {
SVGGlyphLoader.clear();
try {
SVGGlyphLoader.loadGlyphsFont(new FileInputStream(file), file.getName());
ScrollPane newglyphs = allGlyphs();
newglyphs.setStyle("-fx-background-insets: 0;");
iconsContainer.getChildren().clear();
iconsContainer.getChildren().add(newglyphs);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
use of io.datafx.controller.flow.FlowException in project JFoenix by jfoenixadmin.
the class SideMenuController method init.
@PostConstruct
public void init() throws FlowException, VetoException {
FlowHandler contentFlowHandler = (FlowHandler) context.getRegisteredObject("ContentFlowHandler");
sideList.propagateMouseEventsToParent();
sideList.getSelectionModel().selectedItemProperty().addListener((o, oldVal, newVal) -> {
if (newVal != null) {
try {
contentFlowHandler.handle(newVal.getId());
} catch (Exception e) {
e.printStackTrace();
}
}
});
Flow contentFlow = (Flow) context.getRegisteredObject("ContentFlow");
bindNodeToController(button, ButtonController.class, contentFlow, contentFlowHandler);
bindNodeToController(checkbox, CheckboxController.class, contentFlow, contentFlowHandler);
bindNodeToController(combobox, ComboBoxController.class, contentFlow, contentFlowHandler);
bindNodeToController(dialogs, DialogController.class, contentFlow, contentFlowHandler);
bindNodeToController(icons, IconsController.class, contentFlow, contentFlowHandler);
bindNodeToController(listview, ListViewController.class, contentFlow, contentFlowHandler);
bindNodeToController(treetableview, TreeTableViewController.class, contentFlow, contentFlowHandler);
bindNodeToController(progressbar, ProgressBarController.class, contentFlow, contentFlowHandler);
bindNodeToController(radiobutton, RadioButtonController.class, contentFlow, contentFlowHandler);
bindNodeToController(slider, SliderController.class, contentFlow, contentFlowHandler);
bindNodeToController(spinner, SpinnerController.class, contentFlow, contentFlowHandler);
bindNodeToController(textfield, TextFieldController.class, contentFlow, contentFlowHandler);
bindNodeToController(togglebutton, ToggleButtonController.class, contentFlow, contentFlowHandler);
bindNodeToController(popup, PopupController.class, contentFlow, contentFlowHandler);
bindNodeToController(svgLoader, SVGLoaderController.class, contentFlow, contentFlowHandler);
bindNodeToController(pickers, PickersController.class, contentFlow, contentFlowHandler);
bindNodeToController(masonry, MasonryPaneController.class, contentFlow, contentFlowHandler);
bindNodeToController(scrollpane, ScrollPaneController.class, contentFlow, contentFlowHandler);
}
Aggregations