Correctly check images against their dimensions for image polling

MYC-Refactor
Hammy 3 years ago
parent ed97a46735
commit 8b467ab3d9

@ -27,7 +27,10 @@ class ClipboardUtils {
myClipboardContent.setOldContent(contents.getTransferData(TEXT.getDataFlavor()));
} else if (IMAGE.isAvailable(clipboard)) {
BufferedImage bufferedImage = convertToBufferedImage((Image) contents.getTransferData(IMAGE.getDataFlavor()));
myClipboardContent.setOldContent(new Dimension(bufferedImage.getWidth(), bufferedImage.getHeight()));
myClipboardContent.setOldContent(bufferedImage);
myClipboardContent.setOldDimensionContent(new Dimension(bufferedImage.getWidth(), bufferedImage.getHeight()));
} else if (FILELIST.isAvailable(clipboard)) {
myClipboardContent.setOldContent(contents.getTransferData(FILELIST.getDataFlavor()));
}
} catch (UnsupportedFlavorException | IOException exp) {
exp.printStackTrace();

@ -1,7 +1,10 @@
package me.goudham.domain;
import java.awt.Dimension;
public class MyClipboardContent<T> {
private T oldContent;
private Dimension oldDimensionContent;
public MyClipboardContent() {
}
@ -13,4 +16,12 @@ public class MyClipboardContent<T> {
public T getOldContent() {
return oldContent;
}
public void setOldDimensionContent(Dimension oldDimensionContent) {
this.oldDimensionContent = oldDimensionContent;
}
public Dimension getOldDimensionContent() {
return oldDimensionContent;
}
}

Loading…
Cancel
Save