Home » Eclipse Projects » Standard Widget Toolkit (SWT) » lightweight Composite?
lightweight Composite? [message #459698] |
Sun, 14 August 2005 12:38 |
Paul Singleton Messages: 37 Registered: July 2009 |
Member |
|
|
I want to represent some structured data with a
hierarchy of Composites, using different colours,
border, fonts etc. to represent different types
of node.
I have this working in another system (SWI-Prolog's
XPCE) and want to port it to SWT, using SWT facilities
for layouts, DnD, selection, context menus etc.
But I'm worried about the feasibility of having
perhaps many thousands of Composites - will users
run out of graphics handles or whatever?
Would it be arduous to emulate a Composite with a Draw2D
Figure? Ideally I'd like to be able to embed real SWT
controls, but if not, it would still be useful...
Paul Singleton
|
|
|
Re: lightweight Composite? [message #459699 is a reply to message #459698] |
Sun, 14 August 2005 13:19 |
Eclipse User |
|
|
|
Originally posted by: sunil_kamath.nohotspammail.com
"Paul Singleton" <paul@jbgb.com> wrote in message
news:ddndvk$7is$1@news.eclipse.org...
>I want to represent some structured data with a
> hierarchy of Composites, using different colours,
> border, fonts etc. to represent different types
> of node.
>
> I have this working in another system (SWI-Prolog's
> XPCE) and want to port it to SWT, using SWT facilities
> for layouts, DnD, selection, context menus etc.
>
> But I'm worried about the feasibility of having
> perhaps many thousands of Composites - will users
> run out of graphics handles or whatever?
>
> Would it be arduous to emulate a Composite with a Draw2D
> Figure? Ideally I'd like to be able to embed real SWT
> controls, but if not, it would still be useful...
>
Check out the VE framework for drawing SWT widgets using GEF.
---
Sunil
|
|
|
Re: lightweight Composite? [message #460176 is a reply to message #459699] |
Mon, 22 August 2005 15:02 |
Paul Singleton Messages: 37 Registered: July 2009 |
Member |
|
|
Sunil Kamath wrote:
> "Paul Singleton" <paul@jbgb.com> wrote in message
> news:ddndvk$7is$1@news.eclipse.org...
>
>>I want to represent some structured data with a
>>hierarchy of Composites, using different colours,
>>border, fonts etc. to represent different types
>>of node.
>>
>>I have this working in another system (SWI-Prolog's
>>XPCE) and want to port it to SWT, using SWT facilities
>>for layouts, DnD, selection, context menus etc.
>>
>>But I'm worried about the feasibility of having
>>perhaps many thousands of Composites - will users
>>run out of graphics handles or whatever?
>>
>>Would it be arduous to emulate a Composite with a Draw2D
>>Figure? Ideally I'd like to be able to embed real SWT
>>controls, but if not, it would still be useful...
> Check out the VE framework for drawing SWT widgets using GEF.
OK I've checked it out: VE apparently creates the entire
widget hierarchy offscreen, screengrabs and copies
their pixels onto its own canvas and then implements
its own editing operations.
But I'm not sure how this helps me implement lightweight
controls with SWT event handling...
Paul Singleton
|
|
|
Re: lightweight Composite? [message #460182 is a reply to message #460176] |
Mon, 22 August 2005 15:38 |
Eclipse User |
|
|
|
Originally posted by: sunil_kamath.nohotspammail.com
"Paul Singleton" <paul@jbgb.com> wrote in message
news:4309E911.6080309@jbgb.com...
> Sunil Kamath wrote:
>
>> Check out the VE framework for drawing SWT widgets using GEF.
>
> OK I've checked it out: VE apparently creates the entire
> widget hierarchy offscreen, screengrabs and copies
> their pixels onto its own canvas and then implements
> its own editing operations.
>
> But I'm not sure how this helps me implement lightweight
> controls with SWT event handling...
>
Either you can have lightweight controls or you can have SWT event handling.
I don't think you can have both.
Is there a particular reason why you need SWT events?
Is this not something you can implement using GEF? GEF also offers events on
the lightweight objects it creates.
---
Sunil
|
|
|
Re: lightweight Composite? [message #460246 is a reply to message #460182] |
Tue, 23 August 2005 10:31 |
Paul Singleton Messages: 37 Registered: July 2009 |
Member |
|
|
Sunil Kamath wrote:
> "Paul Singleton" <paul@jbgb.com> wrote in message
> news:4309E911.6080309@jbgb.com...
>>Sunil Kamath wrote:
>>>Check out the VE framework for drawing SWT widgets using GEF.
>>OK I've checked it out: VE apparently creates the entire
>>widget hierarchy offscreen, screengrabs and copies
>>their pixels onto its own canvas and then implements
>>its own editing operations.
>>
>>But I'm not sure how this helps me implement lightweight
>>controls with SWT event handling...
> Either you can have lightweight controls or you can have SWT event handling.
> I don't think you can have both.
Hmm, in which case I really need to rethink :-/
> Is there a particular reason why you need SWT events?
I want selection, context menus, drag'n'drop etc. to use
platform conventions and interoperate with SWT widgets;
e.g. so a dnd from one of my lightweight canvases or
composites onto, say, a TreeItem is handled using SWT
mechanisms.
> Is this not something you can implement using GEF? GEF also offers events on
> the lightweight objects it creates.
Well I've got a simple Draw2D demo going, but its mouse
(etc.) event scheme seems to be independent of SWT events.
Presumably I could emulate Windows context menu conventions,
drag'n'drop etc. but on other platforms (which I don't have
access to) it would behave like Windows, not natively.
I'm reluctant to give up on this: are you *sure* it's
hopeless? :-)
cheers
Paul Singleton
|
|
|
Re: lightweight Composite? [message #460254 is a reply to message #459698] |
Tue, 23 August 2005 13:49 |
ted stockwell Messages: 123 Registered: July 2009 |
Senior Member |
|
|
Paul Singleton wrote:
> I want to represent some structured data with a
> hierarchy of Composites, using different colours,
> border, fonts etc. to represent different types
> of node.
>
> I have this working in another system (SWI-Prolog's
> XPCE) and want to port it to SWT, using SWT facilities
> for layouts, DnD, selection, context menus etc.
>
> But I'm worried about the feasibility of having
> perhaps many thousands of Composites - will users
> run out of graphics handles or whatever?
>
> Would it be arduous to emulate a Composite with a Draw2D
> Figure? Ideally I'd like to be able to embed real SWT
> controls, but if not, it would still be useful...
>
> Paul Singleton
SWT now has support for Swing components.
Although I have never used a Swing component in SWT if I were faced with this task the first thing I would do would be create a
Swing prototype and thus judge how well a Swing solution might work.
I have never created an SWT application with many controls in it.
However I have written native Win32 C++, Visual Basic, and Java AWT applications that have at times used many controls in a
single scrollable window and the result is not pleasing. A scrollable window with many heavyweight control is slow to scroll
and repaint, lots of flicker, etc (I only have experience on Windows, can't speak for Linux or Mac windowing systems).
That's one thing I like about Swing - lightweight components. With Swing you can pretty much get away with building big
components out of many (like hundreds or thousands) little components with little performance impact.
ted stockwell
|
|
|
Re: lightweight Composite? [message #460282 is a reply to message #460246] |
Tue, 23 August 2005 16:35 |
Eclipse User |
|
|
|
Originally posted by: sunil_kamath.nohotspammail.com
"Paul Singleton" <paul@jbgb.com> wrote in message
news:430AFAEC.1040508@jbgb.com...
> Sunil Kamath wrote:
>
>> "Paul Singleton" <paul@jbgb.com> wrote in message
>> news:4309E911.6080309@jbgb.com...
>
>>>Sunil Kamath wrote:
>
>>>>Check out the VE framework for drawing SWT widgets using GEF.
>
>>>OK I've checked it out: VE apparently creates the entire
>>>widget hierarchy offscreen, screengrabs and copies
>>>their pixels onto its own canvas and then implements
>>>its own editing operations.
>>>
>>>But I'm not sure how this helps me implement lightweight
>>>controls with SWT event handling...
>
>> Either you can have lightweight controls or you can have SWT event
>> handling.
>> I don't think you can have both.
>
> Hmm, in which case I really need to rethink :-/
>
You could try Swing.
It is lightweight, but you won't get that native l&f.
Maybe look at SwingWT? http://swingwt.sourceforge.net/
>> Is there a particular reason why you need SWT events?
>
> I want selection, context menus, drag'n'drop etc. to use
> platform conventions and interoperate with SWT widgets;
> e.g. so a dnd from one of my lightweight canvases or
> composites onto, say, a TreeItem is handled using SWT
> mechanisms.
>
GEF supports selection, context menus and drag'n'drop with one caveat:
You cannot convert a GEF drag'n'drop to a native drag'n'drop and vice-versa.
e.g., You can drag'n'drop between lightweight components on your GEF canvas.
Or you can drag'n'drop from your GEF canvas to another SWT control.
In each case you need to ensure that the appropriate drag operation is
kicked off.
You cannot change your mind mid-stream and switch the type of drag
operation.
>> Is this not something you can implement using GEF? GEF also offers events
>> on the lightweight objects it creates.
>
> Well I've got a simple Draw2D demo going, but its mouse
> (etc.) event scheme seems to be independent of SWT events.
> Presumably I could emulate Windows context menu conventions,
> drag'n'drop etc. but on other platforms (which I don't have
> access to) it would behave like Windows, not natively.
>
GEF is platform independent so it should behave appropriately on different
platforms.
I would suggest installing VMWare to emulate other platforms (that's what I
have done).
> I'm reluctant to give up on this: are you *sure* it's
> hopeless? :-)
>
Nothing is hopeless.
However sometimes you are hanging on to that hope by a thread :-)
---
Sunil
|
|
|
Goto Forum:
Current Time: Tue Apr 23 07:34:00 GMT 2024
Powered by FUDForum. Page generated in 0.03155 seconds
|