Search in sources :

Example 1 with JFXButton

use of com.jfoenix.controls.JFXButton in project JFoenix by jfoenixadmin.

the class JFXDatePickerContent method createCalendarArrowsPane.

/*
	 * methods to create the content of the date picker
	 */
protected BorderPane createCalendarArrowsPane() {
    SVGGlyph leftChevron = new SVGGlyph(0, "CHEVRON_LEFT", "M 742,-37 90,614 Q 53,651 53,704.5 53,758 90,795 l 652,651 q 37,37 90.5,37 53.5,0 90.5,-37 l 75,-75 q 37,-37 37,-90.5 0,-53.5 -37,-90.5 L 512,704 998,219 q 37,-38 37,-91 0,-53 -37,-90 L 923,-37 Q 886,-74 832.5,-74 779,-74 742,-37 z", Color.GRAY);
    SVGGlyph rightChevron = new SVGGlyph(0, "CHEVRON_RIGHT", "m 1099,704 q 0,-52 -37,-91 L 410,-38 q -37,-37 -90,-37 -53,0 -90,37 l -76,75 q -37,39 -37,91 0,53 37,90 l 486,486 -486,485 q -37,39 -37,91 0,53 37,90 l 76,75 q 36,38 90,38 54,0 90,-38 l 652,-651 q 37,-37 37,-90 z", Color.GRAY);
    leftChevron.setFill(Color.valueOf("#313131"));
    leftChevron.setSize(6, 11);
    rightChevron.setFill(Color.valueOf("#313131"));
    rightChevron.setSize(6, 11);
    backMonthButton = new JFXButton();
    backMonthButton.setMinSize(40, 40);
    backMonthButton.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT, new CornerRadii(40), Insets.EMPTY)));
    backMonthButton.getStyleClass().add("left-button");
    backMonthButton.setGraphic(leftChevron);
    backMonthButton.setRipplerFill(this.datePicker.getDefaultColor());
    backMonthButton.setOnAction(t -> {
        forward(-1, MONTHS, false, true);
    });
    forwardMonthButton = new JFXButton();
    forwardMonthButton.setMinSize(40, 40);
    forwardMonthButton.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT, new CornerRadii(40), Insets.EMPTY)));
    forwardMonthButton.getStyleClass().add("right-button");
    forwardMonthButton.setGraphic(rightChevron);
    forwardMonthButton.setRipplerFill(this.datePicker.getDefaultColor());
    forwardMonthButton.setOnAction(t -> {
        forward(1, MONTHS, false, true);
    });
    BorderPane arrowsContainer = new BorderPane();
    arrowsContainer.setLeft(backMonthButton);
    arrowsContainer.setRight(forwardMonthButton);
    arrowsContainer.setPadding(new Insets(4, 12, 2, 12));
    arrowsContainer.setPickOnBounds(false);
    return arrowsContainer;
}
Also used : Insets(javafx.geometry.Insets) SVGGlyph(com.jfoenix.svg.SVGGlyph) JFXButton(com.jfoenix.controls.JFXButton)

Example 2 with JFXButton

use of com.jfoenix.controls.JFXButton in project JFoenix by jfoenixadmin.

the class DrawerDemo method start.

