Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Laying out Help
Laying out Help [message #202992] Tue, 15 November 2005 19:55 Go to next message
Eclipse UserFriend
Originally posted by: Lamont_Gilbert.rigidsoftware.com

This is my thrid attempt at describing my problem...

I have a model that appears inside another model. This translates into
an editPart that appears inside another editpart. It can be moved
around inside its parent edit part. Then it can be double clicked and
edited inside a ComponentEditor. When its being edited it gets a
different edit part.

The trick is in laying out the children. When its being edited in the
EditingEditPart it has a freeformLayer as a figure and a FreeFormLayout
manager. When its being displayed in the other editpart it has a basic
Figure with a custom layout manager I created.

I believed I needed this special layout manager since these two figures
are in different environments and need to be displayed in different
ways. But I'd rather have the ComponentEditPart use simple XYLayout
layout manager and the ComponentEditingEditPart use the custom layour
manager to be consistent with the rest of my editparts.

I can't get away from a freeform figure for the editing edit part. but
how can I translate this information so that when i go to the
componentEditpart I dont need to have a special layout manager to layout
the figure.

for instance, my group figure which has children but is not editable
uses an XYLayout manager with a standard Figure. Thats what I want for
my ComponentEditPart.

Possible?
Re: Laying out Help [message #203161 is a reply to message #202992] Fri, 18 November 2005 19:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

What's preventing your ComponentEditPart from using an XYLayout?
CircuitFigure in the logic example does that, if you need a reference.

"CL [dnoyeb] Gilbert" <Lamont_Gilbert@rigidsoftware.com> wrote in message
news:dldeg2$9k5$1@news.eclipse.org...
> This is my thrid attempt at describing my problem...
>
> I have a model that appears inside another model. This translates into
> an editPart that appears inside another editpart. It can be moved
> around inside its parent edit part. Then it can be double clicked and
> edited inside a ComponentEditor. When its being edited it gets a
> different edit part.
>
> The trick is in laying out the children. When its being edited in the
> EditingEditPart it has a freeformLayer as a figure and a FreeFormLayout
> manager. When its being displayed in the other editpart it has a basic
> Figure with a custom layout manager I created.
>
> I believed I needed this special layout manager since these two figures
> are in different environments and need to be displayed in different
> ways. But I'd rather have the ComponentEditPart use simple XYLayout
> layout manager and the ComponentEditingEditPart use the custom layour
> manager to be consistent with the rest of my editparts.
>
> I can't get away from a freeform figure for the editing edit part. but
> how can I translate this information so that when i go to the
> componentEditpart I dont need to have a special layout manager to layout
> the figure.
>
> for instance, my group figure which has children but is not editable
> uses an XYLayout manager with a standard Figure. Thats what I want for
> my ComponentEditPart.
>
> Possible?
Re: Laying out Help [message #203221 is a reply to message #203161] Sun, 20 November 2005 04:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Lamont_Gilbert.rigidsoftware.com

ComponentEditPart does not use XY layout because the positions stored in
all of its children were created in ComponentEditingEditPart which has
the freeform. If I used the same values stored in the model by the
editingEditPart then all the children will be offset. I guess this is
because 0,0 is in a strange place on the freeform figure!? I'm not
entirely sure.

The objective Is to get the ComponentEditPart onto an XY layout and if I
must let the ComponentEditingEditPart have the custom layout.

Imagine if I could double click on the CircuitEditPart and open it in an
editor and edit its insides. That is what I am after. Its the same
model, but presented in different ways depending on if you are editing
it, or displaying a copy of it inside a different parent.


CL


Pratik Shah wrote:
> What's preventing your ComponentEditPart from using an XYLayout?
> CircuitFigure in the logic example does that, if you need a reference.
>
> "CL [dnoyeb] Gilbert" <Lamont_Gilbert@rigidsoftware.com> wrote in message
> news:dldeg2$9k5$1@news.eclipse.org...
>
>>This is my thrid attempt at describing my problem...
>>
>>I have a model that appears inside another model. This translates into
>>an editPart that appears inside another editpart. It can be moved
>>around inside its parent edit part. Then it can be double clicked and
>>edited inside a ComponentEditor. When its being edited it gets a
>>different edit part.
>>
>>The trick is in laying out the children. When its being edited in the
>>EditingEditPart it has a freeformLayer as a figure and a FreeFormLayout
>>manager. When its being displayed in the other editpart it has a basic
>>Figure with a custom layout manager I created.
>>
>>I believed I needed this special layout manager since these two figures
>>are in different environments and need to be displayed in different
>>ways. But I'd rather have the ComponentEditPart use simple XYLayout
>>layout manager and the ComponentEditingEditPart use the custom layour
>>manager to be consistent with the rest of my editparts.
>>
>>I can't get away from a freeform figure for the editing edit part. but
>>how can I translate this information so that when i go to the
>>componentEditpart I dont need to have a special layout manager to layout
>>the figure.
>>
>>for instance, my group figure which has children but is not editable
>>uses an XYLayout manager with a standard Figure. Thats what I want for
>>my ComponentEditPart.
>>
>>Possible?
>
>
>
Re: Laying out Help [message #203361 is a reply to message #203221] Mon, 21 November 2005 19:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

What is this custom layout that you keep mentioning? Do you realize that
FreeformLayout and XYLayout are essentially the same? I'm not sure why
you'd need two different layouts for editing and rendering.

If I understand your problem correctly, what you need to do is save the
child coordinates relative to the parent's. That's what the CircuitEditPart
does. Then, whatever coordinates were used while in the editing mode would
still apply when not editing.

"CL [dnoyeb] Gilbert" <Lamont_Gilbert@rigidsoftware.com> wrote in message
news:dlotan$900$1@news.eclipse.org...
> ComponentEditPart does not use XY layout because the positions stored in
> all of its children were created in ComponentEditingEditPart which has
> the freeform. If I used the same values stored in the model by the
> editingEditPart then all the children will be offset. I guess this is
> because 0,0 is in a strange place on the freeform figure!? I'm not
> entirely sure.
>
> The objective Is to get the ComponentEditPart onto an XY layout and if I
> must let the ComponentEditingEditPart have the custom layout.
>
> Imagine if I could double click on the CircuitEditPart and open it in an
> editor and edit its insides. That is what I am after. Its the same
> model, but presented in different ways depending on if you are editing
> it, or displaying a copy of it inside a different parent.
>
>
> CL
>
>
> Pratik Shah wrote:
> > What's preventing your ComponentEditPart from using an XYLayout?
> > CircuitFigure in the logic example does that, if you need a reference.
> >
> > "CL [dnoyeb] Gilbert" <Lamont_Gilbert@rigidsoftware.com> wrote in
message
> > news:dldeg2$9k5$1@news.eclipse.org...
> >
> >>This is my thrid attempt at describing my problem...
> >>
> >>I have a model that appears inside another model. This translates into
> >>an editPart that appears inside another editpart. It can be moved
> >>around inside its parent edit part. Then it can be double clicked and
> >>edited inside a ComponentEditor. When its being edited it gets a
> >>different edit part.
> >>
> >>The trick is in laying out the children. When its being edited in the
> >>EditingEditPart it has a freeformLayer as a figure and a FreeFormLayout
> >>manager. When its being displayed in the other editpart it has a basic
> >>Figure with a custom layout manager I created.
> >>
> >>I believed I needed this special layout manager since these two figures
> >>are in different environments and need to be displayed in different
> >>ways. But I'd rather have the ComponentEditPart use simple XYLayout
> >>layout manager and the ComponentEditingEditPart use the custom layour
> >>manager to be consistent with the rest of my editparts.
> >>
> >>I can't get away from a freeform figure for the editing edit part. but
> >>how can I translate this information so that when i go to the
> >>componentEditpart I dont need to have a special layout manager to layout
> >>the figure.
> >>
> >>for instance, my group figure which has children but is not editable
> >>uses an XYLayout manager with a standard Figure. Thats what I want for
> >>my ComponentEditPart.
> >>
> >>Possible?
> >
> >
> >
Re: Laying out Help [message #203474 is a reply to message #203361] Tue, 22 November 2005 14:21 Go to previous message
Eclipse UserFriend
Originally posted by: Lamont_Gilbert.rigidsoftware.com

freeform layout has no size.


The group edit part is easy. You take several parts, remove from
current container, add to group container then drop group in the same
place. Their xy values do not change. When you drag the group around
you are actually draging all the parts around with just 1 selection. I
guess I could change this so grouped parts xy is relative to their
parent, then they wouldnt change x,y when the group was dragged.

But try this with component edit part. It works at first. But when you
open it in the editor, how do you place the components? the parent
figure has now changed to one that has no size or position for that
matter. So your current x,y values mean nothing.

I was just hoping there was a simple way, but I may need to do an
overhall from the bottom up. Making all children positions relative to
their parents if I can. Since I have db program and don't want to write
to db so often, this can work better.

Thanks,


CL


Pratik Shah wrote:
> What is this custom layout that you keep mentioning? Do you realize that
> FreeformLayout and XYLayout are essentially the same? I'm not sure why
> you'd need two different layouts for editing and rendering.
>
> If I understand your problem correctly, what you need to do is save the
> child coordinates relative to the parent's. That's what the CircuitEditPart
> does. Then, whatever coordinates were used while in the editing mode would
> still apply when not editing.
>
> "CL [dnoyeb] Gilbert" <Lamont_Gilbert@rigidsoftware.com> wrote in message
> news:dlotan$900$1@news.eclipse.org...
>
>>ComponentEditPart does not use XY layout because the positions stored in
>>all of its children were created in ComponentEditingEditPart which has
>>the freeform. If I used the same values stored in the model by the
>>editingEditPart then all the children will be offset. I guess this is
>>because 0,0 is in a strange place on the freeform figure!? I'm not
>>entirely sure.
>>
>>The objective Is to get the ComponentEditPart onto an XY layout and if I
>>must let the ComponentEditingEditPart have the custom layout.
>>
>>Imagine if I could double click on the CircuitEditPart and open it in an
>>editor and edit its insides. That is what I am after. Its the same
>>model, but presented in different ways depending on if you are editing
>>it, or displaying a copy of it inside a different parent.
>>
>>
>>CL
>>
>>
>>Pratik Shah wrote:
>>
>>>What's preventing your ComponentEditPart from using an XYLayout?
>>>CircuitFigure in the logic example does that, if you need a reference.
>>>
>>>"CL [dnoyeb] Gilbert" <Lamont_Gilbert@rigidsoftware.com> wrote in
>
> message
>
>>>news:dldeg2$9k5$1@news.eclipse.org...
>>>
>>>
>>>>This is my thrid attempt at describing my problem...
>>>>
>>>>I have a model that appears inside another model. This translates into
>>>>an editPart that appears inside another editpart. It can be moved
>>>>around inside its parent edit part. Then it can be double clicked and
>>>>edited inside a ComponentEditor. When its being edited it gets a
>>>>different edit part.
>>>>
>>>>The trick is in laying out the children. When its being edited in the
>>>>EditingEditPart it has a freeformLayer as a figure and a FreeFormLayout
>>>>manager. When its being displayed in the other editpart it has a basic
>>>>Figure with a custom layout manager I created.
>>>>
>>>>I believed I needed this special layout manager since these two figures
>>>>are in different environments and need to be displayed in different
>>>>ways. But I'd rather have the ComponentEditPart use simple XYLayout
>>>>layout manager and the ComponentEditingEditPart use the custom layour
>>>>manager to be consistent with the rest of my editparts.
>>>>
>>>>I can't get away from a freeform figure for the editing edit part. but
>>>>how can I translate this information so that when i go to the
>>>>componentEditpart I dont need to have a special layout manager to layout
>>>>the figure.
>>>>
>>>>for instance, my group figure which has children but is not editable
>>>>uses an XYLayout manager with a standard Figure. Thats what I want for
>>>>my ComponentEditPart.
>>>>
>>>>Possible?
>>>
>>>
>>>
>
>
Previous Topic:selection of multiple nodes
Next Topic:method findFigureAt returns null
Goto Forum:
  


Current Time: Fri Apr 26 10:09:07 GMT 2024

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

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

Back to the top