Java Code Examples for javafx.scene.control.Separator#setOrientation()

The following examples show how to use javafx.scene.control.Separator#setOrientation() . 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: FileDownItem.java    From oim-fx with MIT License 6 votes vote down vote up
private void initComponent() {

		Separator separator = new Separator();
		separator.setOrientation(Orientation.HORIZONTAL);

		saveAsButton.setText("另存为");
		saveAsButton.setPrefSize(80, 20);

		buttonBox.setAlignment(Pos.BASELINE_RIGHT);
		buttonBox.setPadding(new Insets(0, 10, 5, 10));
		buttonBox.setSpacing(10);
		buttonBox.getChildren().add(saveAsButton);

		vBox.getChildren().add(buttonBox);

		bottomBox.getChildren().add(vBox);
		bottomBox.getChildren().add(separator);
		this.setBottom(bottomBox);
	}
 
Example 2
Source File: NewsView.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
protected void initialize() {
    root.setSpacing(20);

    AnchorPane bisqDAOPane = createBisqDAOContent();
    HBox.setHgrow(bisqDAOPane, Priority.SOMETIMES);
    Separator separator = new Separator();
    separator.setOrientation(Orientation.VERTICAL);
    HBox.setHgrow(separator, Priority.NEVER);
    GridPane bisqDAOOnTestnetPane = createBisqDAOOnTestnetContent();
    HBox.setHgrow(bisqDAOOnTestnetPane, Priority.SOMETIMES);
    Pane spacer = new Pane();
    HBox.setHgrow(spacer, Priority.ALWAYS);

    root.getChildren().addAll(bisqDAOPane, separator, bisqDAOOnTestnetPane, spacer);
}
 
Example 3
Source File: MutableOfferView.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
private GridPane createInfoPopover() {
    GridPane infoGridPane = new GridPane();
    infoGridPane.setHgap(5);
    infoGridPane.setVgap(5);
    infoGridPane.setPadding(new Insets(10, 10, 10, 10));

    int i = 0;
    if (model.isSellOffer())
        addPayInfoEntry(infoGridPane, i++, Res.getWithCol("shared.tradeAmount"), model.tradeAmount.get());

    addPayInfoEntry(infoGridPane, i++, Res.getWithCol("shared.yourSecurityDeposit"), model.getSecurityDepositInfo());
    addPayInfoEntry(infoGridPane, i++, Res.get("createOffer.fundsBox.offerFee"), model.getTradeFee());
    addPayInfoEntry(infoGridPane, i++, Res.get("createOffer.fundsBox.networkFee"), model.getTxFee());
    Separator separator = new Separator();
    separator.setOrientation(Orientation.HORIZONTAL);
    separator.getStyleClass().add("offer-separator");
    GridPane.setConstraints(separator, 1, i++);
    infoGridPane.getChildren().add(separator);
    addPayInfoEntry(infoGridPane, i, Res.getWithCol("shared.total"), model.getTotalToPayInfo());
    return infoGridPane;
}
 
Example 4
Source File: TakeOfferView.java    From bisq with GNU Affero General Public License v3.0 6 votes vote down vote up
private GridPane createInfoPopover() {
    GridPane infoGridPane = new GridPane();
    infoGridPane.setHgap(5);
    infoGridPane.setVgap(5);
    infoGridPane.setPadding(new Insets(10, 10, 10, 10));

    int i = 0;
    if (model.isSeller())
        addPayInfoEntry(infoGridPane, i++, Res.get("takeOffer.fundsBox.tradeAmount"), model.getTradeAmount());

    addPayInfoEntry(infoGridPane, i++, Res.getWithCol("shared.yourSecurityDeposit"), model.getSecurityDepositInfo());
    addPayInfoEntry(infoGridPane, i++, Res.get("takeOffer.fundsBox.offerFee"), model.getTradeFee());
    addPayInfoEntry(infoGridPane, i++, Res.get("takeOffer.fundsBox.networkFee"), model.getTxFee());
    Separator separator = new Separator();
    separator.setOrientation(Orientation.HORIZONTAL);
    separator.getStyleClass().add("offer-separator");
    GridPane.setConstraints(separator, 1, i++);
    infoGridPane.getChildren().add(separator);
    addPayInfoEntry(infoGridPane, i, Res.getWithCol("shared.total"),
            model.getTotalToPayInfo());

    return infoGridPane;
}
 
