Java Code Examples for javafx.scene.layout.FlowPane

The following examples show how to use javafx.scene.layout.FlowPane. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: mzmine3   Source File: HistogramDialog.java    License: GNU General Public License v2.0 6 votes vote down vote up
private void addKeyBindings() {
  FlowPane pnJump = new FlowPane();

  cbKeepSameXaxis = new CheckBox("keep same x-axis length");
  pnJump.getChildren().add(cbKeepSameXaxis);

  Button btnPrevious = new Button("<");
  btnPrevious.setTooltip(new Tooltip("Jump to previous distribution (use left arrow"));
  btnPrevious.setOnAction(e -> jumpToPrevPeak());
  pnJump.getChildren().add(btnPrevious);

  Button btnNext = new Button(">");
  btnNext.setTooltip(new Tooltip("Jump to previous distribution (use right arrow"));
  btnNext.setOnAction(e -> jumpToNextPeak());
  pnJump.getChildren().add(btnNext);
}
 
Example 2
private FlowPane addFeatureDataSummary(PeakListRow row) {
  var featureDataNode = new FlowPane(Orientation.VERTICAL);
  // featureDataSummary.setBackground(Color.WHITE);
  var featureDataSummary = featureDataNode.getChildren();
  featureDataSummary.add(new Label("Feature: " + row.getID()));
  if (row.getPreferredPeakIdentity() != null)
    featureDataSummary.add(new Label("Identity: " + row.getPreferredPeakIdentity().getName()));
  if (row.getComment() != null)
    featureDataSummary.add(new Label("Comment: " + row.getComment()));
  featureDataSummary.add(new Label("Raw File: " + rawFiles[0].getName()));
  featureDataSummary.add(new Label("Intensity: "
      + MZmineCore.getConfiguration().getIntensityFormat().format(feature.getHeight())));
  featureDataSummary.add(new Label(
      "Area: " + MZmineCore.getConfiguration().getIntensityFormat().format(feature.getArea())));
  featureDataSummary.add(new Label("Charge: " + feature.getCharge()));
  featureDataSummary.add(
      new Label("m/z: " + MZmineCore.getConfiguration().getMZFormat().format(feature.getMZ())));
  featureDataSummary.add(new Label(
      "Retention time: " + MZmineCore.getConfiguration().getRTFormat().format(feature.getRT())));
  featureDataSummary.add(new Label("Asymmetry factor "
      + MZmineCore.getConfiguration().getRTFormat().format(feature.getAsymmetryFactor())));
  featureDataSummary.add(new Label("Tailing Factor factor "
      + MZmineCore.getConfiguration().getRTFormat().format(feature.getTailingFactor())));
  featureDataSummary.add(new Label("Status: " + feature.getFeatureStatus()));
  return featureDataNode;
}
 
Example 3
Source Project: chart-fx   Source File: RunDataSetSamples.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void start(final Stage primaryStage) {
    final BorderPane root = new BorderPane();

    final FlowPane buttons = new FlowPane();
    buttons.setAlignment(Pos.CENTER_LEFT);
    root.setCenter(buttons);
    root.setBottom(makeScreenShot);

    buttons.getChildren().add(new MyButton("DataSetToByteArraySample", () -> DataSetToByteArraySample.main(null)));

    final Scene scene = new Scene(root);

    primaryStage.setTitle(this.getClass().getSimpleName());
    primaryStage.setScene(scene);
    primaryStage.setOnCloseRequest(evt -> Platform.exit());
    primaryStage.show();
}
 
Example 4
Source Project: cssfx   Source File: CSSFXTesterApp.java    License: Apache License 2.0 6 votes vote down vote up
private Node createButtonBar() {
    FlowPane fp = new FlowPane();
    fp.getStyleClass().addAll("button-bar", "bottom");
    
    Button gcAction = new Button("Force GC");
    gcAction.addEventHandler(ActionEvent.ACTION, e -> {
        System.out.println("Forcing a GC");
        System.gc();
    });
    
    Button fakeAction = new Button("Action");
    fakeAction.addEventHandler(ActionEvent.ACTION, e -> System.out.println("You clicked the fake action button"));
    
    fp.getChildren().addAll(gcAction, fakeAction);
    String buttonBarCSSUri = getClass().getResource("bottom.css").toExternalForm();
    fp.getStylesheets().add(buttonBarCSSUri);

    return fp;
}
 
