List of usage examples for javafx.scene.layout CornerRadii EMPTY
CornerRadii EMPTY
To view the source code for javafx.scene.layout CornerRadii EMPTY.
Click Source Link
From source file:de.pixida.logtest.designer.automaton.Graph.java
Graph(final IAutomatonEditor aAutomatonEditor) { Validate.notNull(aAutomatonEditor);//from w ww. java2s . c om this.automatonEditor = aAutomatonEditor; this.pane.setBackground(new Background(new BackgroundFill(Color.WHITE, CornerRadii.EMPTY, Insets.EMPTY))); final double minSizeX = 800.0; final double minSizeY = 600.0; this.pane.setMinSize(minSizeX, minSizeY); final double paddingRightBottom = 8.0; this.pane.setPadding(new Insets(0.0, paddingRightBottom, paddingRightBottom, 0.0)); this.pane.setOnMouseMoved(event -> this.mouseMovedOnPane(event)); this.pane.setOnMouseClicked(event -> this.mouseClickedOnPane(event)); final MenuItem mi = new MenuItem("Create new state"); mi.setGraphic(Icons.getIconGraphics("pencil_add")); mi.setOnAction(event -> { // The following code does not really belong here as the class is designed only to handle business belongings... it should be // moved somewhere else!? final AutomatonNode newNode = new AutomatonNode(Graph.this); newNode.setPosition(new Point2D(this.lastMousePositionOnPaneX, this.lastMousePositionOnPaneY)); newNode.setName("New state"); Graph.this.addObject(newNode); Graph.this.handleChange(); Graph.this.showConfigFrameOfObject(newNode); }); this.contextMenu.getItems().add(mi); }
From source file:com.ggvaidya.scinames.complexquery.ComplexQueryViewController.java
public void setQueryStatus(String status) { if (status.equals("ok")) { queryStatusTextField.setBackground( new Background(new BackgroundFill(Paint.valueOf("green"), CornerRadii.EMPTY, Insets.EMPTY))); queryStatusTextField.setAlignment(Pos.CENTER); queryStatusTextField.setText("Query executed successfully"); } else {/* w ww. j a v a 2s.c o m*/ queryStatusTextField.setBackground( new Background(new BackgroundFill(Paint.valueOf("red"), CornerRadii.EMPTY, Insets.EMPTY))); queryStatusTextField.setAlignment(Pos.CENTER); queryStatusTextField.setText(status); } }
From source file:net.rptools.tokentool.controller.TokenTool_Controller.java
@FXML void initialize() { // Note: A Pane is added to the compositeTokenPane so the ScrollPane doesn't consume the mouse events assert fileManageOverlaysMenu != null : "fx:id=\"fileManageOverlaysMenu\" was not injected: check your FXML file 'TokenTool.fxml'."; assert fileSaveAsMenu != null : "fx:id=\"fileSaveAsMenu\" was not injected: check your FXML file 'TokenTool.fxml'."; assert fileExitMenu != null : "fx:id=\"fileExitMenu\" was not injected: check your FXML file 'TokenTool.fxml'."; assert editCaptureScreenMenu != null : "fx:id=\"editCaptureScreenMenu\" was not injected: check your FXML file 'TokenTool.fxml'."; assert editCopyImageMenu != null : "fx:id=\"editCopyImageMenu\" was not injected: check your FXML file 'TokenTool.fxml'."; assert editPasteImageMenu != null : "fx:id=\"editPasteImageMenu\" was not injected: check your FXML file 'TokenTool.fxml'."; assert helpAboutMenu != null : "fx:id=\"helpAboutMenu\" was not injected: check your FXML file 'TokenTool.fxml'."; assert saveOptionsPane != null : "fx:id=\"saveOptionsPane\" was not injected: check your FXML file 'TokenTool.fxml'."; assert overlayOptionsPane != null : "fx:id=\"overlayOptionsPane\" was not injected: check your FXML file 'TokenTool.fxml'."; assert backgroundOptionsPane != null : "fx:id=\"backgroundOptionsPane\" was not injected: check your FXML file 'TokenTool.fxml'."; assert zoomOptionsPane != null : "fx:id=\"zoomOptionsPane\" was not injected: check your FXML file 'TokenTool.fxml'."; assert compositeTokenPane != null : "fx:id=\"compositeTokenPane\" was not injected: check your FXML file 'TokenTool.fxml'."; assert tokenPreviewPane != null : "fx:id=\"tokenPreviewPane\" was not injected: check your FXML file 'TokenTool.fxml'."; assert portraitScrollPane != null : "fx:id=\"portraitScrollPane\" was not injected: check your FXML file 'TokenTool.fxml'."; assert compositeGroup != null : "fx:id=\"compositeGroup\" was not injected: check your FXML file 'TokenTool.fxml'."; assert overlayTreeView != null : "fx:id=\"overlayTreeview\" was not injected: check your FXML file 'TokenTool.fxml'."; assert portraitImageView != null : "fx:id=\"portraitImageView\" was not injected: check your FXML file 'TokenTool.fxml'."; assert maskImageView != null : "fx:id=\"maskImageView\" was not injected: check your FXML file 'TokenTool.fxml'."; assert overlayImageView != null : "fx:id=\"overlayImageView\" was not injected: check your FXML file 'TokenTool.fxml'."; assert tokenImageView != null : "fx:id=\"tokenImageView\" was not injected: check your FXML file 'TokenTool.fxml'."; assert useFileNumberingCheckbox != null : "fx:id=\"useFileNumberingCheckbox\" was not injected: check your FXML file 'TokenTool.fxml'."; assert overlayUseAsBaseCheckbox != null : "fx:id=\"overlayUseAsBaseCheckbox\" was not injected: check your FXML file 'TokenTool.fxml'."; assert clipPortraitCheckbox != null : "fx:id=\"clipPortraitCheckbox\" was not injected: check your FXML file 'TokenTool.fxml'."; assert fileNameTextField != null : "fx:id=\"fileNameTextField\" was not injected: check your FXML file 'TokenTool.fxml'."; assert fileNameSuffixLabel != null : "fx:id=\"fileNameSuffixLabel\" was not injected: check your FXML file 'TokenTool.fxml'."; assert fileNameSuffixTextField != null : "fx:id=\"fileNameSuffixTextField\" was not injected: check your FXML file 'TokenTool.fxml'."; assert overlayNameLabel != null : "fx:id=\"overlayNameLabel\" was not injected: check your FXML file 'TokenTool.fxml'."; assert backgroundColorPicker != null : "fx:id=\"backgroundColorPicker\" was not injected: check your FXML file 'TokenTool.fxml'."; assert overlayAspectToggleButton != null : "fx:id=\"overlayAspectToggleButton\" was not injected: check your FXML file 'TokenTool.fxml'."; assert portraitTransparencySlider != null : "fx:id=\"portraitTransparencySlider\" was not injected: check your FXML file 'TokenTool.fxml'."; assert portraitBlurSlider != null : "fx:id=\"portraitBlurSlider\" was not injected: check your FXML file 'TokenTool.fxml'."; assert portraitGlowSlider != null : "fx:id=\"portraitGlowSlider\" was not injected: check your FXML file 'TokenTool.fxml'."; assert overlayTransparencySlider != null : "fx:id=\"overlayTransparencySlider\" was not injected: check your FXML file 'TokenTool.fxml'."; assert overlayWidthSpinner != null : "fx:id=\"overlayWidthSpinner\" was not injected: check your FXML file 'TokenTool.fxml'."; assert overlayHeightSpinner != null : "fx:id=\"overlayHeightSpinner\" was not injected: check your FXML file 'TokenTool.fxml'."; assert overlayTreeProgressBar != null : "fx:id=\"overlayTreeProgressIndicator\" was not injected: check your FXML file 'ManageOverlays.fxml'."; executorService = Executors.newCachedThreadPool(runable -> { loadOverlaysThread = Executors.defaultThreadFactory().newThread(runable); loadOverlaysThread.setDaemon(true); return loadOverlaysThread; });/*from w w w . j a v a2s. c o m*/ overlayTreeView.setShowRoot(false); overlayTreeView.getSelectionModel().selectedItemProperty().addListener( (observable, oldValue, newValue) -> updateCompositImageView((TreeItem<Path>) newValue)); addPseudoClassToLeafs(overlayTreeView); // Bind color picker to compositeTokenPane background fill backgroundColorPicker.setValue(Color.TRANSPARENT); ObjectProperty<Background> background = compositeTokenPane.backgroundProperty(); background.bind(Bindings.createObjectBinding(() -> { BackgroundFill fill = new BackgroundFill(backgroundColorPicker.getValue(), CornerRadii.EMPTY, Insets.EMPTY); return new Background(fill); }, backgroundColorPicker.valueProperty())); // Bind transparency slider to portraitImageView opacity portraitTransparencySlider.valueProperty().addListener(new ChangeListener<Number>() { public void changed(ObservableValue<? extends Number> ov, Number old_val, Number new_val) { portraitImageView.setOpacity(new_val.doubleValue()); updateTokenPreviewImageView(); } }); // // Restrict text field to valid filename characters // Pattern validDoubleText = Pattern.compile("[^a-zA-Z0-9\\\\._ \\\\/`~!@#$%\\\\^&\\\\(\\\\)\\\\-\\\\=\\\\+\\\\[\\\\]\\\\{\\\\}',\\\\\\\\:]"); // Pattern validText = Pattern.compile("[^a-zA-Z0-9 ]"); // TextFormatter<> textFormatter = new TextFormatter<>( // change -> { // String newText = change.getControlNewText(); // if (validText.matcher(newText).matches()) { // return change; // } else // return null; // }); // UnaryOperator<TextFormatter.Change> filter = new UnaryOperator<TextFormatter.Change>() { // @Override // public TextFormatter.Change apply(TextFormatter.Change t) { // String validText = "[^a-zA-Z0-9]"; // // if (t.isReplaced()) // if (t.getText().matches(validText)) // t.setText(t.getControlText().substring(t.getRangeStart(), t.getRangeEnd())); // // if (t.isAdded()) { // if (t.getText().matches(validText)) { // return null; // } // } // // return t; // } // }; UnaryOperator<Change> filter = change -> { String text = change.getText(); if (text.matches(AppConstants.VALID_FILE_NAME_PATTERN)) { return change; } else { change.setText(FileSaveUtil.cleanFileName(text)); ; return change; } // // return null; }; TextFormatter<String> textFormatter = new TextFormatter<>(filter); fileNameTextField.setTextFormatter(textFormatter); // Effects GaussianBlur gaussianBlur = new GaussianBlur(0); Glow glow = new Glow(0); gaussianBlur.setInput(glow); // Bind blur slider to portraitImageView opacity portraitBlurSlider.valueProperty().addListener(new ChangeListener<Number>() { public void changed(ObservableValue<? extends Number> ov, Number old_val, Number new_val) { gaussianBlur.setRadius(new_val.doubleValue()); portraitImageView.setEffect(gaussianBlur); updateTokenPreviewImageView(); } }); // Bind glow slider to portraitImageView opacity portraitGlowSlider.valueProperty().addListener(new ChangeListener<Number>() { public void changed(ObservableValue<? extends Number> ov, Number old_val, Number new_val) { glow.setLevel(new_val.doubleValue()); portraitImageView.setEffect(gaussianBlur); updateTokenPreviewImageView(); } }); // Bind transparency slider to overlayImageView opacity overlayTransparencySlider.valueProperty().addListener(new ChangeListener<Number>() { public void changed(ObservableValue<? extends Number> ov, Number old_val, Number new_val) { overlayImageView.setOpacity(new_val.doubleValue()); updateTokenPreviewImageView(); } }); // Bind width/height spinners to overlay width/height overlayWidthSpinner.getValueFactory().valueProperty() .bindBidirectional(overlayHeightSpinner.getValueFactory().valueProperty()); overlayWidthSpinner.valueProperty().addListener( (observable, oldValue, newValue) -> overlayWidthSpinner_onTextChanged(oldValue, newValue)); overlayHeightSpinner.valueProperty().addListener( (observable, oldValue, newValue) -> overlayHeightSpinner_onTextChanged(oldValue, newValue)); }
From source file:editeurpanovisu.EditeurPanovisu.java
/** * *//*from ww w. j ava 2 s.co m*/ private static void installeEvenements() { /** * */ getScnPrincipale().widthProperty().addListener( (ObservableValue<? extends Number> observableValue, Number oldSceneWidth, Number newSceneWidth) -> { if ((double) newSceneWidth < 1280) { } double largeur = (double) newSceneWidth - largeurOutils - 20; apPanovisu.setLayoutX((double) newSceneWidth - largeurOutils); spVuePanoramique.setPrefWidth(largeur); spVuePanoramique.setBackground( new Background(new BackgroundFill(Color.BLUE, CornerRadii.EMPTY, Insets.EMPTY))); gestionnaireInterface.getApVis().setPrefWidth((double) newSceneWidth - largeurOutils - 20); if ((double) newSceneWidth - largeurOutils - 20 < gestionnaireInterface.getApVis() .getMaxWidth()) { gestionnaireInterface.getApVis().setMinWidth((double) newSceneWidth - largeurOutils - 20); } if ((double) newSceneWidth - largeurOutils - 20 < gestionnairePlan.getApPlan().getMaxWidth()) { gestionnairePlan.getApPlan().setMinWidth((double) newSceneWidth - largeurOutils - 20); } gestionnairePlan.getApPlan().setPrefWidth((double) newSceneWidth - largeurOutils - 20); }); /** * */ getScnPrincipale().heightProperty().addListener((ObservableValue<? extends Number> observableValue, Number oldSceneHeight, Number newSceneHeight) -> { spVuePanoramique.setPrefHeight((double) newSceneHeight - 130.0d - getiDecalageMac()); spPanneauOutils.setPrefHeight((double) newSceneHeight - 130.0d - getiDecalageMac()); spVuePanoramique .setBackground(new Background(new BackgroundFill(Color.BLUE, CornerRadii.EMPTY, Insets.EMPTY))); if ((double) newSceneHeight - 130.0d - getiDecalageMac() < gestionnaireInterface.getSpOutils() .getMaxHeight()) { gestionnaireInterface.getSpOutils() .setMinHeight((double) newSceneHeight - 130.0d - getiDecalageMac()); } gestionnaireInterface.getSpOutils().setPrefHeight((double) newSceneHeight - 130.0d - getiDecalageMac()); gestionnairePlan.getSpOutils().setPrefHeight((double) newSceneHeight - 130 - getiDecalageMac()); if ((double) newSceneHeight - 130 - getiDecalageMac() < gestionnairePlan.getSpOutils().getMaxHeight()) { gestionnairePlan.getSpOutils().setMinHeight((double) newSceneHeight - 130 - getiDecalageMac()); } }); getScnPrincipale().setOnKeyPressed((clavierEvt) -> { //System.out.println("Code clavier : " + clavierEvt.getCode()); if (clavierEvt.isControlDown()) { if (clavierEvt.getText().toLowerCase().equals("l")) { clavierEvt.consume(); setAfficheLoupe(!isAfficheLoupe()); apLoupe.setVisible(isAfficheLoupe()); Point p = MouseInfo.getPointerInfo().getLocation(); if (p.x < getiTailleLoupe() + 80 && p.y < getiTailleLoupe() + 160) { apLoupe.setLayoutX(ivImagePanoramique.getFitWidth() - getiTailleLoupe() + 5); apLoupe.setLayoutY(35); strPositLoupe = "droite"; } else { apLoupe.setLayoutX(35); apLoupe.setLayoutY(35); strPositLoupe = "gauche"; } } } if (clavierEvt.getText().equals("+")) { setiTailleLoupe(getiTailleLoupe() + 10); creeLoupe(); afficheLoupe(positLoupeX, positLoupeY); } if (clavierEvt.getText().equals("-")) { setiTailleLoupe(getiTailleLoupe() - 10); creeLoupe(); afficheLoupe(positLoupeX, positLoupeY); } }); /** * */ panePanoramique.setOnMouseClicked((mouseEvent) -> { gereSourisPanoramique(mouseEvent); }); /** * */ panePanoramique.setOnMouseMoved((mouseEvent) -> { if (bEstCharge) { double mouseX = mouseEvent.getSceneX() - ivImagePanoramique.getLayoutX(); if (mouseX < 0) { mouseX = 0; } if (mouseX > ivImagePanoramique.getFitWidth()) { mouseX = ivImagePanoramique.getFitWidth(); } double mouseY = mouseEvent.getSceneY() - panePanoramique.getLayoutY() - 130 - getiDecalageMac(); if (mouseY < 0) { mouseY = 0; } if (mouseY > ivImagePanoramique.getFitHeight()) { mouseY = ivImagePanoramique.getFitHeight(); } double longitude, latitude; double largeur = ivImagePanoramique.getFitWidth() * panePanoramique.getScaleX(); longitude = 360.0f * mouseX / largeur - 180; latitude = 90.0d - 2.0f * mouseY / largeur * 180.0f; String strLong = "Long : " + String.format("%.1f", longitude); String strLat = "Lat : " + String.format("%.1f", latitude); lblLong.setText(strLong); lblLat.setText(strLat); afficheLoupe(mouseX, mouseY); } }); cbListeChoixPanoramique.valueProperty().addListener((ov, ancienneValeur, nouvelleValeur) -> { if (nouvelleValeur != null) { if (!(nouvelleValeur.equals(strPanoAffiche))) { valideHS(); strPanoAffiche = nouvelleValeur.toString(); } } }); }
From source file:org.cryptomator.ui.util.PasswordStrengthUtil.java
public Background getBackgroundWithStrengthColor(Number score) { Color c = this.getStrengthColor(score); BackgroundFill fill = new BackgroundFill(c, CornerRadii.EMPTY, Insets.EMPTY); return new Background(fill); }