Example 5
Source File: CSeparator.java    From Open-Lowcode with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Node getNode(
		PageActionManager actionmanager,
		CPageData inputdata,
		Window parentwindow,
		TabPane[] parenttabpanes,
		CollapsibleNode nodetocollapsewhenactiontriggered) {
	Separator separator = new Separator();
	if (!horizontal)
		separator.setOrientation(Orientation.VERTICAL);
	return separator;
}
 
Example 6
Source File: Zoomer.java    From chart-fx with Apache License 2.0 5 votes vote down vote up
public HBox getZoomInteractorBar() {
    final Separator separator = new Separator();
    separator.setOrientation(Orientation.VERTICAL);
    final HBox buttonBar = new HBox();
    buttonBar.setPadding(new Insets(1, 1, 1, 1));
    final Button zoomOut = new Button(null, new Glyph(FONT_AWESOME, "\uf0b2").size(FONT_SIZE));
    zoomOut.setPadding(new Insets(3, 3, 3, 3));
    zoomOut.setTooltip(new Tooltip("zooms to origin and enables auto-ranging"));
    final Button zoomModeXY = new Button(null, new Glyph(FONT_AWESOME, "\uf047").size(FONT_SIZE));
    zoomModeXY.setPadding(new Insets(3, 3, 3, 3));
    zoomModeXY.setTooltip(new Tooltip("set zoom-mode to X & Y range (N.B. disables auto-ranging)"));
    final Button zoomModeX = new Button(null, new Glyph(FONT_AWESOME, "\uf07e").size(FONT_SIZE));
    zoomModeX.setPadding(new Insets(3, 3, 3, 3));
    zoomModeX.setTooltip(new Tooltip("set zoom-mode to X range (N.B. disables auto-ranging)"));
    final Button zoomModeY = new Button(null, new Glyph(FONT_AWESOME, "\uf07d").size(FONT_SIZE));
    zoomModeY.setPadding(new Insets(3, 3, 3, 3));
    zoomModeY.setTooltip(new Tooltip("set zoom-mode to Y range (N.B. disables auto-ranging)"));

    zoomOut.setOnAction(evt -> {
        zoomOrigin();
        for (final Axis axis : getChart().getAxes()) {
            axis.setAutoRanging(true);
        }
    });
    zoomModeXY.setOnAction(evt -> setAxisMode(AxisMode.XY));
    zoomModeX.setOnAction(evt -> setAxisMode(AxisMode.X));
    zoomModeY.setOnAction(evt -> setAxisMode(AxisMode.Y));
    buttonBar.getChildren().addAll(separator, zoomOut, zoomModeXY, zoomModeX, zoomModeY);
    return buttonBar;
}
 
Example 7
Source File: TableViewer.java    From chart-fx with Apache License 2.0 5 votes vote down vote up
/**
 * Helper function to initialize the UI elements for the Interactor toolbar.
 * 
 * @return HBox node with the toolbar elements
 */
protected HBox getInteractorBar() {
    final Separator separator = new Separator();
    separator.setOrientation(Orientation.VERTICAL);
    final HBox buttonBar = new HBox();
    buttonBar.setPadding(new Insets(1, 1, 1, 1));
    final Button switchTableView = new Button(null, tableView);
    switchTableView.setPadding(new Insets(3, 3, 3, 3));
    switchTableView.setTooltip(new Tooltip("switches between graph and table view"));

    final Button copyToClipBoard = new Button(null, clipBoardIcon);
    copyToClipBoard.setPadding(new Insets(3, 3, 3, 3));
    copyToClipBoard.setTooltip(new Tooltip("copy selected content top system clipboard"));
    copyToClipBoard.setOnAction(e -> this.copySelectedToClipboard());

    final Button saveTableView = new Button(null, saveIcon);
    saveTableView.setPadding(new Insets(3, 3, 3, 3));
    saveTableView.setTooltip(new Tooltip("store actively shown content as .csv file"));
    saveTableView.setOnAction(e -> this.exportGridToCSV());

    switchTableView.setOnAction(evt -> {
        switchTableView.setGraphic(table.isVisible() ? tableView : graphView);
        table.setVisible(!table.isVisible());
        getChart().getPlotForeground().setMouseTransparent(!table.isVisible());
        table.setMouseTransparent(!table.isVisible());
        dsModel.datasetsChanged(null);
    });

    buttonBar.getChildren().addAll(separator, switchTableView, copyToClipBoard, saveTableView);
    return buttonBar;
}
 
