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


Java ImageView.setEffect方法代码示例

本文整理汇总了Java中javafx.scene.image.ImageView.setEffect方法的典型用法代码示例。如果您正苦于以下问题:Java ImageView.setEffect方法的具体用法?Java ImageView.setEffect怎么用?Java ImageView.setEffect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.image.ImageView的用法示例。


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

示例1: showQRCode

import javafx.scene.image.ImageView; //导入方法依赖的package包/类
@FXML
protected void showQRCode(MouseEvent event) {
    // Serialize to PNG and back into an image. Pretty lame but it's the shortest code to write and I'm feeling
    // lazy tonight.
    final byte[] imageBytes = QRCode
            .from(uri())
            .withSize(320, 240)
            .to(ImageType.PNG)
            .stream()
            .toByteArray();
    Image qrImage = new Image(new ByteArrayInputStream(imageBytes));
    ImageView view = new ImageView(qrImage);
    view.setEffect(new DropShadow());
    // Embed the image in a pane to ensure the drop-shadow interacts with the fade nicely, otherwise it looks weird.
    // Then fix the width/height to stop it expanding to fill the parent, which would result in the image being
    // non-centered on the screen. Finally fade/blur it in.
    Pane pane = new Pane(view);
    pane.setMaxSize(qrImage.getWidth(), qrImage.getHeight());
    final Main.OverlayUI<ClickableBitcoinAddress> overlay = Main.instance.overlayUI(pane, this);
    view.setOnMouseClicked(event1 -> overlay.done());
}
 
开发者ID:creativechain,项目名称:creacoinj,代码行数:22,代码来源:ClickableBitcoinAddress.java

示例2: ReflectionSample

