Search in sources :

Example 1 with JFXListView

use of com.jfoenix.controls.JFXListView 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 2 with JFXListView

use of com.jfoenix.controls.JFXListView 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 3 with JFXListView

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

the class PopupDemo method start.

@Override
public void start(Stage primaryStage) throws Exception {
    JFXHamburger show = new JFXHamburger();
    show.setPadding(new Insets(10, 5, 10, 5));
    JFXRippler r = new JFXRippler(show, RipplerMask.CIRCLE, RipplerPos.BACK);
    JFXListView<Label> list = new JFXListView<Label>();
    for (int i = 1; i < 5; i++) list.getItems().add(new Label("Item " + i));
    AnchorPane container = new AnchorPane();
    container.getChildren().add(r);
    AnchorPane.setLeftAnchor(r, 200.0);
    AnchorPane.setTopAnchor(r, 210.0);
    StackPane main = new StackPane();
    main.getChildren().add(container);
    JFXPopup popup = new JFXPopup(list);
    r.setOnMouseClicked((e) -> popup.show(r, PopupVPosition.TOP, PopupHPosition.LEFT));
    final Scene scene = new Scene(main, 800, 800);
    scene.getStylesheets().add(PopupDemo.class.getResource("/resources/css/jfoenix-components.css").toExternalForm());
    primaryStage.setTitle("JFX Popup Demo");
    primaryStage.setScene(scene);
    primaryStage.setResizable(false);
    primaryStage.show();
}
Also used : JFXPopup(com.jfoenix.controls.JFXPopup) Insets(javafx.geometry.Insets) JFXRippler(com.jfoenix.controls.JFXRippler) JFXHamburger(com.jfoenix.controls.JFXHamburger) JFXListView(com.jfoenix.controls.JFXListView) Label(javafx.scene.control.Label) Scene(javafx.scene.Scene) AnchorPane(javafx.scene.layout.AnchorPane) StackPane(javafx.scene.layout.StackPane)

Aggregations

JFXListView (com.jfoenix.controls.JFXListView)3 Insets (javafx.geometry.Insets)3 Scene (javafx.scene.Scene)3 Label (javafx.scene.control.Label)3 JFXButton (com.jfoenix.controls.JFXButton)2 StackPane (javafx.scene.layout.StackPane)2 JFXHamburger (com.jfoenix.controls.JFXHamburger)1 JFXPopup (com.jfoenix.controls.JFXPopup)1 JFXRippler (com.jfoenix.controls.JFXRippler)1 JFXScrollPane (com.jfoenix.controls.JFXScrollPane)1 SVGGlyph (com.jfoenix.svg.SVGGlyph)1 ListView (javafx.scene.control.ListView)1 AnchorPane (javafx.scene.layout.AnchorPane)1