Example 5
Source Project: chart-fx   Source File: RunUiSamples.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void start(final Stage primaryStage) {
    final BorderPane root = new BorderPane();

    final FlowPane buttons = new FlowPane();
    buttons.setAlignment(Pos.CENTER_LEFT);
    root.setCenter(buttons);
    root.setBottom(makeScreenShot);

    buttons.getChildren().add(new MyButton("AcqButtonTests", new AcqButtonTests()));

    final Scene scene = new Scene(root);

    primaryStage.setTitle(this.getClass().getSimpleName());
    primaryStage.setScene(scene);
    primaryStage.setOnCloseRequest(evt -> System.exit(0));
    primaryStage.show();
}
 
Example 6
Source Project: houdoku   Source File: LayoutHelpers.java    License: MIT License 6 votes vote down vote up
/**
 * Create the container for displaying a series cover, for use in FlowPane layouts where covers
 * are shown in a somewhat grid-like fashion. However this includes a count of the amount of
 * chapters that have been marked as read. The count is displayed in the top right corner.
 *
 * @param container         the parent FlowPane container
 * @param title             the title of the series being represented
 * @param cover             the cover of the series being represented; this ImageView is not
 *                          modified, a copy is made to be used in the new container
 * @param numUnreadChapters the amount of Chapters that have been marked as unread
 * @return a StackPane which displays the provided title and cover and can be added to the
 *         FlowPane
 */
public static StackPane createCoverContainer(FlowPane container, String title, ImageView cover,
        int numUnreadChapters) {
    String amountOfReadChapters = String.valueOf(numUnreadChapters);
    
    // create the label for showing the amount of chapters marked as read
    Label label = new Label();
    label.setText(amountOfReadChapters);
    label.getStyleClass().add("coverLabel");
    label.setWrapText(true);
    
    // this label will be situated in the top right as the title is located in the bottom left
    StackPane.setAlignment(label, Pos.TOP_RIGHT);
    
    // We call the other createCoverContainer method to provide a filled stackpane with the
    // title and cover
    StackPane pane = createCoverContainer(container, title, cover);
    pane.getChildren().add(label);

    return pane;
}
 
Example 7
Source Project: marathonv5   Source File: FlowPaneSample.java    License: Apache License 2.0 6 votes vote down vote up
public FlowPaneSample() {
    super(400, 400);

    FlowPane flowPane = new FlowPane(2, 4);
    flowPane.setPrefWrapLength(200); //preferred wraplength
    Label[] shortLabels = new Label[ITEMS];
    Label[] longLabels = new Label[ITEMS];
    ImageView[] imageViews = new ImageView[ITEMS];

    for (int i = 0; i < ITEMS; i++) {
        shortLabels[i] = new Label("Short label.");
        longLabels[i] = new Label("I am a slightly longer label.");
        imageViews[i] = new ImageView(ICON_48);
        flowPane.getChildren().addAll(shortLabels[i], longLabels[i], imageViews[i]);
    }
    getChildren().add(flowPane);
}
 
Example 8
Source Project: marathonv5   Source File: FlowPaneSample.java    License: Apache License 2.0 6 votes vote down vote up
public static Node createIconContent() {
    StackPane sp = new StackPane();
    FlowPane fp = new FlowPane();
    fp.setAlignment(Pos.CENTER);

    Rectangle rectangle = new Rectangle(62, 62, Color.LIGHTGREY);
    rectangle.setStroke(Color.BLACK);
    fp.setPrefSize(rectangle.getWidth(), rectangle.getHeight());

    Rectangle[] littleRecs = new Rectangle[4];
    Rectangle[] bigRecs = new Rectangle[4];
    for (int i = 0; i < 4; i++) {
        littleRecs[i] = new Rectangle(14, 14, Color.web("#1c89f4"));
        bigRecs[i] = new Rectangle(16, 12, Color.web("#349b00"));
        fp.getChildren().addAll(littleRecs[i], bigRecs[i]);
        FlowPane.setMargin(littleRecs[i], new Insets(2, 2, 2, 2));
    }
    sp.getChildren().addAll(rectangle, fp);
    return new Group(sp);
}
 
