Drawning Figures in 2 places [message #214581] |
Tue, 18 April 2006 19:36  |
Eclipse User |
|
|
|
Originally posted by: vinicius.ferraz.gmail.com
Hi, I'm a new GEF user and have 1 doubt. I'm trying to put some elements
inside others, like an AND door in a circuit. However i don't know how
(and where) i can remove the children´s reference inside the parent.
The Problem In other words: when I put the element inside the other. The
elements is drawing in 2 places.
Where do i remove the reference? in a command? how can i do that?
|
|
|
|
|
|
Re: Drawning Figures in 2 places [message #214834 is a reply to message #214758] |
Mon, 24 April 2006 10:19  |
Eclipse User |
|
|
|
Originally posted by: vinicius.ferraz.gmail.com
Steven Shaw wrote:
> 1.) I just captured the essence of the model operation. Yes, some other
> commands are chained to those for managing grid operations.
>
> 2.) No you shouldn't need to override refreshChildren, only
> getModelChildren. You can optionally call refreshChildren to synchronize
> the EditParts with the model, but it can be expensive as opposed to adding,
> removing the children explicitly as the logic example demonstrates.
>
> -Steve
>
> "Vinicius Ferraz Campos" <vinicius.ferraz@gmail.com> wrote in message
> news:e2aich$qb0$1@utils.eclipse.org...
>> Steven Shaw wrote:
>>> If you're moving an element from one container into another first you
> need
>>> to consider the model changes that persist the container changes.
>>>
>>> If we consider moving a LED from the diagram to a Circuit:
>>> First to remove it from the owned container using the OrphanChildCommand
> in
>>> Logic designer which will remove it from the first container.
>>> @see LogicContainerEditPolicy#getOrphanChildrenCommand
>>>
>>> Then it is added to the target container using an AddCommand
>>> @see LogicXYLayoutEditPolicy#getAddCommand
>>>
>>> These instrument the model changes. Then the EditParts will listen to
> the
>>> model changes accordingly. Both the DiagramEditPart and CircuitEditPart
> are
>>> LogicContainerEditPart which override the method getModelChildren.
>>> Subsequent calls to refreshChildren will synchronize the EditPart
> children
>>> with the model children. Alternatively, for performance they can listen
> to
>>> the model changes specifically which will invoke addChild or removeChild
>>> based on the corresponding event.
>>> @see LogicEditPart@propertyChange
>>>
>>> Regards,
>>>
>>> Steve.
>>>
>>> "Vinicius Ferraz Campos" <vinicius.ferraz@gmail.com> wrote in message
>>> news:e23t6d$bi0$1@utils.eclipse.org...
>>>> Hi, I'm a new GEF user and have 1 doubt. I'm trying to put some
> elements
>>>> inside others, like an AND door in a circuit. However i don't know how
>>>> (and where) i can remove the children´s reference inside the parent.
>>>>
>>>> The Problem In other words: when I put the element inside the other.
> The
>>>> elements is drawing in 2 places.
>>>>
>>>> Where do i remove the reference? in a command? how can i do that?
>>>
>> I will try to do this next monday, but first of all I have other doubts:
>>
>> 1- Are only that things to do ( implements OrphanChildCommand and after
>> getAddCommand) ?
>> I'm asking for that cause I thought implements chain command in
>> getAddCommand like: ChangeGuideCommand and DeleteCommand. I'm failed.
>> (Know i don't know accurately the ChangeGuideComand function)
>>
>> 2- Is it necessary override refreshChildren? And if I have to call
>> this method, where I do that?
>>
>> Thanks for all.
>
>
Steven, i did what u say. But nothing happened. That command wasn't invoked.
When I click on the figure and put it in other container the command
called is getAddCommand in the New container. This command is the
LAYOUT_ROLE. If u look LogicXYLayoutEditPolicy@getAddCommand it do a
chain of commands: addcomand + setConstraint + 2 other commands (1
chainGuideAttachmentCommand and other chainGuideDetachmentCommand). I
dont know how do I implement the chainGuide command.
Thanks again...
|
|
|
Powered by
FUDForum. Page generated in 0.05002 seconds