/** * @return whether customMaximizeProperty is active or not */ public final boolean isCustomMaximize() { return this.customMaximizeProperty().get(); }
Cursor cursor = this.getCursor(); setStageWidth(initWidth + deltax); mouseEvent.consume(); } else if (Cursor.NE_RESIZE.equals(cursor)) { if (setStageHeight(initHeight - deltay)) { primaryStage.setY(initStageY + deltay); setStageWidth(initWidth + deltax); mouseEvent.consume(); } else if (Cursor.SE_RESIZE.equals(cursor)) { setStageWidth(initWidth + deltax); setStageHeight(initHeight + deltay); mouseEvent.consume(); } else if (Cursor.S_RESIZE.equals(cursor)) { setStageHeight(initHeight + deltay); mouseEvent.consume(); } else if (Cursor.W_RESIZE.equals(cursor)) { if (setStageWidth(initWidth - deltax)) { primaryStage.setX(initStageX + deltax); if (setStageWidth(initWidth - deltax)) { primaryStage.setX(initStageX + deltax); setStageHeight(initHeight + deltay); mouseEvent.consume(); } else if (Cursor.NW_RESIZE.equals(cursor)) { if (setStageWidth(initWidth - deltax)) { primaryStage.setX(initStageX + deltax);
private void showDragCursorOnBorders(MouseEvent mouseEvent) { if (primaryStage.isMaximized() || primaryStage.isFullScreen() || maximized) { this.setCursor(Cursor.DEFAULT); return; // maximized mode does not support resize if (contentPlaceHolder.getBorder() != null && contentPlaceHolder.getBorder().getStrokes().size() > 0) { double borderWidth = contentPlaceHolder.snappedLeftInset(); if (isRightEdge(x)) { if (y < borderWidth) { this.setCursor(Cursor.NE_RESIZE); } else if (y > this.getHeight() - borderWidth) { this.setCursor(Cursor.SE_RESIZE); } else { this.setCursor(Cursor.E_RESIZE); } else if (isLeftEdge(x)) { if (y < borderWidth) { this.setCursor(Cursor.NW_RESIZE); } else if (y > this.getHeight() - borderWidth) { this.setCursor(Cursor.SW_RESIZE); } else { this.setCursor(Cursor.W_RESIZE); } else if (isTopEdge(y)) { this.setCursor(Cursor.N_RESIZE); } else if (isBottomEdge(y)) { this.setCursor(Cursor.S_RESIZE); } else { this.setCursor(Cursor.DEFAULT);
setPickOnBounds(false); getStyleClass().add("jfx-decorator"); initializeButtons(); initializeContainers(node, fullScreen, max, min); new KeyValue(this.translateYProperty(), -buttonsContainer.getHeight(), Interpolator.EASE_BOTH))); windowDecoratorAnimation.setOnFinished((finish) -> { this.getChildren().remove(buttonsContainer); this.setTranslateY(0); }); windowDecoratorAnimation.play(); windowDecoratorAnimation.stop(); } else { this.getChildren().add(0, buttonsContainer); this.setTranslateY(-buttonsContainer.getHeight()); windowDecoratorAnimation = new Timeline(new KeyFrame(Duration.millis(320), new KeyValue(this.translateYProperty(), 0, Interpolator.EASE_BOTH))); updateInitMouseValues(mouseEvent)); buttonsContainer.addEventHandler(MouseEvent.MOUSE_PRESSED, (mouseEvent) -> updateInitMouseValues(mouseEvent));
pickerDecorator = new JFXDecorator(dialog, this, false, false, false); pickerDecorator.setOnCloseButtonAction(() -> close()); pickerDecorator.setPickOnBounds(false); customScene = new Scene(pickerDecorator, Color.TRANSPARENT); if(owner!=null) { pickerDecorator.lookupAll(".jfx-decorator-button").forEach(button -> { ((JFXButton) button).setRipplerFill(fontColor); ((SVGGlyph) ((JFXButton) button).getGraphic()).setFill(fontColor); ((Pane) pickerDecorator.lookup(".jfx-decorator-buttons-container")).backgroundProperty() .bind(Bindings.createObjectBinding(() -> { return new Background(new BackgroundFill( }, pane.backgroundProperty())); ((Pane) pickerDecorator.lookup(".jfx-decorator-content-container")).borderProperty() .bind(Bindings.createObjectBinding(() -> { return new Border(new BorderStroke(
flow.createHandler(flowContext).start(container); JFXDecorator decorator = new JFXDecorator(stage, container.getView()); decorator.setCustomMaximize(true); decorator.setGraphic(new SVGGlyph(""));
/** * will get the title * * @deprecated Use {@link JFXDecorator#setTitle(java.lang.String)} instead. */ public String getText() { return getTitle(); }
private boolean isBottomEdge(double y) { final double height = this.getHeight(); return y < height && y > height - contentPlaceHolder.snappedLeftInset(); }
private boolean isRightEdge(double x) { final double width = this.getWidth(); return x < width && x > width - contentPlaceHolder.snappedLeftInset(); }
clip.heightProperty().bind(((Region) node).heightProperty()); node.setClip(clip); this.getChildren().addAll(buttonsContainer, contentPlaceHolder);
setPickOnBounds(false); getStyleClass().add("jfx-decorator"); initializeButtons(); initializeContainers(node, fullScreen, max, min); new KeyValue(this.translateYProperty(), -buttonsContainer.getHeight(), Interpolator.EASE_BOTH))); windowDecoratorAnimation.setOnFinished((finish) -> { this.getChildren().remove(buttonsContainer); this.setTranslateY(0); }); windowDecoratorAnimation.play(); windowDecoratorAnimation.stop(); } else { this.getChildren().add(0, buttonsContainer); this.setTranslateY(-buttonsContainer.getHeight()); windowDecoratorAnimation = new Timeline(new KeyFrame(Duration.millis(320), new KeyValue(this.translateYProperty(), 0, Interpolator.EASE_BOTH))); updateInitMouseValues(mouseEvent)); buttonsContainer.addEventHandler(MouseEvent.MOUSE_PRESSED, (mouseEvent) -> updateInitMouseValues(mouseEvent));
pickerDecorator = new JFXDecorator(dialog, this, false, false, false); pickerDecorator.setOnCloseButtonAction(() -> close()); pickerDecorator.setPickOnBounds(false); customScene = new Scene(pickerDecorator, Color.TRANSPARENT); if(owner!=null) { pickerDecorator.lookupAll(".jfx-decorator-button").forEach(button -> { ((JFXButton) button).setRipplerFill(fontColor); ((SVGGlyph) ((JFXButton) button).getGraphic()).setFill(fontColor); ((Pane) pickerDecorator.lookup(".jfx-decorator-buttons-container")).backgroundProperty() .bind(Bindings.createObjectBinding(() -> { return new Background(new BackgroundFill( }, pane.backgroundProperty())); ((Pane) pickerDecorator.lookup(".jfx-decorator-content-container")).borderProperty() .bind(Bindings.createObjectBinding(() -> { return new Border(new BorderStroke(
/** * will get the title * * @deprecated Use {@link JFXDecorator#setTitle(java.lang.String)} instead. */ @Deprecated public String getText() { return getTitle(); }
private boolean isBottomEdge(double y) { final double height = this.getHeight(); return y < height && y > height - contentPlaceHolder.snappedLeftInset(); }
private boolean isRightEdge(double x) { final double width = this.getWidth(); return x < width && x > width - contentPlaceHolder.snappedLeftInset(); }
clip.heightProperty().bind(((Region) node).heightProperty()); node.setClip(clip); this.getChildren().addAll(buttonsContainer, contentPlaceHolder);
private void showDragCursorOnBorders(MouseEvent mouseEvent) { if (primaryStage.isMaximized() || primaryStage.isFullScreen() || maximized) { this.setCursor(Cursor.DEFAULT); return; // maximized mode does not support resize if (contentPlaceHolder.getBorder() != null && contentPlaceHolder.getBorder().getStrokes().size() > 0) { double borderWidth = contentPlaceHolder.snappedLeftInset(); if (isRightEdge(x)) { if (y < borderWidth) { this.setCursor(Cursor.NE_RESIZE); } else if (y > this.getHeight() - borderWidth) { this.setCursor(Cursor.SE_RESIZE); } else { this.setCursor(Cursor.E_RESIZE); } else if (isLeftEdge(x)) { if (y < borderWidth) { this.setCursor(Cursor.NW_RESIZE); } else if (y > this.getHeight() - borderWidth) { this.setCursor(Cursor.SW_RESIZE); } else { this.setCursor(Cursor.W_RESIZE); } else if (isTopEdge(y)) { this.setCursor(Cursor.N_RESIZE); } else if (isBottomEdge(y)) { this.setCursor(Cursor.S_RESIZE); } else { this.setCursor(Cursor.DEFAULT);
Cursor cursor = this.getCursor(); setStageWidth(initWidth + deltax); mouseEvent.consume(); } else if (Cursor.NE_RESIZE.equals(cursor)) { if (setStageHeight(initHeight - deltay)) { primaryStage.setY(initStageY + deltay); setStageWidth(initWidth + deltax); mouseEvent.consume(); } else if (Cursor.SE_RESIZE.equals(cursor)) { setStageWidth(initWidth + deltax); setStageHeight(initHeight + deltay); mouseEvent.consume(); } else if (Cursor.S_RESIZE.equals(cursor)) { setStageHeight(initHeight + deltay); mouseEvent.consume(); } else if (Cursor.W_RESIZE.equals(cursor)) { if (setStageWidth(initWidth - deltax)) { primaryStage.setX(initStageX + deltax); if (setStageWidth(initWidth - deltax)) { primaryStage.setX(initStageX + deltax); setStageHeight(initHeight + deltay); mouseEvent.consume(); } else if (Cursor.NW_RESIZE.equals(cursor)) { if (setStageWidth(initWidth - deltax)) { primaryStage.setX(initStageX + deltax);
/** * set customMaximize property * * @param customMaximize */ public final void setCustomMaximize(final boolean customMaximize) { this.customMaximizeProperty().set(customMaximize); }
/** * set customMaximize property * * @param customMaximize */ public final void setCustomMaximize(final boolean customMaximize) { this.customMaximizeProperty().set(customMaximize); }