Example 9
Source Project: marathonv5   Source File: FlowPaneSample.java    License: Apache License 2.0 6 votes vote down vote up
public FlowPaneSample() {
    super(400, 400);

    FlowPane flowPane = new FlowPane(2, 4);
    flowPane.setPrefWrapLength(200); //preferred wraplength
    Label[] shortLabels = new Label[ITEMS];
    Label[] longLabels = new Label[ITEMS];
    ImageView[] imageViews = new ImageView[ITEMS];

    for (int i = 0; i < ITEMS; i++) {
        shortLabels[i] = new Label("Short label.");
        longLabels[i] = new Label("I am a slightly longer label.");
        imageViews[i] = new ImageView(ICON_48);
        flowPane.getChildren().addAll(shortLabels[i], longLabels[i], imageViews[i]);
    }
    getChildren().add(flowPane);
}
 
Example 10
Source Project: cssfx   Source File: CSSFXTesterApp.java    License: Apache License 2.0 6 votes vote down vote up
public Parent buildUI() {
    BorderPane bp = new BorderPane();

    int prefWidth = 300;
    int prefHeight = 200;

    Button btnShowBottomBar = new Button("Dynamic bottom bar");
    btnShowBottomBar.setId("dynamicBar");
    btnShowBottomBar.setOnAction((ae) -> bp.setBottom(createButtonBar()));
    btnLoadOddCSS = new Button("Load additional CSS");
    btnLoadOddCSS.setId("dynamicCSS");
    Button btnCreateStage = new Button("Create new stage");
    btnCreateStage.setOnAction(ae -> {
        Stage stage = new Stage();
        fillStage(stage);
        stage.show();
    });
    btnCreateStage.setId("dynamicStage");
    FlowPane topBar = new FlowPane(btnShowBottomBar, btnLoadOddCSS, btnCreateStage);

    topBar.getStyleClass().addAll("button-bar", "top");

    bp.setTop(topBar);
    bp.setCenter(buildCirclePane(prefWidth, prefHeight));
    return bp;
}
 
Example 11
@Override 
public void addLayout(String layout) {
    if ("StartLine".equals(layout)) {
        HBox lastPane = new HBox();
        lastPane.getStyleClass().add("linecontainer");
        VBox.setVgrow(lastPane, Priority.NEVER);
        container.getChildren().add(lastPane);
    } else if ("StartFlow".equals(layout)) {
        FlowPane flow = new FlowPane();
        flow.getStyleClass().add("linecontainer");
        VBox.setVgrow(flow, Priority.NEVER);    
        container.getChildren().add(flow);
    } else {
        throw new IllegalArgumentException("Layout not supported: " + layout);
    }
}
 
Example 12
/**
 * {@inheritDoc}
 */
@Override
public void initialise() {
    final Text title = new Text(tr("Engine tools"));
    title.getStyleClass().add("title");

    final FlowPane toolButtonContainer = createToolButtonContainer();

    final VBox toolsPane = new VBox(title, toolButtonContainer);
    toolsPane.getStyleClass().addAll("containerConfigurationPane");

    final ScrollPane scrollPane = new ScrollPane(toolsPane);
    scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
    scrollPane.setFitToWidth(true);

    getChildren().addAll(scrollPane);
}
 