Example 8
Source File: FileUpItem.java    From oim-fx with MIT License 5 votes vote down vote up
private void initComponent() {
	Separator separator = new Separator();
	separator.setOrientation(Orientation.HORIZONTAL);

	// vBox.getChildren().add(buttonBox);

	bottomBox.getChildren().add(vBox);
	bottomBox.getChildren().add(separator);
	this.setBottom(bottomBox);
}
 
Example 9
Source File: Screenshot.java    From chart-fx with Apache License 2.0 4 votes vote down vote up
/**
 * @return A node with screenshot buttons which can be inserted into the toolbar
 */
public HBox getScreenshotInteractorBar() {
    final HBox buttonBar = new HBox();
    final Separator separator = new Separator();
    separator.setOrientation(Orientation.VERTICAL);
    SplitMenuButton button = new SplitMenuButton();
    button.setGraphic(new HBox(0.1, new Glyph(FONT_AWESOME, FontAwesome.Glyph.CAMERA).size(FONT_SIZE),
            new Glyph(FONT_AWESOME, FontAwesome.Glyph.CLIPBOARD).size(FONT_SIZE - 8.0)));
    button.setOnAction(evt -> {
        if (toFile) {
            screenshotToFile(true);
        } else {
            screenshotToClipboard();
        }
    });
    MenuItem toClipMenu = new MenuItem("Screenshot to clipboard",
            new Glyph(FONT_AWESOME, FontAwesome.Glyph.CLIPBOARD));
    toClipMenu.setOnAction(evt -> {
        toFile = false;
        button.setGraphic(new HBox(0.1, new Glyph(FONT_AWESOME, FontAwesome.Glyph.CAMERA).size(FONT_SIZE),
                new Glyph(FONT_AWESOME, FontAwesome.Glyph.CLIPBOARD).size(FONT_SIZE - 8.8)));
        button.setTooltip(new Tooltip("Copy screenshot of plot to Clipboard"));
        screenshotToClipboard();
    });
    MenuItem toFileMenu = new MenuItem("Screenshot to file", new Glyph(FONT_AWESOME, FontAwesome.Glyph.FILE));
    toFileMenu.setOnAction(evt -> {
        toFile = true;
        button.setGraphic(new HBox(0.1, new Glyph(FONT_AWESOME, FontAwesome.Glyph.CAMERA).size(FONT_SIZE),
                new Glyph(FONT_AWESOME, FontAwesome.Glyph.FILE).size(FONT_SIZE - 8.0)));
        button.setTooltip(new Tooltip("Save plot as image"));
        screenshotToFile(true);
    });
    MenuItem settingsMenu = new MenuItem("Screenshot settings", new Glyph(FONT_AWESOME, FontAwesome.Glyph.WRENCH));
    settingsMenu.setOnAction(evt -> {
        ScreenshotDialog alert = new ScreenshotDialog();
        alert.showAndWait() //
                .filter(response -> response == ButtonType.OK) //
                .ifPresent(response -> {
                    directory.set(alert.getDirectory());
                    pattern.set(alert.getPattern());
                });
    });
    button.getItems().addAll(toClipMenu, toFileMenu, new SeparatorMenuItem(), settingsMenu);

    buttonBar.getChildren().addAll(separator, button);
    return buttonBar;
}
 
