Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Copying GEF Diagram to Windows Applications
Copying GEF Diagram to Windows Applications [message #244926] Wed, 13 August 2008 10:08
Eclipse UserFriend
Originally posted by: sumit.mathur.amdocs.com

Hi,

I am working on a graphical editor using GEF and I want to provide the
support of copying my GEF diagram to the windows applications. By reading
to the existing posts on this newsgroup I came to know that I need to use
ImageTransfer.java and clipboard. I have implemented it in my code and I
am able to copy/paste my GEF image between eclipse applications, however,
in windows applications paste button does not get enabled.

I am using the ImageTransfer.java available at

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.exa mples/src/org/eclipse/swt/examples/dnd/ImageTransfer.java

My Code looks as follows

IFigure figure = getMyFigure();
int w = figure.getSize().width;
int h = figure.getSize().height;
Image image = new Image(Display.getDefault(), w, h);
GC gc = new GC(image);
SWTGraphics graphics = new SWTGraphics(gc);
figure.paint(graphics);
graphics.dispose();
gc.dispose();
ImageData data = image.getImageData();
Clipboard clipboard = new Clipboard(Display.getDefault());
try {
clipboard.setContents(new ImageData[] { data }, new Transfer[] {
ImageTransfer.getInstance() });
} finally {
clipboard.dispose();
}

Any help is greatly appreciated.


Regards,
Sumit.
Previous Topic:ZoomManager Looses Center
Next Topic:[Announce] GEF 3.5.0M1 is available
Goto Forum:
  


Current Time: Tue Mar 19 07:58:41 GMT 2024

Powered by FUDForum. Page generated in 0.02010 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top