Example 13
Source Project: logbook-kai   Source File: ShipTablePane.java    License: MIT License 6 votes vote down vote up
@Override
protected void updateItem(Set<String> labels, boolean empty) {
    super.updateItem(labels, empty);

    if (!empty) {
        FlowPane pane = new FlowPane();
        for (String label : labels) {
            Button button = new Button(label);
            button.setStyle("-fx-color: " + this.colorCode(label.hashCode()));
            button.setOnAction(this::handle);
            pane.getChildren().add(button);
        }
        this.setGraphic(pane);
        this.setText(null);
    } else {
        this.setGraphic(null);
        this.setText(null);
    }
}
 
Example 14
Source Project: bisq   Source File: FormBuilder.java    License: GNU Affero General Public License v3.0 6 votes vote down vote up
public static Tuple2<Label, FlowPane> addTopLabelFlowPane(GridPane gridPane,
                                                          int rowIndex,
                                                          String title,
                                                          double top,
                                                          double bottom) {
    FlowPane flowPane = new FlowPane();
    flowPane.setPadding(new Insets(10, 10, 10, 10));
    flowPane.setVgap(10);
    flowPane.setHgap(10);
    final Tuple2<Label, VBox> topLabelWithVBox = addTopLabelWithVBox(gridPane, rowIndex, title, flowPane, top);

    GridPane.setMargin(topLabelWithVBox.second, new Insets(top + Layout.FLOATING_LABEL_DISTANCE,
            0, bottom, 0));

    return new Tuple2<>(topLabelWithVBox.first, flowPane);
}
 
Example 15
void fillUpFlowPaneWithCurrencies(boolean isEditable, FlowPane flowPane,
                                  TradeCurrency e, PaymentAccount paymentAccount) {
    CheckBox checkBox = new AutoTooltipCheckBox(e.getCode());
    checkBox.setMouseTransparent(!isEditable);
    checkBox.setSelected(paymentAccount.getTradeCurrencies().contains(e));
    checkBox.setMinWidth(60);
    checkBox.setMaxWidth(checkBox.getMinWidth());
    checkBox.setTooltip(new Tooltip(e.getName()));
    checkBox.setOnAction(event -> {
        if (checkBox.isSelected())
            paymentAccount.addCurrency(e);
        else
            paymentAccount.removeCurrency(e);

        updateAllInputsValid();
    });
    flowPane.getChildren().add(checkBox);
}
 
Example 16
@Override
public void start(Stage primaryStage) {
    ScrollPane scrollPane = new ScrollPane();
    scrollPane.setFitToWidth(true);

    FlowPane flowPane = new FlowPane();
    flowPane.setStyle("-fx-background-color: #ddd;");
    flowPane.setHgap(2);
    flowPane.setVgap(2);
    List<MaterialDesignIcon> values = new ArrayList<>(Arrays.asList(MaterialDesignIcon.values()));
    values.sort(Comparator.comparing(Enum::name));
    for (MaterialDesignIcon icon : values) {
        Button button = MaterialDesignIconFactory.get().createIconButton(icon, icon.name());
        flowPane.getChildren().add(button);
    }

    scrollPane.setContent(flowPane);

    primaryStage.setScene(new Scene(scrollPane, 1200, 950));
    primaryStage.show();
}
 
Example 17
Source Project: bisq   Source File: AwesomeFontDemo.java    License: GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
public void start(Stage primaryStage) {
    FlowPane flowPane = new FlowPane();
    flowPane.setStyle("-fx-background-color: #ddd;");
    flowPane.setHgap(2);
    flowPane.setVgap(2);
    List<AwesomeIcon> values = new ArrayList<>(Arrays.asList(AwesomeIcon.values()));
    values.sort((o1, o2) -> o1.name().compareTo(o2.name()));
    for (AwesomeIcon icon : values) {
        Label label = new Label();
        Button button = new Button(icon.name(), label);
        button.setStyle("-fx-background-color: #fff;");
        AwesomeDude.setIcon(label, icon, "12");
        flowPane.getChildren().add(button);
    }

    primaryStage.setScene(new Scene(flowPane, 1200, 950));
    primaryStage.show();
}
 