@Override
public void start(Stage primaryStage) throws Exception {
    FlowPane content = new FlowPane();
    JFXButton leftButton = new JFXButton("LEFT");
    JFXButton topButton = new JFXButton("TOP");
    JFXButton rightButton = new JFXButton("RIGHT");
    JFXButton bottomButton = new JFXButton("BOTTOM");
    content.getChildren().addAll(leftButton, topButton, rightButton, bottomButton);
    content.setMaxSize(200, 200);
    JFXDrawer leftDrawer = new JFXDrawer();
    StackPane leftDrawerPane = new StackPane();
    leftDrawerPane.getStyleClass().add("red-400");
    leftDrawerPane.getChildren().add(new JFXButton("Left Content"));
    leftDrawer.setSidePane(leftDrawerPane);
    leftDrawer.setDefaultDrawerSize(150);
    //		leftDrawer.setContent(content);	
    leftDrawer.setOverLayVisible(false);
    leftDrawer.setResizableOnDrag(true);
    JFXDrawer bottomDrawer = new JFXDrawer();
    StackPane bottomDrawerPane = new StackPane();
    bottomDrawerPane.getStyleClass().add("deep-purple-400");
    bottomDrawerPane.getChildren().add(new JFXButton("Bottom Content"));
    bottomDrawer.setDefaultDrawerSize(150);
    bottomDrawer.setDirection(DrawerDirection.BOTTOM);
    bottomDrawer.setSidePane(bottomDrawerPane);
    //		bottomDrawer.setContent(leftDrawer);
    bottomDrawer.setOverLayVisible(false);
    bottomDrawer.setResizableOnDrag(true);
    JFXDrawer rightDrawer = new JFXDrawer();
    StackPane rightDrawerPane = new StackPane();
    rightDrawerPane.getStyleClass().add("blue-400");
    rightDrawerPane.getChildren().add(new JFXButton("Right Content"));
    rightDrawer.setDirection(DrawerDirection.RIGHT);
    rightDrawer.setDefaultDrawerSize(150);
    rightDrawer.setSidePane(rightDrawerPane);
    //		rightDrawer.setContent(bottomDrawer);
    rightDrawer.setOverLayVisible(false);
    rightDrawer.setResizableOnDrag(true);
    JFXDrawer topDrawer = new JFXDrawer();
    StackPane topDrawerPane = new StackPane();
    topDrawerPane.getStyleClass().add("green-400");
    topDrawerPane.getChildren().add(new JFXButton("Top Content"));
    topDrawer.setDirection(DrawerDirection.TOP);
    topDrawer.setDefaultDrawerSize(150);
    topDrawer.setSidePane(topDrawerPane);
    //		topDrawer.setContent(rightDrawer);
    topDrawer.setOverLayVisible(false);
    topDrawer.setResizableOnDrag(true);
    JFXDrawersStack drawersStack = new JFXDrawersStack();
    drawersStack.setContent(content);
    leftDrawer.setId("LEFT");
    rightDrawer.setId("RIGHT");
    bottomDrawer.setId("BOT");
    topDrawer.setId("TOP");
    leftButton.addEventHandler(MouseEvent.MOUSE_PRESSED, (e) -> {
        drawersStack.toggle(leftDrawer);
    });
    bottomButton.addEventHandler(MouseEvent.MOUSE_PRESSED, (e) -> {
        drawersStack.toggle(bottomDrawer);
    });
    rightButton.addEventHandler(MouseEvent.MOUSE_PRESSED, (e) -> {
        drawersStack.toggle(rightDrawer);
    });
    topButton.addEventHandler(MouseEvent.MOUSE_PRESSED, (e) -> {
        drawersStack.toggle(topDrawer);
    });
    final Scene scene = new Scene(drawersStack, 800, 800);
    scene.getStylesheets().add(DrawerDemo.class.getResource("/resources/css/jfoenix-components.css").toExternalForm());
    scene.getStylesheets().add(DrawerDemo.class.getResource("/resources/css/jfoenix-design.css").toExternalForm());
    primaryStage.setTitle("JFX Drawer Demo");
    primaryStage.setScene(scene);
    primaryStage.setResizable(true);
    primaryStage.show();
}
Also used : JFXDrawer(com.jfoenix.controls.JFXDrawer) FlowPane(javafx.scene.layout.FlowPane) JFXButton(com.jfoenix.controls.JFXButton) JFXDrawersStack(com.jfoenix.controls.JFXDrawersStack) Scene(javafx.scene.Scene) StackPane(javafx.scene.layout.StackPane)

Example 3 with JFXButton

use of com.jfoenix.controls.JFXButton in project JFoenix by jfoenixadmin.

the class ListViewDemo method start.

