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


Java ImageView.getImage方法代码示例

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


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

示例1: sourceSetOnDragDetected

import javafx.scene.image.ImageView; //导入方法依赖的package包/类
private void sourceSetOnDragDetected(ImageView source, MouseEvent e) {
	Dragboard db = source.startDragAndDrop(TransferMode.COPY);
	ClipboardContent content = new ClipboardContent();
	Image sourceImage = source.getImage();
	String imageName = getImageName(sourceImage);
	content.putString(imageName);
	content.putImage(source.getImage());
	db.setContent(content);
	e.consume();
}
 
开发者ID:LtubSalad,项目名称:voogasalad-ltub,代码行数:11,代码来源:ScreenObjectHolder.java

示例2: show

import javafx.scene.image.ImageView; //导入方法依赖的package包/类
@Override
@FXThread
protected void show() {

    final ImageView imageView = getImageView();
    if (imageView.getImage() == null) {
        showImage(path);
    }

    super.show();
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:12,代码来源:ImagePreview.java

示例3: addSupport

import javafx.scene.image.ImageView; //导入方法依赖的package包/类
/**
 * Adds support changing icons by selection.
 *
 * @param button the button.
 */
@FXThread
public static void addSupport(@NotNull final ToggleButton button) {

    final EditorConfig editorConfig = EditorConfig.getInstance();
    final CssColorTheme theme = editorConfig.getTheme();

    if (!theme.needRepaintIcons()) {
        return;
    }

    final ImageView graphic = (ImageView) button.getGraphic();
    final Image image = graphic.getImage();
    final Image original = FILE_ICON_MANAGER.getOriginal(image);

    final ObservableMap<Object, Object> properties = button.getProperties();
    properties.put(NOT_SELECTED_IMAGE, image);
    properties.put(SELECTED_IMAGE, original);

    button.selectedProperty().addListener((observable, oldValue, newValue) -> {
        if (newValue) {
            graphic.setImage((Image) properties.get(SELECTED_IMAGE));
        } else {
            graphic.setImage((Image) properties.get(NOT_SELECTED_IMAGE));
        }
    });

    if (button.isSelected()) {
        graphic.setImage(original);
    } else {
        graphic.setImage(image);
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:38,代码来源:DynamicIconSupport.java

示例4: updateListener

import javafx.scene.image.ImageView; //导入方法依赖的package包/类
@FXThread
private static void updateListener(@NotNull final Node node, @NotNull final ImageView imageView,
                                   @NotNull final ReadOnlyBooleanProperty condition,
                                   @NotNull final Object listenerKey, @NotNull final Object notSelectedKey,
                                   @NotNull final Object selectedKey) {

    final EditorConfig editorConfig = EditorConfig.getInstance();
    final CssColorTheme theme = editorConfig.getTheme();

    if (!theme.needRepaintIcons()) {
        return;
    }

    final ObservableMap<Object, Object> properties = node.getProperties();
    final Image newImage = imageView.getImage();

    if (newImage == null) {
        properties.remove(listenerKey);
        return;
    }

    final Image original = FILE_ICON_MANAGER.getOriginal(newImage);

    properties.put(notSelectedKey, newImage);
    properties.put(selectedKey, original);

    final ChangeListener<Boolean> listener = (observable, oldValue, newValue) -> {
        if (newValue) {
            imageView.setImage((Image) properties.get(selectedKey));
        } else {
            imageView.setImage((Image) properties.get(notSelectedKey));
        }
    };

    condition.addListener(listener);

    properties.put(listenerKey, listener);

    if (condition.get()) {
        imageView.setImage(original);
    } else {
        imageView.setImage(newImage);
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:45,代码来源:DynamicIconSupport.java

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