diff --git a/src/main/java/me/goudham/ClipboardUtils.java b/src/main/java/me/goudham/ClipboardUtils.java index a8cb206..3da9cc1 100644 --- a/src/main/java/me/goudham/ClipboardUtils.java +++ b/src/main/java/me/goudham/ClipboardUtils.java @@ -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(); diff --git a/src/main/java/me/goudham/domain/MyClipboardContent.java b/src/main/java/me/goudham/domain/MyClipboardContent.java index 032a9ad..2922bde 100644 --- a/src/main/java/me/goudham/domain/MyClipboardContent.java +++ b/src/main/java/me/goudham/domain/MyClipboardContent.java @@ -1,7 +1,10 @@ package me.goudham.domain; +import java.awt.Dimension; + public class MyClipboardContent { private T oldContent; + private Dimension oldDimensionContent; public MyClipboardContent() { } @@ -13,4 +16,12 @@ public class MyClipboardContent { public T getOldContent() { return oldContent; } + + public void setOldDimensionContent(Dimension oldDimensionContent) { + this.oldDimensionContent = oldDimensionContent; + } + + public Dimension getOldDimensionContent() { + return oldDimensionContent; + } }