@Override
public void start(Stage stage) throws Exception {
    JFXListView<Label> list = new JFXListView<Label>();
    for (int i = 0; i < 4; i++) list.getItems().add(new Label("Item " + i));
    list.getStyleClass().add("mylistview");
    ListView<String> javaList = new ListView<String>();
    for (int i = 0; i < 4; i++) javaList.getItems().add("Item " + i);
    FlowPane pane = new FlowPane();
    pane.setStyle("-fx-background-color:WHITE");
    JFXButton button3D = new JFXButton("3D");
    button3D.setOnMouseClicked((e) -> list.depthProperty().set(++counter % 2));
    JFXButton buttonExpand = new JFXButton("EXPAND");
    buttonExpand.setOnMouseClicked((e) -> {
        list.depthProperty().set(1);
        list.setExpanded(true);
    });
    JFXButton buttonCollapse = new JFXButton("COLLAPSE");
    buttonCollapse.setOnMouseClicked((e) -> {
        list.depthProperty().set(1);
        list.setExpanded(false);
    });
    pane.getChildren().add(button3D);
    pane.getChildren().add(buttonExpand);
    pane.getChildren().add(buttonCollapse);
    AnchorPane listsPane = new AnchorPane();
    listsPane.getChildren().add(list);
    AnchorPane.setLeftAnchor(list, 20.0);
    listsPane.getChildren().add(javaList);
    AnchorPane.setLeftAnchor(javaList, 300.0);
    VBox box = new VBox();
    box.getChildren().add(pane);
    box.getChildren().add(listsPane);
    box.setSpacing(40);
    StackPane main = new StackPane();
    main.getChildren().add(box);
    main.setBackground(new Background(new BackgroundFill(Color.WHITE, CornerRadii.EMPTY, Insets.EMPTY)));
    StackPane.setMargin(pane, new Insets(20, 0, 0, 20));
    final Scene scene = new Scene(main, 600, 600, Color.WHITE);
    stage.setTitle("JFX ListView Demo ");
    scene.getStylesheets().add(ListViewDemo.class.getResource("/resources/css/jfoenix-components.css").toExternalForm());
    stage.setScene(scene);
    stage.setResizable(false);
    stage.show();
}
Also used : Insets(javafx.geometry.Insets) Label(javafx.scene.control.Label) JFXButton(com.jfoenix.controls.JFXButton) Scene(javafx.scene.Scene) ListView(javafx.scene.control.ListView) JFXListView(com.jfoenix.controls.JFXListView) JFXListView(com.jfoenix.controls.JFXListView)

Example 4 with JFXButton

use of com.jfoenix.controls.JFXButton in project JFoenix by jfoenixadmin.

the class ScrollPaneDemo method start.

@Override
public void start(Stage stage) throws Exception {
    JFXListView<Label> list = new JFXListView<Label>();
    for (int i = 0; i < 100; i++) list.getItems().add(new Label("Item " + i));
    list.getStyleClass().add("mylistview");
    list.setMaxHeight(3400);
    StackPane container = new StackPane(list);
    container.setPadding(new Insets(24));
    JFXScrollPane pane = new JFXScrollPane();
    pane.setContent(container);
    JFXButton button = new JFXButton("");
    SVGGlyph arrow = new SVGGlyph(0, "FULLSCREEN", "M402.746 877.254l-320-320c-24.994-24.992-24.994-65.516 0-90.51l320-320c24.994-24.992 65.516-24.992 90.51 0 24.994 24.994 24.994 65.516 0 90.51l-210.746 210.746h613.49c35.346 0 64 28.654 64 64s-28.654 64-64 64h-613.49l210.746 210.746c12.496 12.496 18.744 28.876 18.744 45.254s-6.248 32.758-18.744 45.254c-24.994 24.994-65.516 24.994-90.51 0z", Color.WHITE);
    arrow.setSize(20, 16);
    button.setGraphic(arrow);
    button.setRipplerFill(Color.WHITE);
    pane.getTopBar().getChildren().add(button);
    Label title = new Label("Title");
    pane.getBottomBar().getChildren().add(title);
    title.setStyle("-fx-text-fill:WHITE; -fx-font-size: 40;");
    JFXScrollPane.smoothScrolling((ScrollPane) pane.getChildren().get(0));
    StackPane.setMargin(title, new Insets(0, 0, 0, 80));
    StackPane.setAlignment(title, Pos.CENTER_LEFT);
    StackPane.setAlignment(button, Pos.CENTER_LEFT);
    StackPane.setMargin(button, new Insets(0, 0, 0, 20));
    final Scene scene = new Scene(new StackPane(pane), 600, 600, Color.WHITE);
    stage.setTitle("JFX ListView Demo ");
    stage.setScene(scene);
    stage.show();
}
Also used : JFXScrollPane(com.jfoenix.controls.JFXScrollPane) Insets(javafx.geometry.Insets) SVGGlyph(com.jfoenix.svg.SVGGlyph) JFXListView(com.jfoenix.controls.JFXListView) Label(javafx.scene.control.Label) JFXButton(com.jfoenix.controls.JFXButton) Scene(javafx.scene.Scene) StackPane(javafx.scene.layout.StackPane)

