1 Star 0 Fork 0

Tinyhorse/export_fig

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
ImageSelection.java 1.03 KB
一键复制 编辑 原始数据 按行查看 历史
/*
* Based on code snippet from
* http://java.sun.com/developer/technicalArticles/releases/data/
*
* Copyright 2008, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms.
*/
import java.awt.image.BufferedImage;
import java.awt.datatransfer.*;
public class ImageSelection implements Transferable {
private static final DataFlavor flavors[] =
{DataFlavor.imageFlavor};
private BufferedImage image;
public ImageSelection(BufferedImage image) {
this.image = image;
}
// Transferable
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException {
if (flavor.equals(flavors[0]) == false) {
throw new UnsupportedFlavorException(flavor);
}
return image;
}
public DataFlavor[] getTransferDataFlavors() {
return flavors;
}
public boolean isDataFlavorSupported(DataFlavor
flavor) {
return flavor.equals(flavors[0]);
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tinyhorse/export_fig.git
git@gitee.com:tinyhorse/export_fig.git
tinyhorse
export_fig
export_fig
master

搜索帮助