当前位置: 首页>>代码示例>>Java>>正文


Java BoxBlur类代码示例

本文整理汇总了Java中javafx.scene.effect.BoxBlur的典型用法代码示例。如果您正苦于以下问题:Java BoxBlur类的具体用法?Java BoxBlur怎么用?Java BoxBlur使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BoxBlur类属于javafx.scene.effect包,在下文中一共展示了BoxBlur类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: changePasswordAction

import javafx.scene.effect.BoxBlur; //导入依赖的package包/类
@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)
    {
    }
}
 
开发者ID:pranavjindal999,项目名称:Hostel-Management-System,代码行数:27,代码来源:MainProgramSceneController.java

示例2: activityLogButtonAction

import javafx.scene.effect.BoxBlur; //导入依赖的package包/类
@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)
    {
    }
}
 
开发者ID:pranavjindal999,项目名称:Hostel-Management-System,代码行数:27,代码来源:MainProgramSceneController.java

示例3: viewPayBillAction

import javafx.scene.effect.BoxBlur; //导入依赖的package包/类
@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)
    {
    }
}
 
开发者ID:pranavjindal999,项目名称:Hostel-Management-System,代码行数:27,代码来源:StudentDetailController.java

示例4: showMaterialDialog

import javafx.scene.effect.BoxBlur; //导入依赖的package包/类
public static void showMaterialDialog(StackPane root, Node nodeToBeBlurred, List<JFXButton> controls, String header, String body) {
    BoxBlur blur = new BoxBlur(3, 3, 3);

    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);
}
 
开发者ID:afsalashyana,项目名称:Library-Assistant,代码行数:23,代码来源:AlertMaker.java

示例5: boxBlur

import javafx.scene.effect.BoxBlur; //导入依赖的package包/类
private Node boxBlur() {
    Text t = new Text();
    t.setText("Blurry Text!");
    t.setFill(Color.RED);
    t.setFont(Font.font("null", FontWeight.BOLD, 36));
    t.setX(10);
    t.setY(40);
 
    BoxBlur bb = new BoxBlur();
    bb.setWidth(5);
    bb.setHeight(5);
    bb.setIterations(3);
 
    t.setEffect(bb);
    //t.setTranslateX(300);
    //t.setTranslateY(100);
 
    return t;
}
 
开发者ID:SaiPradeepDandem,项目名称:javafx-demos,代码行数:20,代码来源:BlurEffectDemo.java

示例6: toNode

import javafx.scene.effect.BoxBlur; //导入依赖的package包/类
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;
}
 
开发者ID:nusco,项目名称:narjillos,代码行数:21,代码来源:MicroscopeView.java

示例7: createViewer

import javafx.scene.effect.BoxBlur; //导入依赖的package包/类
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;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:29,代码来源:AlphaMediaPlayer.java

示例8: show

import javafx.scene.effect.BoxBlur; //导入依赖的package包/类
public void show(boolean blurBackground) {
    this.blurBackground = blurBackground;

    if (blurBackground) {
        owner.getScene().getRoot().setEffect(new BoxBlur());
    }

    stage.show();
}
 
开发者ID:mpcontracting,项目名称:rpmjukebox,代码行数:10,代码来源:AbstractModalView.java

示例9: shouldClickImportPlaylistButtonWithNullFile

