Group or dock Figure/Editparts [message #159665] |
Tue, 30 November 2004 03:46  |
Eclipse User |
|
|
|
Originally posted by: carroe.gmx.net
Hi,
i want to dock (group) two Figures/Editparts, so that:
* their models get connected somehow
* their contraints (size/position) are changend synchronous
(proportional/by difference)
There is no such parent<>child relationship between the model elements
as with 'AbstractEditPart.getModelChildren()'. They are more or less
considered to be on a equal level, so it would be more like
<EditPart>.getDockedElements().
Where would be the best starting point for the dockable/docking part?
Specialize AbstractGraphicalEditPart? Or even deeper?
Any suggestions?
Tnx.
Carsten
|
|
|
|
Re: Group or dock Figure/Editparts [message #159800 is a reply to message #159683] |
Tue, 30 November 2004 11:36  |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
> The rule of thumb is to think from the model point of view, not from the
> editor UI POV.
Definitely the docked state has to be persisted, so that's the starting
point.
> I.e. in case you have docking you should reflect this in your model (i.e.
> when one model position changes, change the position of the second model)
> and then propagate it to the editor.
>
> From the GEF point of view, if you want to implement docking it seems like
> you can toggle dock state in response to Add/Orphan requests (i.e. when
you
> drag objectA on top of objectB, objetB editpart will receive the add
request
> so you can change the feedback painting and update the docked state of the
> model)
Are you talking about toggling dock, or respecting it? To drag 2 items as
if they were docked, you might want to:
1) Link selection, such that if one item is selected all docked items are
too
2) Link the model. Reparent the children into a new composite object, which
has just one selectable editpart (although you can still use children to
build the figures)
3) Forward requests. If an object is being dragged, forward requests to
other editparts which are linked but not selected.
2 is probably what I would expect as a user.
>
> Eugene
>
> "Carsten" <carroe@gmx.net> wrote in message
> news:cohc0g$6b1$1@www.eclipse.org...
> > Hi,
> >
> > i want to dock (group) two Figures/Editparts, so that:
> > * their models get connected somehow
> > * their contraints (size/position) are changend synchronous
> > (proportional/by difference)
> >
> > There is no such parent<>child relationship between the model elements
> > as with 'AbstractEditPart.getModelChildren()'. They are more or less
> > considered to be on a equal level, so it would be more like
> > <EditPart>.getDockedElements().
> >
> > Where would be the best starting point for the dockable/docking part?
> > Specialize AbstractGraphicalEditPart? Or even deeper?
> >
> > Any suggestions?
> >
> > Tnx.
> > Carsten
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04130 seconds