Example 5 with JFXButton

use of com.jfoenix.controls.JFXButton in project JFoenix by jfoenixadmin.

the class ButtonDemo method start.

@Override
public void start(Stage stage) {
    FlowPane main = new FlowPane();
    main.setVgap(20);
    main.setHgap(20);
    main.getChildren().add(new Button("Java Button"));
    JFXButton jfoenixButton = new JFXButton("JFoenix Button");
    main.getChildren().add(jfoenixButton);
    JFXButton button = new JFXButton("Raised Button".toUpperCase());
    button.getStyleClass().add("button-raised");
    main.getChildren().add(button);
    JFXButton button1 = new JFXButton("DISABLED");
    button1.setDisable(true);
    main.getChildren().add(button1);
    StackPane pane = new StackPane();
    pane.getChildren().add(main);
    StackPane.setMargin(main, new Insets(100));
    pane.setStyle("-fx-background-color:WHITE");
    final Scene scene = new Scene(pane, 800, 200);
    scene.getStylesheets().add(ButtonDemo.class.getResource("/resources/css/jfoenix-components.css").toExternalForm());
    stage.setTitle("JFX Button Demo");
    stage.setScene(scene);
    stage.show();
}
Also used : Insets(javafx.geometry.Insets) Button(javafx.scene.control.Button) JFXButton(com.jfoenix.controls.JFXButton) FlowPane(javafx.scene.layout.FlowPane) JFXButton(com.jfoenix.controls.JFXButton) Scene(javafx.scene.Scene) StackPane(javafx.scene.layout.StackPane)

Aggregations

JFXButton (com.jfoenix.controls.JFXButton)12 Insets (javafx.geometry.Insets)7 Scene (javafx.scene.Scene)6 Label (javafx.scene.control.Label)6 StackPane (javafx.scene.layout.StackPane)5 JFXListView (com.jfoenix.controls.JFXListView)3 SVGGlyph (com.jfoenix.svg.SVGGlyph)3 ActionEvent (javafx.event.ActionEvent)3 JFXDialog (com.jfoenix.controls.JFXDialog)2 JFXDialogLayout (com.jfoenix.controls.JFXDialogLayout)2 ArrayList (java.util.ArrayList)2 KeyValue (javafx.animation.KeyValue)2 FlowPane (javafx.scene.layout.FlowPane)2 Ingredient (BasicCommonClasses.Ingredient)1 Manufacturer (BasicCommonClasses.Manufacturer)1 IManager (EmployeeContracts.IManager)1 ConnectionFailure (EmployeeDefs.AEmployeeException.ConnectionFailure)1 EmployeeNotConnected (EmployeeDefs.AEmployeeException.EmployeeNotConnected)1 IngredientStillInUse (EmployeeDefs.AEmployeeException.IngredientStillInUse)1 InvalidParameter (EmployeeDefs.AEmployeeException.InvalidParameter)1