Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » property view show reference
property view show reference [message #197110] Tue, 15 July 2008 14:01 Go to next message
yeliu is currently offline yeliuFriend
Messages: 145
Registered: July 2009
Senior Member
Hello,
I have several questions:
How to make the property view in the runtime not show the references
between classes?
Why some properties are changed as I make connections between
figures,while those containment property are not changed? For instance,two
classes A and B, A contains B,A also can be connected to B by another
class C.when I connect A and B with C,the property view show C in the
'incoming ' and 'outgoing' in A and B's property.but B's 'container' is A
is not shown in the property of B the moment I draw B in A?



Regards
Ye Liu
Re: property view show reference [message #197193 is a reply to message #197110] Wed, 16 July 2008 07:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tobk42.gmx.de

Hello Ye,

you can specify which properties should be shown and which not (and also
whether the visible properties should be editable) in the EMF genmodel
file. Select a property from the tree and change the 'property type' in
the 'edit' category. Here you can also assign categories to the several
properties (just like the 'ecore' and 'edit' categories in this sheet).
Make the changes and regenerate the edit code.

Regards,
Tobias



Ye Liu schrieb:
> Hello,
> I have several questions:
> How to make the property view in the runtime not show the references
> between classes?
> Why some properties are changed as I make connections between
> figures,while those containment property are not changed? For
> instance,two classes A and B, A contains B,A also can be connected to B
> by another class C.when I connect A and B with C,the property view show
> C in the 'incoming ' and 'outgoing' in A and B's property.but B's
> 'container' is A is not shown in the property of B the moment I draw B
> in A?
>
>
> Regards
> Ye Liu
>
Re: property view show reference [message #197392 is a reply to message #197193] Wed, 16 July 2008 11:45 Go to previous messageGo to next message
yeliu is currently offline yeliuFriend
Messages: 145
Registered: July 2009
Senior Member
Hello,
Even if I changed the 'Property type' of this reference from'None' to
'Editable'.The outcome is still not as I expected.
e.g. a class O belong to class A, O has an association to A called
Parent.(in order to get the Parent name once an instance of O is drawn
inside an instance of A).Initially, when the 'Property type' of 'Parent'
is set to 'None' .Nothing was shown whether I draw instance of O inside A
or not.After I change the 'property type' to 'Editable', there 'parent'
property of O's instance shows a list of existing instances of A in the
Canvas.It is expected to show the specific parent automatically instead
let user to choose one from the list.


Thanks a lot!


Ye Liu
Re: property view show reference [message #197448 is a reply to message #197392] Wed, 16 July 2008 12:50 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tobk42.gmx.de

Hi Ye,

actually, the current value of the reference should already be selected
in that list. Are you sure that the parent ref is the opposite of the
containing ref, so parent is set automatically when node O is inserted
in A? BTW, I would recommend not to set properties to 'editable' that
correspond to diagram elements, as they will most likely not synchronize
with the diagram when you change them.

Regarding your other posting I could also imagine that something is
wrong with your mapping model, especially the definition of the
compartment in A, so that O is not really contained in A, but only drawn
on top of it or something. Could you check your model file (using the
tree editor or as XML) and check whether O really is a child of A?

tobias



Ye Liu schrieb:
> Hello,
> Even if I changed the 'Property type' of this reference from'None' to
> 'Editable'.The outcome is still not as I expected.
> e.g. a class O belong to class A, O has an association to A called
> Parent.(in order to get the Parent name once an instance of O is drawn
> inside an instance of A).Initially, when the 'Property type' of 'Parent'
> is set to 'None' .Nothing was shown whether I draw instance of O inside
> A or not.After I change the 'property type' to 'Editable', there
> 'parent' property of O's instance shows a list of existing instances of
> A in the Canvas.It is expected to show the specific parent automatically
> instead let user to choose one from the list.
>
>
> Thanks a lot!
>
>
> Ye Liu
>
Re: property view show reference [message #197542 is a reply to message #197448] Thu, 17 July 2008 08:05 Go to previous messageGo to next message
yeliu is currently offline yeliuFriend
Messages: 145
Registered: July 2009
Senior Member
Hello,Tobias
First,thank you very much!
I have tried to define another class K(which is also a child of
container class A ) as compartment of A, and it succeed now.The 'parent'
property works well now as well as the collapsible function.
But I wonder if it is possible to add more figures inside the same
compartment?and how about include the an instance of the container itself?
Because when we define Compartment in .gmfgraph,there is only one 'Figure
Descriptor' can be chosen as property 'Figure'.(The container class A have
more than one children including itself. )


Long for your reply!


Ye Liu
Re: property view show reference [message #197698 is a reply to message #197542] Thu, 17 July 2008 11:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tobk42.gmx.de

Hello Ye,

I think you got something wrong with you gmfgraph model. The compartment
figure ist NOT the figure of the node that is contained in this
compartment, but a container for those nodes.

For instance, in the general case you will have a figure with a label
and a compartment. That would mean you have a figure descriptor with a
child figure, which again has a child label and another child figure (a
rectangle).
- FigureDesc
- ParentFigure // this is the figure that is shown for the parent node
- LabelFigure // this figure is the label of the parent
- CompartmentFigure // this figure (should be a rectangle) is the
one associated with the Compartment

Now, in the mapping model, you define a top level node for the parent,
holding a compartment mapping associated with the compartment from the
gmfgraph model, a feature label mapping and a child reference mapping,
associated with the compartment mapping.

Well, I think this is a bit much to explain here. Have you yet tried the
GMF-Tutorials? I think they explain the issue very well. You find them here:
<http://wiki.eclipse.org/GMF_Documentation> (however, currently there
seem to be some problems with the server)

Tobias



Ye Liu schrieb:
> Hello,Tobias
> First,thank you very much!
> I have tried to define another class K(which is also a child of
> container class A ) as compartment of A, and it succeed now.The 'parent'
> property works well now as well as the collapsible function.
> But I wonder if it is possible to add more figures inside the same
> compartment?and how about include the an instance of the container
> itself? Because when we define Compartment in .gmfgraph,there is only
> one 'Figure Descriptor' can be chosen as property 'Figure'.(The
> container class A have more than one children including itself. )
>
>
> Long for your reply!
>
>
> Ye Liu
>
Re: property view show reference [message #197713 is a reply to message #197698] Thu, 17 July 2008 12:13 Go to previous messageGo to next message
yeliu is currently offline yeliuFriend
Messages: 145
Registered: July 2009
Senior Member
Hello,
I checked the tutorials carefully,and now I understand the real meaning
of compartment and its setting.
However, I still wonder whether the container class can contain itself
in the compartment.Or I should define them separately when I define the
Ecore model.E.g.there is such object A as a container for other
objects.The top A is the biggest container which there can be only one in
a program.Now I define only one class A,use an attribute Top to distinct
Top A and A.If it's better to define a separate class TopA and class A,A
is contained in TopA? Hopefully I'm understood.


Thank you very much!

Ye Liu
Re: property view show reference [message #197720 is a reply to message #197713] Thu, 17 July 2008 12:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tobk42.gmx.de

Hello Ye,

I'm glad I could help. Concerning the problem of inserting A in A, you
should have a look at the thread "Indefinite Child Referentiation" right
next to this thread. Basically, you can insert nodes recursively by
setting the "Referenced Child" feature of a Child Reference.

Tobias



Ye Liu schrieb:
> Hello, I checked the tutorials carefully,and now I understand the real
> meaning of compartment and its setting.
> However, I still wonder whether the container class can contain itself
> in the compartment.Or I should define them separately when I define the
> Ecore model.E.g.there is such object A as a container for other
> objects.The top A is the biggest container which there can be only one
> in a program.Now I define only one class A,use an attribute Top to
> distinct Top A and A.If it's better to define a separate class TopA and
> class A,A is contained in TopA? Hopefully I'm understood.
>
>
> Thank you very much!
>
> Ye Liu
>
Re: property view show reference [message #197734 is a reply to message #197698] Thu, 17 July 2008 13:09 Go to previous messageGo to next message
yeliu is currently offline yeliuFriend
Messages: 145
Registered: July 2009
Senior Member
Hello,
There is a bug in the generated method EditPart file:
xxxCompartmentEditPart.java
public String getCompartmentName() {
return Messages.NetworkCanalsObjectCompartmentEditPart_title;
}

it says Messages.NetworkCanalsObjectCompartmentEditPart_title cann't be
resolved.
I have checked all the places need refering the name of the compartment
and they are all written.I don't know where else is wrong?


Thanks


Ye Liu
Re: property view show reference [message #197876 is a reply to message #197720] Fri, 18 July 2008 07:41 Go to previous messageGo to next message
yeliu is currently offline yeliuFriend
Messages: 145
Registered: July 2009
Senior Member
Hello Tobias,
I don't know if I understand correctly,I set the 'Referenced Child' of a
Child Reference to the container Node mapping.I couldn't tell whether it
works or not.
But I find one thing very strange: the compartment area is just a
limited rectangle area, it is not as big as the container's figure.So one
thing funny is if I draw a figure B inside the narrow compartment area of
A,then B's 'Parent ' property show A's name.if I draw B in the lower part
of figure of A,then B is not considered as A's child.
Is there a way to make the compartment area have the same size as the
figure contains it?


Thanks a lot!

Ye Liu
Re: property view show reference [message #197907 is a reply to message #197876] Fri, 18 July 2008 11:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tobk42.gmx.de

Ye Liu schrieb:
> Hello Tobias,
> I don't know if I understand correctly,I set the 'Referenced Child' of
> a Child Reference to the container Node mapping.I couldn't tell whether
> it works or not.

Why can't you tell? Can you insert an A in an A (and another A in the A
in the A), or not?


> But I find one thing very strange: the compartment area is just a
> limited rectangle area, it is not as big as the container's figure.So
> one thing funny is if I draw a figure B inside the narrow compartment
> area of A,then B's 'Parent ' property show A's name.if I draw B in the
> lower part of figure of A,then B is not considered as A's child.
> Is there a way to make the compartment area have the same size as the
> figure contains it?

There's definitely a way, but right now I can't tell how, because for me
it always worked by default, and by now I'm using exclusively custom
figures, so I can't just have a look in my gmfgraph. I think, you should
simply insert the label and the compartment figure into the parent
figure, without any layout, points, or stuff.

>
> Thanks a lot!
>
> Ye Liu
>

Tobias
Re: property view show reference [message #197915 is a reply to message #197907] Fri, 18 July 2008 12:07 Go to previous message
yeliu is currently offline yeliuFriend
Messages: 145
Registered: July 2009
Senior Member
Hello,
Thanks a lot!Now every figure can be correctly added in the compartment
of container.Even though the compartment area is not eaqual to the area of
the container figure,I find ways to place the desired figure inside the
compartment.


Ye Liu
Previous Topic:counting rows for text wrap in layoutmanager
Next Topic:Question on compartment stretching
Goto Forum:
  


Current Time: Mon May 25 05:20:18 GMT 2020

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

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

Back to the top