Home » Eclipse Projects » GEF » GEF, draw2d, and SWT widgets
GEF, draw2d, and SWT widgets [message #86457] |
Thu, 03 July 2003 17:31  |
Eclipse User |
|
|
|
Hi!
I have been writing a Form Painting application for a workflow engine using
GEF, draw2d, and SWT. I am trying to do the following:
1. The editor (subclasses from GraphicalEditor) has a FigureCanvas.
2. The Pallette allows a user to drag and drop "workflow controls" into this
canvas and set properties.
The problem I am facing is in the basic setup of the controls. I was
planning to create each control as a Figure that had one or more SWT widgets
or Figures in it. The widgets are children of the parent figure. The parent
figure handles enabling sizing handles, location parameters etc. The parent
figure is controlled by a corresponding EditPart (a subclass of
AbstractGraphicalEditPart). The children have their own edit parts - widgets
(subclasses of AbstractEditPart) and figures (subclasses of
AbstractGraphicalEditPart).
The issue I face is that I dont seem to be able to add a widget editpart as
a child to the figure editpart, since
AbstractGraphicalEditPart#addChildVisual assumes that the child is a figure,
which it is not. This has got me thinking...
Should I even bother using Figures as building blocks and stick to SWT's
Composite instead. This would mean I go away from using
AbstarctGraphicalEditPart and ScrollingGraphicalViewer as a base for the
editor. Are there any pitfalls in terms of ability to uses aggregate of
controls - an example would be a workflow widget that has a label, textbox,
and a button. All 3 of them will move together and handled as a unit. I
suppose this is the use of a composite, but I am newbie and would like
someone to tell me I am on the right track.
Shankar
|
|
|
Re: GEF, draw2d, and SWT widgets [message #86520 is a reply to message #86457] |
Fri, 04 July 2003 12:33   |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
The GEF team is now working on a new example called
org.eclipse.gef.examples.flow. It will be an activity diagram/flow.
Could you post a picture of what you imagine your editor might look like?
There are several alternative, in order of least amount of work first:
1) Use just figures, and when the user needs to edit a value, use in-place
cell editors, combined with popup dialogs and the propertysheet.
2) Use a figure which is a proxy to a Composite. When the figure is
resized, the control's bounds are set to match the figure's. There would be
lots of issues with when selection of the editpart occurs. Where do mouse
events go. How do you drag the composite, etc.
3) Write your own EditPartViewer where composites are the build-blocks
instead of figures. This would be uncharted territory.
"Shankar Venkataraman" <shankar.venkataraman@epiphany.com> wrote in message
news:be27bc$if1$1@rogue.oti.com...
> Hi!
>
> I have been writing a Form Painting application for a workflow engine
using
> GEF, draw2d, and SWT. I am trying to do the following:
>
> 1. The editor (subclasses from GraphicalEditor) has a FigureCanvas.
> 2. The Pallette allows a user to drag and drop "workflow controls" into
this
> canvas and set properties.
>
> The problem I am facing is in the basic setup of the controls. I was
> planning to create each control as a Figure that had one or more SWT
widgets
> or Figures in it. The widgets are children of the parent figure. The
parent
> figure handles enabling sizing handles, location parameters etc. The
parent
> figure is controlled by a corresponding EditPart (a subclass of
> AbstractGraphicalEditPart). The children have their own edit parts -
widgets
> (subclasses of AbstractEditPart) and figures (subclasses of
> AbstractGraphicalEditPart).
>
> The issue I face is that I dont seem to be able to add a widget editpart
as
> a child to the figure editpart, since
> AbstractGraphicalEditPart#addChildVisual assumes that the child is a
figure,
> which it is not. This has got me thinking...
>
> Should I even bother using Figures as building blocks and stick to SWT's
> Composite instead. This would mean I go away from using
> AbstarctGraphicalEditPart and ScrollingGraphicalViewer as a base for the
> editor. Are there any pitfalls in terms of ability to uses aggregate of
> controls - an example would be a workflow widget that has a label,
textbox,
> and a button. All 3 of them will move together and handled as a unit. I
> suppose this is the use of a composite, but I am newbie and would like
> someone to tell me I am on the right track.
>
> Shankar
>
>
>
>
>
>
|
|
|
Re: GEF, draw2d, and SWT widgets [message #86646 is a reply to message #86520] |
Mon, 07 July 2003 12:56  |
Eclipse User |
|
|
|
Thanks for the clarifications. I will post a diagram later tonite. I have
switched my design over the weekend, to work on the third option that you
have stated, and so far it has been going well. I am using the
GraphicalEditPart pieces as a guide as I try figuring out the same with
Composites.
Option 2 that you have suggested below is what I tried first, but did not
get to the point of using a Figure as a proxy to a composite. Was planning
to use the Figure as the selection handler, as a result of which it will be
impossible to select the composite without selecting its parent Figure. All
mouse clicks and dnd will be handled by the parent Figure - the child passes
it back to the parent. This strategy, however, requires that every widget
actually has an enclosing Figure, which may be an overkill in some cases.
Need to think through a bit more..
Shankar
"Randy Hudson" <none@us.ibm.com> wrote in message
news:be4a8o$10f$1@rogue.oti.com...
> The GEF team is now working on a new example called
> org.eclipse.gef.examples.flow. It will be an activity diagram/flow.
>
> Could you post a picture of what you imagine your editor might look like?
> There are several alternative, in order of least amount of work first:
>
> 1) Use just figures, and when the user needs to edit a value, use in-place
> cell editors, combined with popup dialogs and the propertysheet.
> 2) Use a figure which is a proxy to a Composite. When the figure is
> resized, the control's bounds are set to match the figure's. There would
be
> lots of issues with when selection of the editpart occurs. Where do mouse
> events go. How do you drag the composite, etc.
> 3) Write your own EditPartViewer where composites are the build-blocks
> instead of figures. This would be uncharted territory.
>
> "Shankar Venkataraman" <shankar.venkataraman@epiphany.com> wrote in
message
> news:be27bc$if1$1@rogue.oti.com...
> > Hi!
> >
> > I have been writing a Form Painting application for a workflow engine
> using
> > GEF, draw2d, and SWT. I am trying to do the following:
> >
> > 1. The editor (subclasses from GraphicalEditor) has a FigureCanvas.
> > 2. The Pallette allows a user to drag and drop "workflow controls" into
> this
> > canvas and set properties.
> >
> > The problem I am facing is in the basic setup of the controls. I was
> > planning to create each control as a Figure that had one or more SWT
> widgets
> > or Figures in it. The widgets are children of the parent figure. The
> parent
> > figure handles enabling sizing handles, location parameters etc. The
> parent
> > figure is controlled by a corresponding EditPart (a subclass of
> > AbstractGraphicalEditPart). The children have their own edit parts -
> widgets
> > (subclasses of AbstractEditPart) and figures (subclasses of
> > AbstractGraphicalEditPart).
> >
> > The issue I face is that I dont seem to be able to add a widget editpart
> as
> > a child to the figure editpart, since
> > AbstractGraphicalEditPart#addChildVisual assumes that the child is a
> figure,
> > which it is not. This has got me thinking...
> >
> > Should I even bother using Figures as building blocks and stick to SWT's
> > Composite instead. This would mean I go away from using
> > AbstarctGraphicalEditPart and ScrollingGraphicalViewer as a base for the
> > editor. Are there any pitfalls in terms of ability to uses aggregate of
> > controls - an example would be a workflow widget that has a label,
> textbox,
> > and a button. All 3 of them will move together and handled as a unit. I
> > suppose this is the use of a composite, but I am newbie and would like
> > someone to tell me I am on the right track.
> >
> > Shankar
> >
> >
> >
> >
> >
> >
>
>
|
|
|
Goto Forum:
Current Time: Wed Jul 16 12:39:31 EDT 2025
Powered by FUDForum. Page generated in 0.33013 seconds
|