Example 18
private FlowPane createRepoPane(Insets padding) {
    FlowPane repo = new FlowPane();
    repo.setHgap(5);
    repo.setVgap(5);
    repo.setPadding(padding);
    return repo;
}
 
Example 19
Source Project: constellation   Source File: PluginParametersDialog.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Display a dialog box containing the parameters that allows the user to
 * enter values.
 *
 * @param owner The owner for this stage.
 * @param title The dialog box title.
 * @param parameters The plugin parameters.
 * @param options The dialog box button labels, one for each button.
 */
public PluginParametersDialog(final Stage owner, final String title, final PluginParameters parameters, final String... options) {
    initStyle(StageStyle.UTILITY);
    initModality(Modality.WINDOW_MODAL);
    initOwner(owner);

    setTitle(title);

    final BorderPane root = new BorderPane();
    root.setPadding(new Insets(10));
    root.setStyle("-fx-background-color: #DDDDDD;");
    final Scene scene = new Scene(root);
    setScene(scene);

    final PluginParametersPane parametersPane = PluginParametersPane.buildPane(parameters, null);
    root.setCenter(parametersPane);

    final FlowPane buttonPane = new FlowPane();
    buttonPane.setAlignment(Pos.BOTTOM_RIGHT);
    buttonPane.setPadding(new Insets(5));
    buttonPane.setHgap(5);
    root.setBottom(buttonPane);

    final String[] labels = options != null && options.length > 0 ? options : new String[]{OK, CANCEL};
    for (final String option : labels) {
        final Button okButton = new Button(option);
        okButton.setOnAction(event -> {
            result = option;
            parameters.storeRecentValues();
            PluginParametersDialog.this.hide();
        });
        buttonPane.getChildren().add(okButton);
    }

    // Without this, some parameter panes have a large blank area at the bottom. Huh?
    this.sizeToScene();

    result = null;
}
 
Example 20
private void updateNewlyAddedAssignee(List<PickerAssignee> users, FlowPane assignedUserPane) {
    users.stream()
            .filter(user -> !user.isExisting() && user.isSelected())
            .forEach(user -> assignedUserPane.getChildren().add(
                    setMouseClickForNode(user.getNewlyAssignedAssigneeNode(),
                            user.getLoginName())
            ));
}
 
Example 21
Source Project: houdoku   Source File: LayoutHelpers.java    License: MIT License 5 votes vote down vote up
/**
 * Create the container for displaying a series cover, for use in FlowPane layouts where covers
 * are shown in a somewhat grid-like fashion.
 *
 * @param container the parent FlowPane container
 * @param title     the title of the series being represented
 * @param cover     the cover of the series being represented; this ImageView is not modified, a
 *                  copy is made to be used in the new container
 * @return a StackPane which displays the provided title and cover and can be added to the
 *         FlowPane
 */
public static StackPane createCoverContainer(FlowPane container, String title,
        ImageView cover) {
    StackPane result_pane = new StackPane();
    result_pane.setAlignment(Pos.BOTTOM_LEFT);

    // create the label for showing the series title
    Label label = new Label();
    label.setText(title);
    label.getStyleClass().add("coverLabel");
    label.setWrapText(true);

    // We create a new ImageView for the cell instead of using the result's cover ImageView
    // since we may not want to mess with the sizing of the result's cover -- particularly if we
    // want to have additional result layouts.
    ImageView image_view = new ImageView();
    applyCoverSizing(image_view);
    image_view.fitWidthProperty().bind(result_pane.prefWidthProperty());
    image_view.imageProperty().bind(cover.imageProperty());

    image_view.setEffect(COVER_ADJUST_DEFAULT);
    image_view.getStyleClass().add("coverImage");

    // create the mouse event handlers for the result pane
    result_pane.setOnMouseEntered(t -> {
        image_view.setEffect(COVER_ADJUST_HOVER);
        setChildButtonVisible(result_pane, true);
    });
    result_pane.setOnMouseExited(t -> {
        image_view.setEffect(COVER_ADJUST_DEFAULT);
        setChildButtonVisible(result_pane, false);
    });

    result_pane.getChildren().addAll(image_view, label);

    return result_pane;
}
 
