javafx.scene.effect.BoxBlur Java Examples
The following examples show how to use
javafx.scene.effect.BoxBlur.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MainProgramSceneController.java From Hostel-Management-System with MIT License | 6 votes |
@FXML private void changePasswordAction(ActionEvent event) { mainTopAnchorPane.setEffect(new BoxBlur()); passwordStage = new Stage(); passwordStage.setOnCloseRequest(new EventHandler<WindowEvent>() { @Override public void handle(WindowEvent t) { mainTopAnchorPane.effectProperty().setValue(null); } }); passwordStage.setTitle("Change Password"); passwordStage.initModality(Modality.APPLICATION_MODAL); passwordStage.initStyle(StageStyle.UTILITY); passwordStage.setResizable(false); try { Parent passwordParent = FXMLLoader.load(getClass().getResource("changepassword.fxml")); passwordStage.setScene(new Scene(passwordParent)); passwordStage.show(); } catch (IOException ex) { } }
Example #2
Source File: MainProgramSceneController.java From Hostel-Management-System with MIT License | 6 votes |
@FXML private void activityLogButtonAction(ActionEvent event) { mainTopAnchorPane.setEffect(new BoxBlur()); passwordStage = new Stage(); passwordStage.setOnCloseRequest(new EventHandler<WindowEvent>() { @Override public void handle(WindowEvent t) { mainTopAnchorPane.effectProperty().setValue(null); } }); passwordStage.setTitle("Activity Log"); passwordStage.initModality(Modality.APPLICATION_MODAL); passwordStage.initStyle(StageStyle.UTILITY); passwordStage.setResizable(false); try { Parent passwordParent = FXMLLoader.load(getClass().getResource("activityLog.fxml")); passwordStage.setScene(new Scene(passwordParent)); passwordStage.show(); } catch (IOException ex) { } }
Example #3
Source File: StudentDetailController.java From Hostel-Management-System with MIT License | 6 votes |
@FXML private void viewPayBillAction(ActionEvent event) { MainProgramSceneController.mainTopAnchorPane.setEffect(new BoxBlur()); billStage = new Stage(); billStage.setOnCloseRequest(new EventHandler<WindowEvent>() { @Override public void handle(WindowEvent t) { MainProgramSceneController.mainTopAnchorPane.effectProperty().setValue(null); } }); billStage.setTitle("View And Pay Due Bills"); billStage.initModality(Modality.APPLICATION_MODAL); billStage.initStyle(StageStyle.UTILITY); billStage.setResizable(false); try { Parent passwordParent = FXMLLoader.load(getClass().getResource("viewPayBill.fxml")); billStage.setScene(new Scene(passwordParent)); billStage.show(); } catch (IOException ex) { } }
Example #4
Source File: AlertMaker.java From Library-Assistant with Apache License 2.0 | 6 votes |
public static void showMaterialDialog(StackPane root, Node nodeToBeBlurred, List<JFXButton> controls, String header, String body) { BoxBlur blur = new BoxBlur(3, 3, 3); if (controls.isEmpty()) { controls.add(new JFXButton("Okay")); } JFXDialogLayout dialogLayout = new JFXDialogLayout(); JFXDialog dialog = new JFXDialog(root, dialogLayout, JFXDialog.DialogTransition.TOP); controls.forEach(controlButton -> { controlButton.getStyleClass().add("dialog-button"); controlButton.addEventHandler(MouseEvent.MOUSE_CLICKED, (MouseEvent mouseEvent) -> { dialog.close(); }); }); dialogLayout.setHeading(new Label(header)); dialogLayout.setBody(new Label(body)); dialogLayout.setActions(controls); dialog.show(); dialog.setOnDialogClosed((JFXDialogEvent event1) -> { nodeToBeBlurred.setEffect(null); }); nodeToBeBlurred.setEffect(blur); }
Example #5
Source File: MicroscopeView.java From narjillos with MIT License | 6 votes |
public Node toNode() { Vector screenSize = viewport.getSizeSC(); if (screenSize.equals(currentScreenSize)) return microscope; currentScreenSize = screenSize; double minScreenSize = Math.min(screenSize.x, screenSize.y); double maxScreenSize = Math.max(screenSize.x, screenSize.y); // Leave an ample left/bottom black margin - otherwise, the background // will be visible for a moment while enlarging the window. Rectangle black = new Rectangle(-10, -10, maxScreenSize + 1000, maxScreenSize + 1000); Circle hole = new Circle(screenSize.x / 2, screenSize.y / 2, minScreenSize / 2.03); microscope = Shape.subtract(black, hole); microscope.setEffect(new BoxBlur(5, 5, 1)); return microscope; }
Example #6
Source File: BuildEntry_Controller.java From Path-of-Leveling with MIT License | 5 votes |
public void initDisabledBuild(){ isDisabledInLauncher = true; BoxBlur b = new BoxBlur(); b.setWidth(5.0); b.setHeight(5.0); b.setIterations(1); Blend bl = new Blend(); bl.setMode(BlendMode.SRC_OVER); bl.setOpacity(1.0); bl.setTopInput(b); disabledPanel.setEffect(b); //disabledPanel.setVisible(true); nonValidPanel.setVisible(true); }
Example #7
Source File: AlphaMediaPlayer.java From marathonv5 with Apache License 2.0 | 5 votes |
private static Group createViewer(final MediaPlayer player, final double scale, boolean blur) { Group mediaGroup = new Group(); final MediaView mediaView = new MediaView(player); if (blur) { BoxBlur bb = new BoxBlur(); bb.setWidth(4); bb.setHeight(4); bb.setIterations(1); mediaView.setEffect(bb); } double width = player.getMedia().getWidth(); double height = player.getMedia().getHeight(); mediaView.setFitWidth(width); mediaView.setTranslateX(-width/2.0); mediaView.setScaleX(-scale); mediaView.setFitHeight(height); mediaView.setTranslateY(-height/2.0); mediaView.setScaleY(scale); mediaView.setDepthTest(DepthTest.ENABLE); mediaGroup.getChildren().add(mediaView); return mediaGroup; }
Example #8
Source File: AlphaMediaPlayer.java From marathonv5 with Apache License 2.0 | 5 votes |
private static Group createViewer(final MediaPlayer player, final double scale, boolean blur) { Group mediaGroup = new Group(); final MediaView mediaView = new MediaView(player); if (blur) { BoxBlur bb = new BoxBlur(); bb.setWidth(4); bb.setHeight(4); bb.setIterations(1); mediaView.setEffect(bb); } double width = player.getMedia().getWidth(); double height = player.getMedia().getHeight(); mediaView.setFitWidth(width); mediaView.setTranslateX(-width/2.0); mediaView.setScaleX(-scale); mediaView.setFitHeight(height); mediaView.setTranslateY(-height/2.0); mediaView.setScaleY(scale); mediaView.setDepthTest(DepthTest.ENABLE); mediaGroup.getChildren().add(mediaView); return mediaGroup; }
Example #9
Source File: MouseDragSnippet.java From gef with Eclipse Public License 2.0 | 5 votes |
protected void onMouseEvent(MouseEvent event) { if (pressed == null) { // no processing if no node is pressed return; } // node is pressed, process all mouse events EventType<? extends Event> type = event.getEventType(); if (type.equals(MouseEvent.MOUSE_RELEASED)) { System.out.println("release " + pressed); pressed.setEffect(null); IAnchor ifxAnchor = anchors.get(pressed); if (ifxAnchor != null) { Set<AnchorKey> keys = ifxAnchor.positionsUnmodifiableProperty() .keySet(); for (AnchorKey key : keys) { key.getAnchored().setEffect(new BoxBlur()); } } pressed = null; nodesUnderMouse.clear(); } else if (type.equals(MouseEvent.MOUSE_DRAGGED)) { double dx = event.getSceneX() - startMousePosition.getX(); double dy = event.getSceneY() - startMousePosition.getY(); pressed.setLayoutX(startLayoutPosition.getX() + dx); pressed.setLayoutY(startLayoutPosition.getY() + dy); boolean changed = updateNodesUnderMouse(event.getSceneX(), event.getSceneY()); if (changed) { System.out.println( "targets: " + Arrays.asList(nodesUnderMouse.toArray())); } } }
Example #10
Source File: MainScene.java From mars-sim with GNU General Public License v3.0 | 5 votes |
public static void disableSound() { // logger.log(Level.SEVERE, "Disabling the sound UI in MainScene."); BoxBlur blur = new BoxBlur(1.0, 1.0, 1); soundVBox.setEffect(blur); if (musicSlider != null) { musicSlider.setDisable(true);// .setValue(0); musicSlider.setEffect(blur); } if (soundEffectSlider != null) { soundEffectSlider.setDisable(true);// .setValue(0); soundEffectSlider.setEffect(blur); } if (musicMuteBox != null) { musicMuteBox.setDisable(true); musicMuteBox.setEffect(blur); } if (soundEffectMuteBox != null) { soundEffectMuteBox.setEffect(blur); soundEffectMuteBox.setDisable(true); } // if (effectLabel != null) effectLabel.setEffect(blur); // if (trackLabel != null) trackLabel.setEffect(blur); }
Example #11
Source File: MouseDragSnippet.java From gef with Eclipse Public License 2.0 | 4 votes |
protected void onSceneSizeChange(double width, double height) { // clear visuals anchors.clear(); contentLayer.getChildren().clear(); handleLayer.getChildren().clear(); // generate contents int count = 64; for (int i = 0; i < count; i++) { handleLayer.getChildren().add(draggable(generate(width, height))); } // generate random curves between for (int i = 0; i < count; i++) { Node n = handleLayer.getChildren() .get((int) (Math.random() * count / 2)); Node m = null; while (m == null || m == n) { m = handleLayer.getChildren() .get((int) (Math.random() * count / 2)); } Connection connection = new Connection(); IAnchor an, am; if (anchors.containsKey(n)) { an = anchors.get(n); } else { an = new DynamicAnchor(n); anchors.put(n, an); } if (anchors.containsKey(m)) { am = anchors.get(m); } else { am = new DynamicAnchor(n); anchors.put(m, am); } connection.setStartAnchor(an); connection.setEndAnchor(am); connection.setEffect(new BoxBlur()); contentLayer.getChildren().add(connection); } }
Example #12
Source File: AboutDialog.java From JetUML with GNU General Public License v3.0 | 4 votes |
private Scene createScene() { final int verticalSpacing = 5; VBox info = new VBox(verticalSpacing); Text name = new Text(RESOURCES.getString("application.name")); name.setStyle("-fx-font-size: 18pt;"); Text version = new Text(String.format("%s %s", RESOURCES.getString("dialog.about.version"), UMLEditor.VERSION)); Text copyright = new Text(RESOURCES.getString("application.copyright")); Text license = new Text(RESOURCES.getString("dialog.about.license")); Text quotes = new Text(RESOURCES.getString("quotes.copyright")); Hyperlink link = new Hyperlink(RESOURCES.getString("dialog.about.link")); link.setBorder(Border.EMPTY); link.setPadding(new Insets(0)); link.setOnMouseClicked(e -> UMLEditor.openBrowser(RESOURCES.getString("dialog.about.url"))); link.setUnderline(true); link.setFocusTraversable(false); info.getChildren().addAll(name, version, copyright, license, link, quotes); final int padding = 15; HBox layout = new HBox(padding); layout.setStyle("-fx-background-color: gainsboro;"); layout.setPadding(new Insets(padding)); layout.setAlignment(Pos.CENTER_LEFT); ImageView logo = new ImageView(RESOURCES.getString("application.icon")); logo.setEffect(new BoxBlur()); layout.getChildren().addAll(logo, info); layout.setAlignment(Pos.TOP_CENTER); aStage.requestFocus(); aStage.addEventHandler(KeyEvent.KEY_PRESSED, pEvent -> { if (pEvent.getCode() == KeyCode.ENTER) { aStage.close(); } }); return new Scene(layout); }
Example #13
Source File: EnvironmentView.java From narjillos with MIT License | 4 votes |
private Effect getBlurEffect(double zoomLevel) { int blurAmount = Math.min((int) (15 * (zoomLevel - 0.7)), 10); return new BoxBlur(blurAmount, blurAmount, 1); }