public void updateFocusColor() { Paint paint = control.getFocusColor(); focusedLine.setBackground(paint == null ? Background.EMPTY : new Background(new BackgroundFill(paint, CornerRadii.EMPTY, Insets.EMPTY))); }
public void updateUnfocusColor() { Paint paint = control.getUnFocusColor(); line.setBackground(paint == null ? Background.EMPTY : new Background(new BackgroundFill(paint, CornerRadii.EMPTY, Insets.EMPTY))); }
public JFXPopupSkin(JFXPopup control) { this.control = control; // set scale y to 0.01 instead of 0 to allow layout of the content, // otherwise it will cause exception in traverse engine, when focusing the 1st node scale = new Scale(1, 0.01, 0, 0); popupContent = control.getPopupContent(); container.getStyleClass().add("jfx-popup-container"); container.setBackground(new Background(new BackgroundFill(Color.WHITE, CornerRadii.EMPTY, Insets.EMPTY))); container.getChildren().add(popupContent); container.getTransforms().add(scale); container.setOpacity(0); root = JFXDepthManager.createMaterialNode(container, 4); animation = getAnimation(); }
private void initStyle(StackPane pane) { pane.setOpacity(1); pane.setPrefSize(30, 4); pane.setBackground(new Background(new BackgroundFill(Color.BLACK, new CornerRadii(5), Insets.EMPTY))); }
public void updateSelectionBackground() { CornerRadii radii = getSkinnable().getBackground() == null ? CornerRadii.EMPTY : getSkinnable().getBackground() .getFills() .get(0) .getRadii(); Insets insets = getSkinnable().getBackground() == null ? Insets.EMPTY : getSkinnable().getBackground() .getFills() .get(0) .getInsets(); selectionOverLay.setBackground(new Background(new BackgroundFill(getSkinnable().isSelected() ? ((JFXToggleNode) getSkinnable()) .getSelectedColor() : ((JFXToggleNode) getSkinnable()).getUnSelectedColor(), radii, insets))); }
/** * creates empty drawer node */ public JFXDrawer() { initialize(); contentHolder.setPickOnBounds(false); addEventHandler(JFXDrawerEvent.CLOSED, handler -> Platform.runLater(() -> getCachePolicy().restore(contentHolder))); overlayPane.setBackground(new Background(new BackgroundFill(Color.rgb(0, 0, 0, 0.1), CornerRadii.EMPTY, Insets.EMPTY))); overlayPane.getStyleClass().add("jfx-drawer-overlay-pane"); overlayPane.setOpacity(0); overlayPane.setMouseTransparent(true); sidePane.getStyleClass().add("jfx-drawer-side-pane"); sidePane.setBackground(new Background(new BackgroundFill(Color.rgb(255, 255, 255, 1), CornerRadii.EMPTY, Insets.EMPTY))); sidePane.setPickOnBounds(false); translateTimer.setCacheNodes(sidePane); // add listeners initListeners(); // init size value setDefaultDrawerSize(100); getChildren().setAll(contentHolder, overlayPane, sidePane); }
main.setBackground(new Background(new BackgroundFill(Color.WHITE, CornerRadii.EMPTY, Insets.EMPTY))); StackPane.setMargin(pane, new Insets(20, 0, 0, 20));
public JFXTreeCell() { selectedPane.getStyleClass().add("selection-bar"); selectedPane.setBackground(new Background(new BackgroundFill(Color.RED, CornerRadii.EMPTY, Insets.EMPTY))); selectedPane.setPrefWidth(3); selectedPane.setMouseTransparent(true); selectedProperty().addListener((o, oldVal, newVal) -> selectedPane.setVisible(newVal ? true : false)); final InvalidationListener treeItemInvalidationListener = observable -> { TreeItem<T> oldTreeItem = treeItemRef == null ? null : treeItemRef.get(); if (oldTreeItem != null) { oldTreeItem.graphicProperty().removeListener(weakTreeItemGraphicListener); } TreeItem<T> newTreeItem = getTreeItem(); if (newTreeItem != null) { newTreeItem.graphicProperty().addListener(weakTreeItemGraphicListener); treeItemRef = new WeakReference<>(newTreeItem); } }; final WeakInvalidationListener weakTreeItemListener = new WeakInvalidationListener(treeItemInvalidationListener); treeItemProperty().addListener(weakTreeItemListener); if (getTreeItem() != null) { getTreeItem().graphicProperty().addListener(weakTreeItemGraphicListener); } }
public void updateDisabled() { final boolean disabled = control.isDisable(); line.setBorder(!disabled ? Border.EMPTY : new Border(new BorderStroke(control.getUnFocusColor(), BorderStrokeStyle.DASHED, CornerRadii.EMPTY, new BorderWidths(1)))); line.setBackground(new Background( new BackgroundFill(disabled ? Color.TRANSPARENT : control.getUnFocusColor(), CornerRadii.EMPTY, Insets.EMPTY))); } }
private void initialize() { this.setVisible(false); this.getStyleClass().add(DEFAULT_STYLE_CLASS); this.transitionType.addListener((o, oldVal, newVal) -> { animation = getShowAnimation(transitionType.get()); }); contentHolder = new StackPane(); contentHolder.setBackground(new Background(new BackgroundFill(Color.WHITE, new CornerRadii(2), null))); JFXDepthManager.setDepth(contentHolder, 4); contentHolder.setPickOnBounds(false); // ensure stackpane is never resized beyond it's preferred size contentHolder.setMaxSize(Region.USE_PREF_SIZE, Region.USE_PREF_SIZE); this.getChildren().add(contentHolder); this.getStyleClass().add("jfx-dialog-overlay-pane"); StackPane.setAlignment(contentHolder, Pos.CENTER); this.setBackground(new Background(new BackgroundFill(Color.rgb(0, 0, 0, 0.1), null, null))); // close the dialog if clicked on the overlay pane if (overlayClose.get()) { this.addEventHandler(MouseEvent.MOUSE_PRESSED, closeHandler); } // prevent propagating the events to overlay pane contentHolder.addEventHandler(MouseEvent.ANY, e -> e.consume()); }
private void playIndeterminateAnimation(Boolean indeterminate, boolean playAnimation) { if (indeterminate == null) { indeterminate = false; } indeterminateTransition.setRate(indeterminate ? 1 : -1); if (playAnimation) { indeterminateTransition.play(); } else { if (indeterminate) { CornerRadii radii = indeterminateMark.getBackground() == null ? null : indeterminateMark.getBackground().getFills().get(0).getRadii(); Insets insets = indeterminateMark.getBackground() == null ? null : indeterminateMark.getBackground().getFills().get(0).getInsets(); indeterminateMark.setOpacity(1); indeterminateMark.setScaleY(1); indeterminateMark.setScaleX(1); indeterminateMark.setBackground(new Background(new BackgroundFill(getSkinnable().getCheckedColor(), radii, insets))); indeterminateTransition.playFrom(indeterminateTransition.getCycleDuration()); } else { indeterminateMark.setOpacity(0); indeterminateMark.setScaleY(0); indeterminateMark.setScaleX(0); indeterminateTransition.playFrom(Duration.ZERO); } } if(getSkinnable().isSelected()){ playSelectAnimation(!indeterminate, playAnimation); } }
headerPanel.setBackground(new Background(new BackgroundFill(this.timePicker.getDefaultColor(), CornerRadii.EMPTY, Insets.EMPTY)));
mark.setScaleX(1); mark.setOpacity(1); box.setBackground(new Background(new BackgroundFill(getSkinnable().getCheckedColor(), radii, insets))); select.playFrom(select.getCycleDuration()); transition.playFrom(transition.getCycleDuration()); mark.setScaleX(0); mark.setOpacity(0); box.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT, radii, insets))); select.playFrom(Duration.ZERO); transition.playFrom(Duration.ZERO);
condensedHeaderBackground.setBackground(new Background(new BackgroundFill(Color.valueOf("#1E88E5"), CornerRadii.EMPTY, Insets.EMPTY))); headerBackground.setBackground(new Background(new BackgroundFill(Color.valueOf("#3949AB"), CornerRadii.EMPTY, Insets.EMPTY)));
main.setBackground(new Background(new BackgroundFill(Color.WHITE, CornerRadii.EMPTY, Insets.EMPTY))); StackPane.setMargin(pane, new Insets(20, 0, 0, 20));
line.setBackground(new Background( new BackgroundFill(control.getUnFocusColor(), CornerRadii.EMPTY, Insets.EMPTY))); focusedLine.setBackground(new Background( new BackgroundFill(control.getFocusColor(), CornerRadii.EMPTY, Insets.EMPTY))); focusedLine.setOpacity(0);
pane.setBackground(new Background(new BackgroundFill(curvedColorPicker.getColor(curvedColorPicker.getSelectedIndex()), CornerRadii.EMPTY, Insets.EMPTY)));
private void initStyle(StackPane pane) { pane.setOpacity(1); pane.setPrefSize(30, 4); pane.setBackground(new Background(new BackgroundFill(Color.BLACK, new CornerRadii(5), Insets.EMPTY))); }
public void updateSelectionBackground() { CornerRadii radii = getSkinnable().getBackground() == null ? CornerRadii.EMPTY : getSkinnable().getBackground() .getFills() .get(0) .getRadii(); Insets insets = getSkinnable().getBackground() == null ? Insets.EMPTY : getSkinnable().getBackground() .getFills() .get(0) .getInsets(); selectionOverLay.setBackground(new Background(new BackgroundFill(getSkinnable().isSelected() ? ((JFXToggleNode) getSkinnable()) .getSelectedColor() : ((JFXToggleNode) getSkinnable()).getUnSelectedColor(), radii, insets))); }
public void updateDisabled() { final boolean disabled = control.isDisable(); line.setBorder(!disabled ? Border.EMPTY : new Border(new BorderStroke(control.getUnFocusColor(), BorderStrokeStyle.DASHED, CornerRadii.EMPTY, new BorderWidths(1)))); line.setBackground(new Background( new BackgroundFill(disabled ? Color.TRANSPARENT : control.getUnFocusColor(), CornerRadii.EMPTY, Insets.EMPTY))); } }