Example 22
@Test
public void testDnDInsertTemplate() {
	final var producedCmds = new ArrayList<>();
	final var disposable = CommandsRegistry.getInstance().commands().subscribe(producedCmds::add);
	final ImageView view = new ImageView(new Image(getClass().getResourceAsStream("/Condenser.svg.png"))); //NON-NLS
	view.setUserData(getClass().getResource("/Condenser.svg").getPath());
	final FlowPane pane = find("#templatePane");
	Cmds.of(
		CmdFXVoid.of(() -> pane.getChildren().add(0, view)),
		() -> drag(pane.getChildren().get(0)).dropTo(canvas)).execute();
	disposable.dispose();
	assertEquals(1, canvas.getDrawing().size());
	assertThat(producedCmds).hasSize(1);
	assertThat(producedCmds.get(0)).isInstanceOf(LoadTemplate.class);
}
 
Example 23
AssetsManagerDialog(Window parent, String assetsType) {
	super(parent, new ArrayList<>());

	setId("assets-manager-"+assetsType);
	setTitle(Main.getString("assets-manager")+": "+assetsType);

	bottom = new FlowPane();

	pane = new BorderPane();
	pane.setCenter(filesList);
	pane.setBottom(bottom);

	getDialogPane().setContent(pane);

	type = assetsType;

	folder = Main.getPluginProxy().getAssetsDirPath().resolve(assetsType);
	bottom.getChildren().add(
			new PluginOptionsControlItem.HyperlinkItem(
					folder.getAbsolutePath(),
					Main.getString("open-folder")).getNode()
	);

	filesFolderStrLength = folder.getAbsolutePath().length() + 1;

	ObservableList<String> newFiles = FXCollections.observableArrayList();
	for (String file : filesList.getItems())
		newFiles.add(file.substring(filesFolderStrLength));

	filesList.setItems(newFiles);

}
 
Example 24
public SearchRolloutHistogramPluginView(final SearchRolloutHistogramPluginModel model) {
	super(model, new FlowPane());
	this.histogram = new Histogram(this.n);
	this.histogram.setTitle("Search Rollout Performances");
	Platform.runLater(() -> {
		this.getNode().getChildren().add(this.histogram);
	});
}
 
Example 25
public SearchRolloutBoxplotPluginView(final SearchRolloutBoxplotPluginModel model) {
	super(model, new FlowPane());
	Platform.runLater(() -> {
		WebView view = new WebView();
		FlowPane node = this.getNode();
		node.getChildren().add(view);
		this.engine = view.getEngine();
		this.engine.loadContent("Nothing there yet.");
		node.getChildren().add(this.left);
		node.getChildren().add(this.right);
		node.getChildren().add(this.parent);
		//			node.getChildren().add(this.leftChart);
		//			node.getChildren().add(this.rightChart);
		this.left.setOnMouseClicked(e -> {
			DefaultGUIEventBus.getInstance().postEvent(new NodeClickedEvent(null, this.getLeftChild(model.getCurrentlySelectedNode())));
			this.parent.setDisable(false);
		});
		this.right.setOnMouseClicked(e -> {
			DefaultGUIEventBus.getInstance().postEvent(new NodeClickedEvent(null, this.getRightChild(model.getCurrentlySelectedNode())));
			this.parent.setDisable(false);
		});
		this.parent.setOnMouseClicked(e -> {
			String parentOfCurrent = this.getModel().getParentOfCurrentNode();
			DefaultGUIEventBus.getInstance().postEvent(new NodeClickedEvent(null, parentOfCurrent));
			if (!this.getModel().getParents().containsKey(parentOfCurrent)) {
				this.parent.setDisable(true);
			}
		});
	});
}
 