Example 10
Source File: MainframeStage.java    From xframium-java with GNU General Public License v3.0 4 votes vote down vote up
public MainframeStage (TelnetState telnetState, int mainframePort)     // usually 5555
{
  this.telnetState = telnetState;

  mainframeServer = new MainframeServer (mainframePort);
  mainframeServer.setStage (this);

  GuiFactory gui = new GuiFactory ();
  final VBox vbox1 = gui.getVBox ();

  for (int i = 0; i < 10; i++)
    buttons.add (gui.getButton ("Empty", vbox1, BUTTON_WIDTH));

  Separator separator = new Separator ();
  separator.setOrientation (Orientation.HORIZONTAL);

  final VBox vbox2 = gui.getVBox ();
  btnReadBuffer = gui.getButton ("Read Buffer", vbox2, BUTTON_WIDTH);
  btnReadModified = gui.getButton ("Read Modified", vbox2, BUTTON_WIDTH);
  btnReadModifiedAll = gui.getButton ("Read Mod All", vbox2, BUTTON_WIDTH);
  btnEraseAllUnprotected = gui.getButton ("Erase All Unpr", vbox2, BUTTON_WIDTH);
  btnProgramTab1 = gui.getButton ("PT 1", vbox2, BUTTON_WIDTH);
  btnProgramTab2 = gui.getButton ("PT 2", vbox2, BUTTON_WIDTH);
  btnProgramTab3 = gui.getButton ("PT 3", vbox2, BUTTON_WIDTH);

  final ToggleGroup modeGroup = new ToggleGroup ();

  btnFieldMode = gui.getRadioButton ("Field Mode", vbox2, modeGroup);
  btnExtendedFieldMode = gui.getRadioButton ("Extended Field Mode", vbox2, modeGroup);
  btnCharacterMode = gui.getRadioButton ("Character Mode", vbox2, modeGroup);
  btnFieldMode.setSelected (true);                    // match the default setting

  modeGroup.selectedToggleProperty ().addListener (new OnToggleHandler ());

  BorderPane borderPane = new BorderPane ();
  borderPane.setLeft (vbox1);
  borderPane.setRight (vbox2);

  Scene scene = new Scene (borderPane);
  setTitle ("Mainframe: " + mainframePort);
  setScene (scene);

  setX (1000);
  setY (100);

  prepareButtons ();

  setOnCloseRequest (e -> Platform.exit ());
}
 
Example 11
Source File: MainframeStage.java    From dm3270 with Apache License 2.0 4 votes vote down vote up
public MainframeStage (TelnetState telnetState, int mainframePort)     // usually 5555
{
  this.telnetState = telnetState;

  mainframeServer = new MainframeServer (mainframePort);
  mainframeServer.setStage (this);

  GuiFactory gui = new GuiFactory ();
  final VBox vbox1 = gui.getVBox ();

  for (int i = 0; i < 10; i++)
    buttons.add (gui.getButton ("Empty", vbox1, BUTTON_WIDTH));

  Separator separator = new Separator ();
  separator.setOrientation (Orientation.HORIZONTAL);

  final VBox vbox2 = gui.getVBox ();
  btnReadBuffer = gui.getButton ("Read Buffer", vbox2, BUTTON_WIDTH);
  btnReadModified = gui.getButton ("Read Modified", vbox2, BUTTON_WIDTH);
  btnReadModifiedAll = gui.getButton ("Read Mod All", vbox2, BUTTON_WIDTH);
  btnEraseAllUnprotected = gui.getButton ("Erase All Unpr", vbox2, BUTTON_WIDTH);
  btnProgramTab1 = gui.getButton ("PT 1", vbox2, BUTTON_WIDTH);
  btnProgramTab2 = gui.getButton ("PT 2", vbox2, BUTTON_WIDTH);
  btnProgramTab3 = gui.getButton ("PT 3", vbox2, BUTTON_WIDTH);

  final ToggleGroup modeGroup = new ToggleGroup ();

  btnFieldMode = gui.getRadioButton ("Field Mode", vbox2, modeGroup);
  btnExtendedFieldMode = gui.getRadioButton ("Extended Field Mode", vbox2, modeGroup);
  btnCharacterMode = gui.getRadioButton ("Character Mode", vbox2, modeGroup);
  btnFieldMode.setSelected (true);                    // match the default setting

  modeGroup.selectedToggleProperty ().addListener (new OnToggleHandler ());

  BorderPane borderPane = new BorderPane ();
  borderPane.setLeft (vbox1);
  borderPane.setRight (vbox2);

  Scene scene = new Scene (borderPane);
  setTitle ("Mainframe: " + mainframePort);
  setScene (scene);

  setX (1000);
  setY (100);

  prepareButtons ();

  setOnCloseRequest (e -> Platform.exit ());
}