import javafx.scene.image.ImageView; //导入方法依赖的package包/类
public ReflectionSample() {
    super(100,200);
    ImageView sample = new ImageView(BOAT);
    sample.setPreserveRatio(true);
    sample.setFitHeight(100);
    final Reflection reflection = new Reflection();
    sample.setEffect(reflection);
    getChildren().add(sample);
    // REMOVE ME
    setControls(
            new SimplePropertySheet.PropDesc("Reflection Bottom Opacity", reflection.bottomOpacityProperty(), 0d, 1d),
            new SimplePropertySheet.PropDesc("Reflection Top Opacity", reflection.topOpacityProperty(), 0d, 1d),
            new SimplePropertySheet.PropDesc("Reflection Fraction", reflection.fractionProperty(), 0d, 1d),
            new SimplePropertySheet.PropDesc("Reflection Top Offset", reflection.topOffsetProperty(), -10d, 10d)
    );
    // END REMOVE ME
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:18,代码来源:ReflectionSample.java

示例3: SepiaToneSample

import javafx.scene.image.ImageView; //导入方法依赖的package包/类
public SepiaToneSample() {
    ImageView sample = new ImageView(BOAT);
    final SepiaTone sepiaTone = new SepiaTone();
    sepiaTone.setLevel(0.5d);
    sample.setEffect(sepiaTone);
    getChildren().add(sample);
    // REMOVE ME
    setControls(
            new SimplePropertySheet.PropDesc("SepiaTone Level", sepiaTone.levelProperty(), 0d, 1d)
    );
    // END REMOVE ME
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:13,代码来源:SepiaToneSample.java

示例4: createIconContent

import javafx.scene.image.ImageView; //导入方法依赖的package包/类
public static Node createIconContent() {
    ImageView iv = new ImageView(BOAT);
    iv.setFitWidth(80);
    iv.setFitHeight(80);
    iv.setViewport(new Rectangle2D(90,0,332,332));
    final SepiaTone SepiaTone = new SepiaTone();
    SepiaTone.setLevel(1);
    iv.setEffect(SepiaTone);
    return iv;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:11,代码来源:SepiaToneSample.java

示例5: GaussianBlurSample

import javafx.scene.image.ImageView; //导入方法依赖的package包/类
public GaussianBlurSample() {
    super(48,48);
    ImageView sample = new ImageView(ICON_48);
    final GaussianBlur gaussianBlur = new GaussianBlur();
    gaussianBlur.setRadius(8d);
    sample.setEffect(gaussianBlur);
    getChildren().add(sample);
    // REMOVE ME
    setControls(
            new SimplePropertySheet.PropDesc("GaussianBlur Level", gaussianBlur.radiusProperty(), 0d, 15d)
    );
    // END REMOVE ME
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:14,代码来源:GaussianBlurSample.java

示例6: start

import javafx.scene.image.ImageView; //导入方法依赖的package包/类
@Override
public void start(Stage stage) {
    Group root = new Group();
    Scene scene = new Scene(root, 180, 180);
    scene.setFill(Color.BLACK);
    stage.setScene(scene);
    stage.setTitle("Scrollbar");
    root.getChildren().addAll(vb, sc);

    shadow.setColor(Color.GREY);
    shadow.setOffsetX(2);
    shadow.setOffsetY(2);

    vb.setLayoutX(5);
    vb.setSpacing(10);

    sc.setLayoutX(scene.getWidth()-sc.getWidth());
    sc.setMin(0);
    sc.setOrientation(Orientation.VERTICAL);
    sc.setPrefHeight(180);
    sc.setMax(360);

    for (int i = 0; i < 5; i++) {
        final Image image = images[i] =
            new Image(getClass().getResourceAsStream("fw" +(i+1)+ ".jpg"));
        final ImageView pic = pics[i] =
            new ImageView(images[i]);
        pic.setEffect(shadow);
        vb.getChildren().add(pics[i]);
    }
    
  

  sc.valueProperty().addListener((ObservableValue<? extends Number> ov, 
        Number old_val, Number new_val) -> {
            vb.setLayoutY(-new_val.doubleValue());
    });  

    stage.show();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:41,代码来源:ScrollBarSample.java

示例7: execute

import javafx.scene.image.ImageView; //导入方法依赖的package包/类
/**
 * Shows the current image into the screen.
 */
@Override
public void execute() {
    getNode().getChildren().remove(getNode().getContainer());
    getNode().setMinSize(180,160);
    ImageView img = new ImageView(getImage());
    img.setFitWidth(140.0f);
    img.setFitHeight(120.0f);
    img.setEffect(new DropShadow());
    getNode().setActionIcon(img);
    getNode().getChildren().add( getNode().createContainer() );
    setOpenWinEvent();
}
 
开发者ID:Theldus,项目名称:PSE,代码行数:16,代码来源:Output.java

示例8: PerspectiveImage

import javafx.scene.image.ImageView; //导入方法依赖的package包/类
public PerspectiveImage(Image image) {
    ImageView imageView = new ImageView(image);
    imageView.setEffect(ReflectionBuilder.create().fraction(REFLECTION_SIZE).build());
    setEffect(transform);
    getChildren().addAll(imageView);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:DisplayShelf.java

示例9: MovieCell

import javafx.scene.image.ImageView; //导入方法依赖的package包/类
public MovieCell(MovieView movieView) {
    this.movieView = movieView;

    GridPane gridPane = new GridPane();

    ColumnConstraints col1 = new ColumnConstraints();
    ColumnConstraints col2 = new ColumnConstraints();
    ColumnConstraints col3 = new ColumnConstraints();
    ColumnConstraints col4 = new ColumnConstraints();
    ColumnConstraints col5 = new ColumnConstraints();

    col4.setHgrow(Priority.ALWAYS);

    gridPane.getColumnConstraints().setAll(col1, col2, col3, col4, col5);
    gridPane.setHgap(10);

    // director image
    directorImage = new ImageView();
    directorImage.setFitWidth(60);
    directorImage.setFitHeight(60);
    directorImage.setEffect(new InnerShadow());
    gridPane.add(directorImage, 0, 0);
    GridPane.setRowSpan(directorImage, 2);
    GridPane.setValignment(directorImage, VPos.TOP);

    // title and year
    titleLabel = new Label();
    titleLabel.getStyleClass().add("title-label");
    gridPane.add(titleLabel, 1, 0);
    GridPane.setColumnSpan(titleLabel, 2);
    GridPane.setValignment(titleLabel, VPos.TOP);

    // director label
    directorLabel = new Label();
    directorLabel.getStyleClass().add("director-label");
    gridPane.add(directorLabel, 1, 1);
    GridPane.setValignment(directorLabel, VPos.TOP);

    // genre label
    genreLabel = new Label();
    genreLabel.getStyleClass().add("genre-label");
    gridPane.add(genreLabel, 4, 0);

    // trailer label
    trailerLabel = FontAwesomeIconFactory.get().createIconLabel(FontAwesomeIcon.FILM, "", "14px", "14px", ContentDisplay.GRAPHIC_ONLY);
    trailerLabel.getStyleClass().add("trailer-label");
    gridPane.add(trailerLabel, 3, 0);
    GridPane.setHalignment(trailerLabel, HPos.LEFT);
    GridPane.setValignment(trailerLabel, VPos.TOP);

    trailerLabel.setOnMouseClicked(evt -> {
        try {
            Movie movie = getItem();
            movieView.setSelectedTrailer(MovieApp.class.getResource("/trailers/" + movie.getTrailer()).toExternalForm());
        } catch (NullPointerException e) {
            movieView.setSelectedTrailer(MovieApp.class.getResource("/TrailerMissing.mp4").toExternalForm());
        }
    });

    setGraphic(gridPane);
    setContentDisplay(ContentDisplay.GRAPHIC_ONLY);

    movieView.useClippingProperty().addListener(it -> updateClipping());
    updateClipping();
}
 
开发者ID:hendrikebbers,项目名称:ExtremeGuiMakeover,代码行数:66,代码来源:MovieCell.java

示例10: clickSelectCardHandle

import javafx.scene.image.ImageView; //导入方法依赖的package包/类
@FXML

    public void clickSelectCardHandle(Event event){

        ImageView tmp = (ImageView) event.getSource();

        LocatedImage img = (LocatedImage) tmp.getImage();

        this.carteClicked = img.getURL();     

        if(this.carteSelected.contains(img.getURL())){

            tmp.setEffect(null);

            this.carteSelected.remove( img.getURL());

            

        }else{

            DropShadow ds = new DropShadow(20,Color.AQUA);

            tmp.setEffect(ds);

            this.carteSelected.add( img.getURL());

        }

    }
 
开发者ID:tillind,项目名称:pandemie,代码行数:30,代码来源:BoardController.java


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