Search in sources :

Example 81 with Region

use of javafx.scene.layout.Region in project Board-Instrumentation-Framework by intel.

the class Demo method initBack.

private Pane initBack(final FlipPanel flipPanel, final StackPane FRONT_PANEL) {
    Region backButton = new Region();
    backButton.getStyleClass().add("back-button");
    backButton.addEventHandler(MouseEvent.MOUSE_CLICKED, EVENT -> flipPanel.flipToFront());
    ToggleGroup group = new ToggleGroup();
    final RadioButton standardGreen = new RadioButton("Green");
    standardGreen.setToggleGroup(group);
    standardGreen.setSelected(true);
    standardGreen.setOnAction(event -> FRONT_PANEL.setBackground(new Background(new BackgroundFill(Color.GREEN, CornerRadii.EMPTY, Insets.EMPTY))));
    final RadioButton amber = new RadioButton("Red");
    amber.setToggleGroup(group);
    amber.setOnAction(event -> FRONT_PANEL.setBackground(new Background(new BackgroundFill(Color.RED, CornerRadii.EMPTY, Insets.EMPTY))));
    final RadioButton blueDarkBlue = new RadioButton("Blue");
    blueDarkBlue.setToggleGroup(group);
    blueDarkBlue.setOnAction(event -> FRONT_PANEL.setBackground(new Background(new BackgroundFill(Color.BLUE, CornerRadii.EMPTY, Insets.EMPTY))));
    VBox componentsBack = new VBox(backButton, standardGreen, amber, blueDarkBlue);
    componentsBack.setSpacing(10);
    StackPane back = new StackPane();
    back.setPadding(new Insets(20, 20, 20, 20));
    back.getStyleClass().add("panel");
    back.getChildren().addAll(componentsBack);
    return back;
}
Also used : Insets(javafx.geometry.Insets) Background(javafx.scene.layout.Background) ToggleGroup(javafx.scene.control.ToggleGroup) BackgroundFill(javafx.scene.layout.BackgroundFill) Region(javafx.scene.layout.Region) RadioButton(javafx.scene.control.RadioButton) VBox(javafx.scene.layout.VBox) StackPane(javafx.scene.layout.StackPane)

Example 82 with Region

use of javafx.scene.layout.Region in project Board-Instrumentation-Framework by intel.

the class PushButtonSkin method initGraphics.

private void initGraphics() {
    frame = new Region();
    frame.getStyleClass().setAll("frame");
    frameInnerShadow0 = new InnerShadow();
    frameInnerShadow0.setOffsetX(0);
    frameInnerShadow0.setOffsetY(1);
    frameInnerShadow0.setRadius(0);
    frameInnerShadow0.setColor(Color.web("0x333333a6"));
    frameInnerShadow0.setBlurType(BlurType.TWO_PASS_BOX);
    frameInnerShadow1 = new InnerShadow();
    frameInnerShadow1.setOffsetX(0);
    frameInnerShadow1.setOffsetY(-1);
    frameInnerShadow1.setRadius(0);
    frameInnerShadow1.setColor(Color.web("0xeeeeeea6"));
    frameInnerShadow1.setBlurType(BlurType.TWO_PASS_BOX);
    frameInnerShadow1.setInput(frameInnerShadow0);
    frame.setEffect(frameInnerShadow1);
    deselected = new Region();
    deselected.getStyleClass().setAll("deselected");
    deselectedInnerShadow0 = new InnerShadow();
    deselectedInnerShadow0.setOffsetX(0);
    deselectedInnerShadow0.setOffsetY(-1);
    deselectedInnerShadow0.setRadius(0);
    deselectedInnerShadow0.setColor(Color.web("0x4b4e52a6"));
    deselectedInnerShadow0.setBlurType(BlurType.TWO_PASS_BOX);
    deselectedInnerShadow1 = new InnerShadow();
    deselectedInnerShadow1.setOffsetX(0);
    deselectedInnerShadow1.setOffsetY(1);
    deselectedInnerShadow1.setRadius(0);
    deselectedInnerShadow1.setColor(Color.web("0xeeeeeea6"));
    deselectedInnerShadow1.setBlurType(BlurType.TWO_PASS_BOX);
    deselectedInnerShadow1.setInput(deselectedInnerShadow0);
    deselectedDropShadow = new DropShadow();
    deselectedDropShadow.setOffsetX(0);
    deselectedDropShadow.setOffsetY(3);
    deselectedDropShadow.setRadius(3.0 / 128.0 * PREFERRED_WIDTH);
    deselectedDropShadow.setColor(Color.web("0x000000a6"));
    deselectedDropShadow.setBlurType(BlurType.TWO_PASS_BOX);
    deselectedDropShadow.setInput(deselectedInnerShadow1);
    deselected.setEffect(deselectedDropShadow);
    selected = new Region();
    selected.getStyleClass().setAll("selected");
    selectedInnerShadow0 = new InnerShadow();
    selectedInnerShadow0.setOffsetX(0);
    selectedInnerShadow0.setOffsetY(-1);
    selectedInnerShadow0.setRadius(0);
    selectedInnerShadow0.setColor(Color.web("0x4b4e52a6"));
    selectedInnerShadow0.setBlurType(BlurType.TWO_PASS_BOX);
    selectedInnerShadow1 = new InnerShadow();
    selectedInnerShadow1.setOffsetX(0);
    selectedInnerShadow1.setOffsetY(1);
    selectedInnerShadow1.setRadius(0);
    selectedInnerShadow1.setColor(Color.web("0xeeeeeea6"));
    selectedInnerShadow1.setBlurType(BlurType.TWO_PASS_BOX);
    selectedInnerShadow1.setInput(selectedInnerShadow0);
    selectedDropShadow = new DropShadow();
    selectedDropShadow.setOffsetX(0);
    selectedDropShadow.setOffsetY(0);
    selectedDropShadow.setRadius(2.0 / 128.0 * PREFERRED_WIDTH);
    selectedDropShadow.setColor(Color.web("0x000000a6"));
    selectedDropShadow.setBlurType(BlurType.TWO_PASS_BOX);
    selectedDropShadow.setInput(selectedInnerShadow1);
    selected.setEffect(selectedDropShadow);
    icon = new Region();
    icon.getStyleClass().setAll("icon");
    pane.getChildren().setAll(frame, deselected, selected, icon);
    // Adjust visibility dependent on settings
    updateStatus();
    getChildren().setAll(pane);
    resize();
}
Also used : InnerShadow(javafx.scene.effect.InnerShadow) Region(javafx.scene.layout.Region) DropShadow(javafx.scene.effect.DropShadow)