import javafx.scene.effect.BoxBlur; //导入依赖的package包/类
@Test
public void shouldClickImportPlaylistButtonWithNullFile() throws Exception {
    MainPanelController spyMainPanelController = spy(mainPanelController);
    ListView<Playlist> playlistPanelListView = find("#playlistPanelListView");

    CountDownLatch latch = new CountDownLatch(1);

    ThreadRunner.runOnGui(() -> {
        playlistPanelListView.getItems().add(new Playlist(PLAYLIST_ID_SEARCH, "Search Playlist", 10));
        playlistPanelListView.getSelectionModel().select(0);
        latch.countDown();
    });

    latch.await(2000, TimeUnit.MILLISECONDS);

    FileChooser mockFileChooser = mock(FileChooser.class);
    when(mockFileChooser.getExtensionFilters()).thenReturn(FXCollections.observableArrayList());
    when(mockFileChooser.showOpenDialog(any())).thenReturn(null);
    doReturn(mockFileChooser).when(spyMainPanelController).constructFileChooser();

    CountDownLatch latch2 = new CountDownLatch(1);

    ThreadRunner.runOnGui(() -> {
        spyMainPanelController.handleImportPlaylistButtonAction(new ActionEvent());
        latch2.countDown();
    });

    latch2.await(2000, TimeUnit.MILLISECONDS);

    verify(mockPlaylistManager, never()).addPlaylist(any());
    verify(mockPlaylistManager, never()).getPlaylists();
    verify(mockRoot, times(1)).setEffect(Mockito.any(BoxBlur.class));
    verify(mockRoot, times(1)).setEffect(null);
}
 
开发者ID:mpcontracting,项目名称:rpmjukebox,代码行数:35,代码来源:MainPanelControllerTest.java

示例10: shouldClickImportPlaylistButtonWhenExceptionThrown

import javafx.scene.effect.BoxBlur; //导入依赖的package包/类
@Test
public void shouldClickImportPlaylistButtonWhenExceptionThrown() throws Exception {
    MainPanelController spyMainPanelController = spy(mainPanelController);
    ListView<Playlist> playlistPanelListView = find("#playlistPanelListView");

    CountDownLatch latch = new CountDownLatch(1);

    ThreadRunner.runOnGui(() -> {
        playlistPanelListView.getItems().add(new Playlist(PLAYLIST_ID_SEARCH, "Search Playlist", 10));
        playlistPanelListView.getSelectionModel().select(0);
        latch.countDown();
    });

    latch.await(2000, TimeUnit.MILLISECONDS);

    FileChooser mockFileChooser = mock(FileChooser.class);
    when(mockFileChooser.getExtensionFilters()).thenReturn(FXCollections.observableArrayList());

    File mockFile = mock(File.class);
    when(mockFileChooser.showOpenDialog(any())).thenReturn(mockFile);
    doReturn(mockFileChooser).when(spyMainPanelController).constructFileChooser();

    doThrow(new RuntimeException("MainPanelControllerTest.shouldClickImportPlaylistButtonWhenExceptionThrown()"))
        .when(spyMainPanelController).constructFileReader(any());

    CountDownLatch latch2 = new CountDownLatch(1);

    ThreadRunner.runOnGui(() -> {
        spyMainPanelController.handleImportPlaylistButtonAction(new ActionEvent());
        latch2.countDown();
    });

    latch2.await(2000, TimeUnit.MILLISECONDS);

    verify(mockPlaylistManager, never()).addPlaylist(any());
    verify(mockPlaylistManager, never()).getPlaylists();
    verify(mockRoot, times(1)).setEffect(Mockito.any(BoxBlur.class));
    verify(mockRoot, times(1)).setEffect(null);
}
 
开发者ID:mpcontracting,项目名称:rpmjukebox,代码行数:40,代码来源:MainPanelControllerTest.java

示例11: displayOverlay

import javafx.scene.effect.BoxBlur; //导入依赖的package包/类
private void displayOverlay()
{
    BoxBlur bb = new BoxBlur();
    bb.setWidth(5);
    bb.setHeight(5);
    bb.setIterations(1);

    scene.lookup("#main").setEffect(bb);
    scene.lookup("#overlay").setStyle("visibility: visible");
}
 
开发者ID:YorkCS2016,项目名称:Antipleurdawn,代码行数:11,代码来源:BoardHandler.java

示例12: BlurPane

import javafx.scene.effect.BoxBlur; //导入依赖的package包/类
public BlurPane() {
    imageView = new ImageView();
    imageView.setFocusTraversable(false);
    BoxBlur bb = new BoxBlur();
    bb.setWidth(8);
    bb.setHeight(8);
    bb.setIterations(3);
    imageView.setEffect(bb);
}
 
