javafx.scene.layout.FlowPane Java Examples

The following examples show how to use javafx.scene.layout.FlowPane. 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 check out the related API usage on the sidebar.
Example #1
Source File: AwesomeFontDemo.java    From bisq with GNU Affero General Public License v3.0 8 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 #2
Source File: FlowPaneSample.java    From marathonv5 with 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 #3
Source File: CSSFXTesterApp.java    From cssfx with 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 #4
Source File: RunDataSetSamples.java    From chart-fx with 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 #5
Source File: FlowPaneSample.java    From marathonv5 with 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 #6
Source File: PaymentMethodForm.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
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 #7
Source File: FlowPaneSample.java    From marathonv5 with 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 #8
Source File: FeatureOverviewWindow.java    From mzmine3 with GNU General Public License v2.0 6 votes vote down vote up
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 #9
Source File: RunUiSamples.java    From chart-fx with 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 #10
Source File: MaterialDesignIconDemo.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
@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 #11
Source File: HistogramDialog.java    From mzmine3 with 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 #12
Source File: CSSFXTesterApp.java    From cssfx with 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 #13
Source File: FormBuilder.java    From bisq with 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 #14
Source File: UnitsContainerClassic.java    From helloiot with GNU General Public License v3.0 6 votes vote down vote up
@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 #15
Source File: ContainerEngineToolsPanelSkin.java    From phoenicis with GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * {@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 #16
Source File: ShipTablePane.java    From logbook-kai with 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 #17
Source File: LayoutHelpers.java    From houdoku with 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 #18
Source File: RevolutForm.java    From bisq with GNU Affero General Public License v3.0 5 votes vote down vote up
private void addCurrenciesGrid(boolean isEditable) {
    FlowPane flowPane = addTopLabelFlowPane(gridPane, ++gridRow,
            Res.get("payment.supportedCurrencies"), Layout.FLOATING_LABEL_DISTANCE * 3,
            Layout.FLOATING_LABEL_DISTANCE * 3).second;

    if (isEditable)
        flowPane.setId("flow-pane-checkboxes-bg");
    else
        flowPane.setId("flow-pane-checkboxes-non-editable-bg");

    CurrencyUtil.getAllRevolutCurrencies().forEach(e ->
            fillUpFlowPaneWithCurrencies(isEditable, flowPane, e, account));
}
 
Example #19
Source File: TestTemplateManager.java    From latexdraw with GNU General Public License v3.0 5 votes vote down vote up
@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 #20
Source File: PresetHandler.java    From game-of-life-java with MIT License 5 votes vote down vote up
private VBox createPresetPage(int pageIndex, FlowPane base) {
    VBox box = new VBox(5);
    for (int i = pageIndex; i < pageIndex + 1; i++) {
        TextArea text = new TextArea(presets[i]);
        text.setWrapText(true);
        currentPreset = Character.toUpperCase(presets[i].charAt(0)) + presets[i].substring(1);
        Label l = new Label(currentPreset);

        HBox nameAndOpen = new HBox(5);
        nameAndOpen.getChildren().addAll(l);
        File f1 = new File("Presets/"+presets[i]+".png");
        if(f1.exists() && !f1.isDirectory()) { 
            Image myPreset = new Image("file:Presets/"+presets[i]+".png");
            ImageView myPresetView = new ImageView();
            myPresetView.setImage(myPreset);
            box.getChildren().add(myPresetView);
        } else {
            File f = new File("Presets/nopreview.png");
            if(f.exists() && !f.isDirectory()) { 
                Image noprevImg = new Image("file:Presets/nopreview.png"); //new Image("Presets/nopreview.png");
                ImageView noprev = new ImageView();
                noprev.setImage(noprevImg);
                box.getChildren().add(noprev);
            } else {
                System.out.println("nopreview.png not found");
            }
        }

        box.getChildren().add(nameAndOpen);
    }
    return box;
}
 
Example #21
Source File: DatePickerDemo.java    From JFoenix with 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 #22
Source File: AssetsManagerDialog.java    From DeskChan with GNU Lesser General Public License v3.0 5 votes vote down vote up
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 #23
Source File: SearchRolloutHistogramPluginView.java    From AILibs with GNU Affero General Public License v3.0 5 votes vote down vote up
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 #24
Source File: SearchRolloutBoxplotPluginView.java    From AILibs with GNU Affero General Public License v3.0 5 votes vote down vote up
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 #25
Source File: BradleyTerryPluginView.java    From AILibs with GNU Affero General Public License v3.0 5 votes vote down vote up
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 #26
Source File: DemoMulti.java    From Enzo with Apache License 2.0 5 votes vote down vote up
@Override public void start(Stage stage) {
    FlowPane pane = new FlowPane();
    pane.getChildren().addAll(gauges);

    Scene scene = new Scene(pane, 500, 500, Color.WHITE);

    stage.setTitle("Gauge");
    stage.setScene(scene);
    stage.show();

    calcNoOfNodes(scene.getRoot());
    System.out.println("No. of nodes in scene: " + noOfNodes);

    timer.start();
}
 
Example #27
Source File: ContainerEngineToolsPanelSkin.java    From phoenicis with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Creates a container for all the tool buttons
 *
 * @return A container containing all the tool buttons
 */
private FlowPane createToolButtonContainer() {
    final FlowPane toolsContentPane = new FlowPane();
    toolsContentPane.getStyleClass().add("grid");

    Bindings.bindContent(toolsContentPane.getChildren(), toolButtons);

    return toolsContentPane;
}
 
Example #28
Source File: ButtonDemo.java    From JFoenix with 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();
}
 
Example #29
Source File: AnimationDemo.java    From JFoenix with 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 #30
Source File: CheckBoxDemo.java    From JFoenix with 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();

}