Example 83 with Region

use of javafx.scene.layout.Region in project POL-POM-5 by PhoenicisOrg.

the class WinePrefixContainerDisplayTab method populate.

private void populate() {
    final VBox displayPane = new VBox();
    final Text title = new TextWithStyle(tr("Display settings"), TITLE_CSS_CLASS);
    displayPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS);
    displayPane.getChildren().add(title);
    final GridPane displayContentPane = new GridPane();
    displayContentPane.getStyleClass().add("grid");
    final ComboBox<UseGLSL> glslComboBox = new ComboBox<>();
    glslComboBox.setMaxWidth(Double.MAX_VALUE);
    glslComboBox.setValue(container.getUseGlslValue());
    glslComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
    addItems(glslComboBox, UseGLSL.class);
    displayContentPane.add(new TextWithStyle(tr("GLSL support"), CAPTION_TITLE_CSS_CLASS), 0, 0);
    displayContentPane.add(glslComboBox, 1, 0);
    final ComboBox<DirectDrawRenderer> directDrawRendererComboBox = new ComboBox<>();
    directDrawRendererComboBox.setMaxWidth(Double.MAX_VALUE);
    directDrawRendererComboBox.setValue(container.getDirectDrawRenderer());
    directDrawRendererComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
    addItems(directDrawRendererComboBox, DirectDrawRenderer.class);
    displayContentPane.add(new TextWithStyle(tr("Direct Draw Renderer"), CAPTION_TITLE_CSS_CLASS), 0, 1);
    displayContentPane.add(directDrawRendererComboBox, 1, 1);
    final ComboBox<VideoMemorySize> videoMemorySizeComboBox = new ComboBox<>();
    videoMemorySizeComboBox.setMaxWidth(Double.MAX_VALUE);
    videoMemorySizeComboBox.setValue(container.getVideoMemorySize());
    videoMemorySizeComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
    addItemsVideoMemorySize(videoMemorySizeComboBox);
    displayContentPane.add(new TextWithStyle(tr("Video memory size"), CAPTION_TITLE_CSS_CLASS), 0, 2);
    displayContentPane.add(videoMemorySizeComboBox, 1, 2);
    final ComboBox<OffscreenRenderingMode> offscreenRenderingModeComboBox = new ComboBox<>();
    offscreenRenderingModeComboBox.setMaxWidth(Double.MAX_VALUE);
    offscreenRenderingModeComboBox.setValue(container.getOffscreenRenderingMode());
    offscreenRenderingModeComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
    addItems(offscreenRenderingModeComboBox, OffscreenRenderingMode.class);
    displayContentPane.add(new TextWithStyle(tr("Offscreen rendering mode"), CAPTION_TITLE_CSS_CLASS), 0, 3);
    displayContentPane.add(offscreenRenderingModeComboBox, 1, 3);
    final ComboBox<RenderTargetModeLock> renderTargetModeLockComboBox = new ComboBox<>();
    renderTargetModeLockComboBox.setMaxWidth(Double.MAX_VALUE);
    renderTargetModeLockComboBox.setValue(container.getRenderTargetModeLock());
    renderTargetModeLockComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
    addItems(renderTargetModeLockComboBox, RenderTargetModeLock.class);
    displayContentPane.add(new TextWithStyle(tr("Render target lock mode"), CAPTION_TITLE_CSS_CLASS), 0, 4);
    displayContentPane.add(renderTargetModeLockComboBox, 1, 4);
    final ComboBox<Multisampling> multisamplingComboBox = new ComboBox<>();
    multisamplingComboBox.setMaxWidth(Double.MAX_VALUE);
    multisamplingComboBox.setValue(container.getMultisampling());
    multisamplingComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
    addItems(multisamplingComboBox, Multisampling.class);
    displayContentPane.add(new TextWithStyle(tr("Multisampling"), CAPTION_TITLE_CSS_CLASS), 0, 5);
    displayContentPane.add(multisamplingComboBox, 1, 5);
    final ComboBox<StrictDrawOrdering> strictDrawOrderingComboBox = new ComboBox<>();
    strictDrawOrderingComboBox.setMaxWidth(Double.MAX_VALUE);
    strictDrawOrderingComboBox.setValue(container.getStrictDrawOrdering());
    strictDrawOrderingComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
    addItems(strictDrawOrderingComboBox, StrictDrawOrdering.class);
    displayContentPane.add(new TextWithStyle(tr("Strict Draw Ordering"), CAPTION_TITLE_CSS_CLASS), 0, 6);
    displayContentPane.add(strictDrawOrderingComboBox, 1, 6);
    final ComboBox<AlwaysOffscreen> alwaysOffscreenComboBox = new ComboBox<>();
    alwaysOffscreenComboBox.setMaxWidth(Double.MAX_VALUE);
    alwaysOffscreenComboBox.setValue(container.getAlwaysOffscreen());
    alwaysOffscreenComboBox.valueProperty().addListener((observable, oldValue, newValue) -> this.changeSettings(newValue));
    addItems(alwaysOffscreenComboBox, AlwaysOffscreen.class);
    displayContentPane.add(new TextWithStyle(tr("Always Offscreen"), CAPTION_TITLE_CSS_CLASS), 0, 7);
    displayContentPane.add(alwaysOffscreenComboBox, 1, 7);
    Region spacer = new Region();
    GridPane.setHgrow(spacer, Priority.ALWAYS);
    displayContentPane.add(spacer, 2, 0);
    displayPane.getChildren().addAll(displayContentPane);
    this.setContent(displayPane);
    lockableElements.addAll(Arrays.asList(glslComboBox, directDrawRendererComboBox, offscreenRenderingModeComboBox, renderTargetModeLockComboBox, multisamplingComboBox, strictDrawOrderingComboBox, alwaysOffscreenComboBox, videoMemorySizeComboBox));
}
Also used : TextWithStyle(org.phoenicis.javafx.views.common.TextWithStyle) GridPane(javafx.scene.layout.GridPane) ComboBox(javafx.scene.control.ComboBox) Text(javafx.scene.text.Text) Region(javafx.scene.layout.Region) VBox(javafx.scene.layout.VBox)

