Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to get Graphics object in Draw2d?
How to get Graphics object in Draw2d? [message #238399] Mon, 10 September 2007 02:26 Go to next message
Hoping White is currently offline Hoping White
Messages: 71
Registered: July 2009
Member
Hello everyone,
How can I get a Graphics object in Draw2d System? Like SWT, I can get a
GC object by new GC(Drawable),but how in Draw2d?
I want to get this, becase I want to draw a rectangle centered by mouse
position, and when the mouse moves, the rectangle either. According to my
experince in SWT, draw the rectangle in MouseMotionListener is better, but
this requires GC object, so I want to get Graphics in Draw2d. Or is there
another way to do this in Draw2d?
Thanks very much!
Re: How to get Graphics object in Draw2d? [message #238420 is a reply to message #238399] Mon, 10 September 2007 05:47 Go to previous messageGo to next message
Eclipse User
Originally posted by: puneet82sri.sify.com

Can u detail why do u want a rectangle around your mouse pointer.

Hope this helps.
1. You can make use of set cursor on base figure.
2. Gets graphics object
Image img1 = new Image(null, new org.eclipse.swt.graphics.Rectangle(10, 102, 600, 600));
GC gc1 = new GC(img1);
Graphics grap1 = new SWTGraphics(gc1);
contents.paint(grap1);
Re: How to get Graphics object in Draw2d? [message #238430 is a reply to message #238420] Mon, 10 September 2007 06:13 Go to previous message
Hoping White is currently offline Hoping White
Messages: 71
Registered: July 2009
Member
well, I want to implement some effect like drag.
"Puneet Srivastava" <puneet82sri@sify.com>
??????:1236383734.6081189403298909.JavaMail.root@cp9.dzone.com...
> Can u detail why do u want a rectangle around your mouse pointer.
>
> Hope this helps.
> 1. You can make use of set cursor on base figure.
> 2. Gets graphics object
> Image img1 = new Image(null, new org.eclipse.swt.graphics.Rectangle(10,
> 102, 600, 600));
> GC gc1 = new GC(img1);
> Graphics grap1 = new SWTGraphics(gc1);
> contents.paint(grap1);
Previous Topic:Problems with scrolling
Next Topic:Error in Clipboard.getContents() method
Goto Forum:
  


Current Time: Tue Oct 21 10:29:23 GMT 2014

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

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