开发者ID:truffle-hog,项目名称:truffle-hog,代码行数:10,代码来源:BlurPane.java

示例13: setDragEffect

import javafx.scene.effect.BoxBlur; //导入依赖的package包/类
/**
 * Setzt den Effekt, der zur Visualisierung eingesetzt wird, wenn ein Objekt
 * über dem DropTarget ist.
 *
 * @param node
 *            Knoten im Scene Graph, auf den der Effekt angewendet wird.
 */
private static void setDragEffect(final Node node) {
	node.setOpacity(DRAG_EFFECT_OPACITY_DURING_DRAG);
	// Blur-Effekt kann im Moment noch nicht in FX-CSS angegeben werden
	final BoxBlur bb = new BoxBlur();
	bb.setWidth(DRAG_EFFECT_WIDTH);
	bb.setHeight(DRAG_EFFECT_HEIGHT);
	bb.setIterations(DRAG_EFFECT_ITERATIONS);
	node.setEffect(bb);
}
 
开发者ID:Silent-Fred,项目名称:iTrySQL,代码行数:17,代码来源:SourceFileDropTargetUtil.java

示例14: blurOn

import javafx.scene.effect.BoxBlur; //导入依赖的package包/类
/**
 * Blurs the main frame of the GUI (it's AnchorPane).
 */
public void blurOn(){
	AnchorPane mainScreen = Tokanagrammar.getAnchorPane();
	ObservableList<Node> screenComponents = mainScreen.getChildren();
	
	BoxBlur bb = new BoxBlur();
	bb.setIterations(3);
	for(Node node: screenComponents)
		node.effectProperty().set(bb);
}
 
开发者ID:Tokanagrammar,项目名称:tokanagrammar-dev,代码行数:13,代码来源:GUI.java

示例15: aboutNavButtonClicked

import javafx.scene.effect.BoxBlur; //导入依赖的package包/类
@FXML
private void aboutNavButtonClicked(ActionEvent actionEvent) {

    System.out.println("{*} About button clicked.");

    BoxBlur boxBlur = new BoxBlur(2, 2, 3);

    JFXDialogLayout aboutDialogLayout = new JFXDialogLayout();

    aboutDialogLayout.setHeading(new Text("About"));
    aboutDialogLayout.setBody(new Text("Made by : Karan Pratap Singh\n\nLicenced to : @KPS"));

    aboutDialogLayout.setOpacity(1);
    aboutDialogLayout.setStyle("-fx-background-color: rgba(250,250,250,0.15)");
    aboutDialogLayout.setStyle("-fx-background-radius: 20%");
    aboutDialogLayout.applyCss();


    JFXDialog aboutDialog = new JFXDialog(backgroundStackPane,
            aboutDialogLayout,
            JFXDialog.DialogTransition.TOP);
    backgroundStackPane.setVisible(true);


    JFXButton aboutDialogButton = new JFXButton("ok");

    aboutDialog.setOnDialogOpened(
            (aboutDialogOpened) -> {

                System.out.println("{^} About dialog box opened.");
                aboutDialogButton.setOnAction((event) -> {

                    aboutDialog.close();
                    backgroundStackPane.setVisible(false);
                });

                aboutDialogLayout.setActions(aboutDialogButton);

                root.setStyle("-fx-border-color: black");
                backMedia.setEffect(boxBlur);
                recTextView.setEffect(boxBlur);
                startButton.setEffect(boxBlur);
            });

    aboutDialog.setOnDialogClosed(
            (aboutDialogClosed) -> {

                System.out.println("{^} About dialog box closed.");
                backMedia.setEffect(null);
                recTextView.setEffect(null);
                startButton.setEffect(null);
            });


    aboutDialog.show();
}
 
开发者ID:karanpratapsingh,项目名称:KenzieTheBot,代码行数:57,代码来源:MainController.java


注:本文中的javafx.scene.effect.BoxBlur类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。