Example 84 with Region

use of javafx.scene.layout.Region in project POL-POM-5 by PhoenicisOrg.

the class WinePrefixContainerInformationTab method populate.

private void populate() {
    final VBox informationPane = new VBox();
    final Text title = new TextWithStyle(tr("Information"), TITLE_CSS_CLASS);
    informationPane.getStyleClass().add(CONFIGURATION_PANE_CSS_CLASS);
    informationPane.getChildren().add(title);
    final GridPane informationContentPane = new GridPane();
    informationContentPane.getStyleClass().add("grid");
    informationContentPane.add(new TextWithStyle(tr("Name:"), CAPTION_TITLE_CSS_CLASS), 0, 0);
    Label name = new Label(container.getName());
    name.setWrapText(true);
    informationContentPane.add(name, 1, 0);
    informationContentPane.add(new TextWithStyle(tr("Path:"), CAPTION_TITLE_CSS_CLASS), 0, 1);
    Label path = new Label(container.getPath());
    path.setWrapText(true);
    informationContentPane.add(path, 1, 1);
    informationContentPane.add(new TextWithStyle(tr("Installed shortcuts:"), CAPTION_TITLE_CSS_CLASS), 0, 2);
    Label installedShortcuts = new Label(container.getInstalledShortcuts().stream().map(shortcutDTO -> shortcutDTO.getInfo().getName()).collect(Collectors.joining("; ")));
    installedShortcuts.setWrapText(true);
    informationContentPane.add(installedShortcuts, 1, 2);
    informationContentPane.add(new TextWithStyle(tr("Wine version:"), CAPTION_TITLE_CSS_CLASS), 0, 3);
    Label version = new Label(container.getVersion());
    version.setWrapText(true);
    informationContentPane.add(version, 1, 3);
    informationContentPane.add(new TextWithStyle(tr("Wine architecture:"), CAPTION_TITLE_CSS_CLASS), 0, 4);
    Label architecture = new Label(container.getArchitecture());
    architecture.setWrapText(true);
    informationContentPane.add(architecture, 1, 4);
    informationContentPane.add(new TextWithStyle(tr("Wine distribution:"), CAPTION_TITLE_CSS_CLASS), 0, 5);
    Label distribution = new Label(container.getDistribution());
    distribution.setWrapText(true);
    informationContentPane.add(distribution, 1, 5);
    Region spacer = new Region();
    spacer.setPrefHeight(20);
    VBox.setVgrow(spacer, Priority.NEVER);
    // changing engine does not work currently
    // disabled combobox to avoid confusion of users
    /*ComboBox<EngineVersionDTO> changeEngineComboBox = new ComboBox<EngineVersionDTO>(
                FXCollections.observableList(engineVersions));
        changeEngineComboBox.setConverter(new StringConverter<EngineVersionDTO>() {
            @Override
            public String toString(EngineVersionDTO object) {
                return object.getVersion();
            }
        
            @Override
            public EngineVersionDTO fromString(String string) {
                return engineVersions.stream().filter(engineVersion -> engineVersion.getVersion().equals(string))
                        .findFirst().get();
            }
        });
        changeEngineComboBox.getSelectionModel().select(engineVersions.stream()
                .filter(engineVersion -> engineVersion.getVersion().equals(container.getVersion())).findFirst().get());*/
    Button deleteButton = new Button(tr("Delete container"));
    deleteButton.setOnMouseClicked(event -> this.onDeletePrefix.accept(container));
    informationPane.getChildren().addAll(informationContentPane, spacer, /*changeEngineComboBox,*/
    deleteButton);
    this.setContent(informationPane);
}
Also used : TextWithStyle(org.phoenicis.javafx.views.common.TextWithStyle) GridPane(javafx.scene.layout.GridPane) Button(javafx.scene.control.Button) Label(javafx.scene.control.Label) Region(javafx.scene.layout.Region) Text(javafx.scene.text.Text) VBox(javafx.scene.layout.VBox)