Example 26
public BradleyTerryPluginView(final BradleyTerryPluginModel model) {
	super(model, new FlowPane());
	Platform.runLater(() -> {
		WebView view = new WebView();
		FlowPane node = this.getNode();
		node.getChildren().add(this.left);
		node.getChildren().add(this.right);
		node.getChildren().add(this.parent);
		this.left.setOnMouseClicked(e -> {
			DefaultGUIEventBus.getInstance().postEvent(new NodeClickedEvent(null, this.getLeftChild(model.getCurrentlySelectedNode())));
			this.parent.setDisable(false);
		});
		this.right.setOnMouseClicked(e -> {
			DefaultGUIEventBus.getInstance().postEvent(new NodeClickedEvent(null, this.getRightChild(model.getCurrentlySelectedNode())));
			this.parent.setDisable(false);
		});
		this.parent.setOnMouseClicked(e -> {
			String parentOfCurrent = this.getModel().getParentOfCurrentNode();
			DefaultGUIEventBus.getInstance().postEvent(new NodeClickedEvent(null, parentOfCurrent));
			if (!this.getModel().getParents().containsKey(parentOfCurrent)) {
				this.parent.setDisable(true);
			}
		});

		node.getChildren().add(view);
		this.engine = view.getEngine();
		this.engine.loadContent("Nothing there yet.");
	});
}
 
Example 27
Source Project: JFoenix   Source File: AnimationDemo.java    License: Apache License 2.0 5 votes vote down vote up
FlowPaneStackPaneJFXNodesAnimation(final FlowPane main, final StackPane nextPage, final StackPane wizard,
                                   final StackPane colorPane1) {
    super(main, nextPage);
    this.main = main;
    this.nextPage = nextPage;
    this.wizard = wizard;
    this.colorPane1 = colorPane1;
    tempPage = new Pane();
    newX = 0;
    newY = 0;
}
 
Example 28
Source Project: JFoenix   Source File: CheckBoxDemo.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void start(Stage stage) {

    FlowPane main = new FlowPane();
    main.setVgap(20);
    main.setHgap(20);

    CheckBox cb = new CheckBox("CheckBox");
    JFXCheckBox jfxCheckBox = new JFXCheckBox("JFX CheckBox");
    JFXCheckBox customJFXCheckBox = new JFXCheckBox("Custom JFX CheckBox");
    customJFXCheckBox.getStyleClass().add("custom-jfx-check-box");

    main.getChildren().add(cb);
    main.getChildren().add(jfxCheckBox);
    main.getChildren().add(customJFXCheckBox);

    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, 600, 200);
    scene.getStylesheets().add(CheckBoxDemo.class.getResource("/css/jfoenix-components.css").toExternalForm());
    stage.setTitle("JFX CheckBox Demo ");
    stage.setScene(scene);
    stage.setResizable(false);
    stage.show();

}
 
Example 29
Source Project: JFoenix   Source File: DatePickerDemo.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void start(Stage stage) {

    FlowPane main = new FlowPane();
    main.setVgap(20);
    main.setHgap(20);


    DatePicker datePicker = new DatePicker();

    main.getChildren().add(datePicker);
    JFXDatePicker datePickerFX = new JFXDatePicker();

    main.getChildren().add(datePickerFX);
    datePickerFX.setPromptText("pick a date");
    JFXTimePicker blueDatePicker = new JFXTimePicker();
    blueDatePicker.setDefaultColor(Color.valueOf("#3f51b5"));
    blueDatePicker.setOverLay(true);
    main.getChildren().add(blueDatePicker);


    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, 400, 700);
    final ObservableList<String> stylesheets = scene.getStylesheets();
    stylesheets.addAll(MainDemo.class.getResource("/css/jfoenix-fonts.css").toExternalForm(),
                       MainDemo.class.getResource("/css/jfoenix-design.css").toExternalForm());
    stage.setTitle("JFX Date Picker Demo");
    stage.setScene(scene);
    stage.show();

}
 
Example 30
Source Project: JFoenix   Source File: ButtonDemo.java    License: Apache License 2.0 5 votes vote down vote up
@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");
    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("/css/jfoenix-components.css").toExternalForm());
    stage.setTitle("JFX Button Demo");
    stage.setScene(scene);
    stage.show();
}