Example usage for javafx.scene.control ContentDisplay LEFT

List of usage examples for javafx.scene.control ContentDisplay LEFT

Introduction

In this page you can find the example usage for javafx.scene.control ContentDisplay LEFT.

Prototype

ContentDisplay LEFT

To view the source code for javafx.scene.control ContentDisplay LEFT.

Click Source Link

Document

Content will be placed at the left of the Label.

Usage

From source file:be.makercafe.apps.makerbench.editors.JFXMillEditor.java

/**
 * Creates the toolBar for the editor.//w  w w . j  ava  2 s  .  c om
 *
 * @return
 */

private ToolBar createToolBar() {

    ToolBar toolBar = new ToolBar();
    toolBar.setOrientation(Orientation.HORIZONTAL);

    Button btnSave = GlyphsDude.createIconButton(MaterialDesignIcon.FLOPPY, "Save");
    btnSave.setOnAction(this::handleSaveButton);

    Button btnExportSTL = GlyphsDude.createIconButton(MaterialDesignIcon.EXPORT, "Export GCODE");

    btnExportSTL.setOnAction(this::handleExportAsGCodeFile);

    Button btnExportPNG = GlyphsDude.createIconButton(MaterialDesignIcon.CAMERA, "Export PNG");
    btnExportPNG.setOnAction(this::handleExportAsPngFile);

    Button btnRun = GlyphsDude.createIconButton(MaterialDesignIcon.RUN, "Run");
    btnRun.setOnAction(this::handleCompileAndRun);

    ToggleButton btnAutoCompile = GlyphsDude.createIconToggleButton(MaterialDesignIcon.AUTO_FIX,
            "Automatic run", null, ContentDisplay.LEFT);
    btnAutoCompile.setOnAction(this::handleAutoCompile);
    btnAutoCompile.setSelected(false);

    ToggleButton btn3DNav = GlyphsDude.createIconToggleButton(MaterialDesignIcon.ROTATE_3D, "3D Navigation ",
            null, ContentDisplay.LEFT);
    btn3DNav.setSelected(false);

    ComboBox cbxSourceExamples = new ComboBox();
    cbxSourceExamples.getItems().addAll("TestCut");
    this.cbxSourceExamples = cbxSourceExamples; // TODO: maybe cleaner way
    // to do this ?

    Button btnPasteSource = GlyphsDude.createIconButton(MaterialDesignIcon.CONTENT_PASTE, "Paste source");
    btnPasteSource.setOnAction(this::handlePasteSource);

    toolBar.getItems().addAll(btnSave, btnExportSTL, btnExportPNG, new Separator(), btnRun, new Separator(),
            btnAutoCompile, new Separator(), cbxSourceExamples, btnPasteSource);

    return toolBar;

}

From source file:be.makercafe.apps.makerbench.editors.GCodeEditor.java

/**
 * Creates the toolBar for the editor.//from w w w  .j  av a  2  s.c om
 *
 * @return
 */

private ToolBar createToolBar() {

    ToolBar toolBar = new ToolBar();
    toolBar.setOrientation(Orientation.HORIZONTAL);

    Button btnSave = GlyphsDude.createIconButton(MaterialDesignIcon.FLOPPY, "Save");
    btnSave.setOnAction(this::handleSaveButton);

    Button btnExportSTL = GlyphsDude.createIconButton(MaterialDesignIcon.EXPORT, "Export STL");

    btnExportSTL.setOnAction(this::handleExportAsStlFile);

    Button btnExportPNG = GlyphsDude.createIconButton(MaterialDesignIcon.CAMERA, "Export PNG");
    btnExportPNG.setOnAction(this::handleExportAsPngFile);

    Button btnRun = GlyphsDude.createIconButton(MaterialDesignIcon.RUN, "Run");
    btnRun.setOnAction(this::handleCompileAndRun);

    ToggleButton btnAutoCompile = GlyphsDude.createIconToggleButton(MaterialDesignIcon.AUTO_FIX,
            "Automatic run", null, ContentDisplay.LEFT);
    btnAutoCompile.setSelected(false);

    ToggleButton btn3DNav = GlyphsDude.createIconToggleButton(MaterialDesignIcon.ROTATE_3D, "3D Navigation ",
            null, ContentDisplay.LEFT);
    btn3DNav.setSelected(false);

    ComboBox cbxSourceExamples = new ComboBox();
    cbxSourceExamples.getItems().addAll("BatteryHolder", "BoardMount", "BreadBoardConnector", "ServoMount",
            "Wheel");
    this.cbxSourceExamples = cbxSourceExamples; // TODO: maybe cleaner way
    // to do this ?

    Button btnPasteSource = GlyphsDude.createIconButton(MaterialDesignIcon.CONTENT_PASTE, "Paste source");
    btnPasteSource.setOnAction(this::handlePasteSource);

    toolBar.getItems().addAll(btnSave, btnExportSTL, btnExportPNG, new Separator(), btnRun, new Separator(),
            btnAutoCompile, new Separator(), cbxSourceExamples, btnPasteSource);

    return toolBar;

}