Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Forcing compartment elements to stay within the compartment boundary.
Forcing compartment elements to stay within the compartment boundary. [message #41345] Thu, 07 September 2006 03:12 Go to next message
Eclipse UserFriend
Originally posted by: sayed.shoed.tavant.com

Hi,

I have a compartment with some elements in it.When I drag these elements
out of the compartment they come out of it due to which the generated
xml changes.
I want to force these elements to stay within the compartment boundary
even if I try to drag it outside the compartment. Within the compartment
I should be able to position it wherever I want.

can anyone help????

Regards
Sayed Aamir Shoeb
Re: Forcing compartment elements to stay within the compartment boundary. [message #41479 is a reply to message #41345] Thu, 07 September 2006 05:21 Go to previous messageGo to next message
Eclipse UserFriend
Hi Sayed,

maybe I've encountered a similar problem. But now it is solved.
My problem was that Labels which should be contained in a compartment
doesnt stay in there.
Take a look at the solution in the Thread: "Showing Attribute Labels in
Compartment". Which was startet yesterday.

kind regards,

andreas

sayed schrieb:
> Hi,
>
> I have a compartment with some elements in it.When I drag these elements
> out of the compartment they come out of it due to which the generated
> xml changes.
> I want to force these elements to stay within the compartment boundary
> even if I try to drag it outside the compartment. Within the compartment
> I should be able to position it wherever I want.
>
> can anyone help????
>
> Regards
> Sayed Aamir Shoeb
Re: Forcing compartment elements to stay within the compartment boundary. [message #41673 is a reply to message #41479] Thu, 07 September 2006 06:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sayed.shoed.tavant.com

Hi Andreas,

I think that the problem I am facing is different from yours.

I have a rectangular figure say NodeA.This contains another node
say NodeB.So the xml that is generated looks like:

< node a name = "NodeA">
<NodeB name = "NodeB" />
</nodeA>
Now when I drag the nodeB and take it outside NodeA the xml generated is

<NodeA name = "NodeA"/>
<NodeB name = "NodeB"/>

I have not specified any TopNode reference for NodeB because I dont want
NodeB outside NodeA. I want to force NodeB to be inside NodeA even if I
try to drag it outside.


Thanks
Sayed Aamir Shoeb


Andreas Heinecke wrote:
> Hi Sayed,
>
> maybe I've encountered a similar problem. But now it is solved.
> My problem was that Labels which should be contained in a compartment
> doesnt stay in there.
> Take a look at the solution in the Thread: "Showing Attribute Labels in
> Compartment". Which was startet yesterday.
>
> kind regards,
>
> andreas
>
> sayed schrieb:
>> Hi,
>>
>> I have a compartment with some elements in it.When I drag these elements
>> out of the compartment they come out of it due to which the generated
>> xml changes.
>> I want to force these elements to stay within the compartment boundary
>> even if I try to drag it outside the compartment. Within the compartment
>> I should be able to position it wherever I want.
>>
>> can anyone help????
>>
>> Regards
>> Sayed Aamir Shoeb
Re: Forcing compartment elements to stay within the compartment boundary. [message #41735 is a reply to message #41673] Thu, 07 September 2006 07:17 Go to previous messageGo to next message
Eclipse UserFriend
Hello sayed,

> I have not specified any TopNode reference for NodeB because I dont
> want NodeB outside NodeA. I want to force NodeB to be inside NodeA
> even if I try to drag it outside.
So, if you are not able to create NodeB on the diagram surface, but can d&d
it out side of it's container to the diagram (and model created in this case
will be invalid) that's definitely a problem and you can submit a request
for it.

BTW, there should be additional NodeC representing the diagram itself, so
XML you’ll get as a result should looks like:

<NodeC name=”Diagram”>
<NodeA name = "NodeA"/>
<NodeB name = "NodeB"/>
</NodeC>

I suppose in this case you can change your meta-model to prevent NodeB from
being created in NodeC (remove all containment references form NodeC to NodeB
– this could solve your problems for now.

Last question: are you using normal ECORE meta-model or you are creating
this meta-model from XSD?

-----------------
Alex Shatalin
Re: Forcing compartment elements to stay within the compartment boundary. [message #41953 is a reply to message #41735] Thu, 07 September 2006 10:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sayed.shoed.tavant.com

Hi Alex,

I use XSD to create the meta-model.But now I am editing the ecore
directly . I removed the contaiment reference from nodeC and it seems to
work fine now .
One more question :

I have a case in which I have a collapsible compartment. This
compartment has a lot of nodes mapped on to it. When I hover my mouse on
to this node I want the the names of these nodes to be displayed.Is this
possible using GMF

Alex Shatalin wrote:
> Hello sayed,
>
>> I have not specified any TopNode reference for NodeB because I dont
>> want NodeB outside NodeA. I want to force NodeB to be inside NodeA
>> even if I try to drag it outside.
> So, if you are not able to create NodeB on the diagram surface, but can
> d&d it out side of it's container to the diagram (and model created in
> this case will be invalid) that's definitely a problem and you can
> submit a request for it.
>
> BTW, there should be additional NodeC representing the diagram itself,
> so XML you’ll get as a result should looks like:
>
> <NodeC name=”Diagram”>
> <NodeA name = "NodeA"/>
> <NodeB name = "NodeB"/>
> </NodeC>
>
> I suppose in this case you can change your meta-model to prevent
> NodeB from being created in NodeC (remove all containment references
> form NodeC to NodeB – this could solve your problems for now.
>
> Last question: are you using normal ECORE meta-model or you are
> creating this meta-model from XSD?
>
> -----------------
> Alex Shatalin
>
>
Re: Forcing compartment elements to stay within the compartment boundary. [message #42015 is a reply to message #41953] Thu, 07 September 2006 10:23 Go to previous message
Eclipse UserFriend
Hello sayed,

> I use XSD to create the meta-model.But now I am editing the ecore
> directly . I removed the contaiment reference from nodeC and it seems
> to work fine now .
Can you please submit a bugzilla entry for this problem - it should not
be possible to d&d node even if containment reference is specified in the
model, but there is no TopNodeReference.

-----------------
Alex Shatalin
Previous Topic:Link Mapping - Constraint for one Link
Next Topic:ecore graphical editor on model that depends on another ecore model
Goto Forum:
  


Current Time: Thu Jul 17 11:36:01 EDT 2025

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

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

Back to the top