Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » SWT GC from IFigure Graphics?
SWT GC from IFigure Graphics? [message #166604] Wed, 02 February 2005 06:11 Go to next message
Eclipse UserFriend
Originally posted by: jthomas.virtuality.com

I have a Draw2D/GEF application that allows extensibility by permitting
extension writers to write custom objects that do their own painting.
However, my custom objects do not understand Draw2D/GEF and can only write
to an SWT GC. Hence, the 'extension interface' defined by my Draw2D/GEF
application must include a 'paint' method as follows:

interface ICustomExtension
{
void paint(Rectangle rClippedArea, GC gc);
}

I would like the GEF application to call into the paint method for each
ICustomExtension implementation. From what I hear, Draw2D uses SWT behind
the scenes?

So, is it possible to obtain an SWT GC from a Draw2D IFigure Graphics
instance? Is there any online HTML javadoc reference to GEF available
someplace that I could refer to?

Please let me know.

Thank you.

- Jade
Re: SWT GC from IFigure Graphics? [message #166646 is a reply to message #166604] Wed, 02 February 2005 15:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

You could probably get access to the GC. Subclass SWTGraphics and hold onto
the SWT GC which is passed to the constructor. You need to replace the
LightweightSystem's GraphicsSource.


"Jade Thomas" <jthomas@virtuality.com> escreveu na mensagem
news:ctpqut$990$1@www.eclipse.org...
>
> I have a Draw2D/GEF application that allows extensibility by permitting
> extension writers to write custom objects that do their own painting.
> However, my custom objects do not understand Draw2D/GEF and can only write
> to an SWT GC. Hence, the 'extension interface' defined by my Draw2D/GEF
> application must include a 'paint' method as follows:
>
> interface ICustomExtension
> {
> void paint(Rectangle rClippedArea, GC gc);
> }
>
> I would like the GEF application to call into the paint method for each
> ICustomExtension implementation. From what I hear, Draw2D uses SWT behind
> the scenes?
>
> So, is it possible to obtain an SWT GC from a Draw2D IFigure Graphics
> instance? Is there any online HTML javadoc reference to GEF available
> someplace that I could refer to?
>
> Please let me know.
>
> Thank you.
>
> - Jade
>
Re: SWT GC from IFigure Graphics? [message #166722 is a reply to message #166646] Wed, 02 February 2005 22:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jthomas.virtuality.com

If my application is a pure GEF application, how do I obtain a reference
to the LightweightSystem?

Once I get the LightweightSystem instance, I could obtain the
'UpdateManager' instance and update the GraphicsSource to my custom
'subclassed' SWTGraphics that maintains a reference to the underlying GC.

Any suggestions?

- Jade



Randy Hudson wrote:

> You could probably get access to the GC. Subclass SWTGraphics and hold onto
> the SWT GC which is passed to the constructor. You need to replace the
> LightweightSystem's GraphicsSource.


> "Jade Thomas" <jthomas@virtuality.com> escreveu na mensagem
> news:ctpqut$990$1@www.eclipse.org...
>>
>> I have a Draw2D/GEF application that allows extensibility by permitting
>> extension writers to write custom objects that do their own painting.
>> However, my custom objects do not understand Draw2D/GEF and can only write
>> to an SWT GC. Hence, the 'extension interface' defined by my Draw2D/GEF
>> application must include a 'paint' method as follows:
>>
>> interface ICustomExtension
>> {
>> void paint(Rectangle rClippedArea, GC gc);
>> }
>>
>> I would like the GEF application to call into the paint method for each
>> ICustomExtension implementation. From what I hear, Draw2D uses SWT behind
>> the scenes?
>>
>> So, is it possible to obtain an SWT GC from a Draw2D IFigure Graphics
>> instance? Is there any online HTML javadoc reference to GEF available
>> someplace that I could refer to?
>>
>> Please let me know.
>>
>> Thank you.
>>
>> - Jade
>>
Re: SWT GC from IFigure Graphics? [message #166831 is a reply to message #166722] Thu, 03 February 2005 15:39 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

FigureCanvas.getLightweightSystem().getUpdateManager() would work.
DeferredUpdateManager.setGraphicsSource()

"Jade Thomas" <jthomas@virtuality.com> escreveu na mensagem
news:ctrlqn$r33$1@www.eclipse.org...
>
> If my application is a pure GEF application, how do I obtain a reference
> to the LightweightSystem?
>
> Once I get the LightweightSystem instance, I could obtain the
> 'UpdateManager' instance and update the GraphicsSource to my custom
> 'subclassed' SWTGraphics that maintains a reference to the underlying GC.
>
> Any suggestions?
>
> - Jade
>
>
>
> Randy Hudson wrote:
>
>> You could probably get access to the GC. Subclass SWTGraphics and hold
>> onto the SWT GC which is passed to the constructor. You need to replace
>> the LightweightSystem's GraphicsSource.
>
>
>> "Jade Thomas" <jthomas@virtuality.com> escreveu na mensagem
>> news:ctpqut$990$1@www.eclipse.org...
>>>
>>> I have a Draw2D/GEF application that allows extensibility by permitting
>>> extension writers to write custom objects that do their own painting.
>>> However, my custom objects do not understand Draw2D/GEF and can only
>>> write to an SWT GC. Hence, the 'extension interface' defined by my
>>> Draw2D/GEF application must include a 'paint' method as follows:
>>>
>>> interface ICustomExtension
>>> {
>>> void paint(Rectangle rClippedArea, GC gc);
>>> }
>>>
>>> I would like the GEF application to call into the paint method for each
>>> ICustomExtension implementation. From what I hear, Draw2D uses SWT
>>> behind the scenes?
>>>
>>> So, is it possible to obtain an SWT GC from a Draw2D IFigure Graphics
>>> instance? Is there any online HTML javadoc reference to GEF available
>>> someplace that I could refer to?
>>>
>>> Please let me know.
>>>
>>> Thank you.
>>>
>>> - Jade
>>>
>
>
Previous Topic:Figure not displaying in viewer ?
Next Topic:Help Wanted: Investigate new Tree w/Columns SWT support
Goto Forum:
  


Current Time: Sat Apr 27 00:09:41 GMT 2024

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

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

Back to the top