类javafx.scene.effect.BoxBlur源码实例Demo

下面列出了怎么用javafx.scene.effect.BoxBlur的API类实例代码及写法,或者点击链接到github查看源代码。

@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)
    {
    }
}
 
@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)
    {
    }
}
 
@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)
    {
    }
}
 
源代码4 项目: Library-Assistant   文件: AlertMaker.java
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);
}
 
源代码5 项目: narjillos   文件: MicroscopeView.java
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;
}
 
源代码6 项目: Path-of-Leveling   文件: BuildEntry_Controller.java
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);
}
 
源代码7 项目: marathonv5   文件: AlphaMediaPlayer.java
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;
}
 
源代码8 项目: marathonv5   文件: AlphaMediaPlayer.java
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;
}
 
源代码9 项目: gef   文件: MouseDragSnippet.java
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()));
		}
	}
}
 
源代码10 项目: mars-sim   文件: MainScene.java
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);

	}
 
源代码11 项目: gef   文件: MouseDragSnippet.java
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);
	}
}
 
源代码12 项目: JetUML   文件: AboutDialog.java
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);
}
 
源代码13 项目: narjillos   文件: EnvironmentView.java
private Effect getBlurEffect(double zoomLevel) {
	int blurAmount = Math.min((int) (15 * (zoomLevel - 0.7)), 10);
	return new BoxBlur(blurAmount, blurAmount, 1);
}
 
 类所在包
 类方法
 同包方法