Example 85 with Region

use of javafx.scene.layout.Region in project Board-Instrumentation-Framework by intel.

the class BaseWidget method ConfigureDimentions.

protected void ConfigureDimentions() {
    Region regionNode = getRegionObject();
    if (null == regionNode) {
        LOGGER.severe(getName() + " : Should NOT BE here, NULL Widget pass to Config Dimensions");
        return;
    }
    PreConfigDimensions(regionNode);
    if (getWidth() > 0) {
        regionNode.setPrefWidth(getWidth());
        regionNode.setMinWidth(getWidth());
        regionNode.setMaxWidth(getWidth());
    }
    if (getHeight() > 0) {
        regionNode.setPrefHeight(getHeight());
        regionNode.setMinHeight(getHeight());
        regionNode.setMaxHeight(getHeight());
    }
}
Also used : Region(javafx.scene.layout.Region)

Aggregations

Region (javafx.scene.layout.Region)106 Text (javafx.scene.text.Text)25 VBox (javafx.scene.layout.VBox)22 Label (javafx.scene.control.Label)21 Pane (javafx.scene.layout.Pane)21 Button (javafx.scene.control.Button)18 InnerShadow (javafx.scene.effect.InnerShadow)17 Scene (javafx.scene.Scene)16 Node (javafx.scene.Node)15 Insets (javafx.geometry.Insets)14 HBox (javafx.scene.layout.HBox)14 DropShadow (javafx.scene.effect.DropShadow)13 ArrayList (java.util.ArrayList)12 StackPane (javafx.scene.layout.StackPane)12 Canvas (javafx.scene.canvas.Canvas)11 Color (javafx.scene.paint.Color)11 GridPane (javafx.scene.layout.GridPane)10 Group (javafx.scene.Group)9 Background (javafx.scene.layout.Background)8 BackgroundFill (javafx.scene.layout.BackgroundFill)8