Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Refresh issues with re-opened diagrams
Refresh issues with re-opened diagrams [message #152779] Mon, 01 October 2007 11:57 Go to next message
Eclipse UserFriend
Originally posted by: jdente.21technologies.com

Hi,

I have an interesting problem in which newly created node lables will not
update on a previously closed diagram. My diagram looks a lot like the UML
2 diagram. There is a square node, with labels that represent attributes
that are displayed inside a compartment. This attribute label gets parsed
into two different properties on the attribute ("name:String" populates the
attribute-name field and type field). This works perfectly for newly
created nodes. However, if I create a node, save the diagram, close the
diagram, and then re-open the diagram, I will have refresh problems when
adding new attributes to the existing nodes. I can add an attribute and
then type in a new text value for the attribute. When I hit enter or click
somewhere else on the diagram, the attribute's properties will get set
correctly (ie, the name field and the property field will get set to the new
values). However, the label will not display the new attribute's text and
instead revert back to the default label text. Like I said earlier, this
problem only happens when I try and edit nodes that were in the diagram
before I opened it; my diagram works flawlessly with newly created nodes.

Does anybody have any ideas?

Thanks,
Joe.
Re: Refresh issues with re-opened diagrams [message #153124 is a reply to message #152779] Tue, 02 October 2007 14:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: 5d5.mail.ru

I'd start with adding tracing calls to the parser to see what it gets
from the editpart and what it sends back.

Joe Dente wrote:
> Hi,
>
> I have an interesting problem in which newly created node lables will not
> update on a previously closed diagram. My diagram looks a lot like the UML
> 2 diagram. There is a square node, with labels that represent attributes
> that are displayed inside a compartment. This attribute label gets parsed
> into two different properties on the attribute ("name:String" populates the
> attribute-name field and type field). This works perfectly for newly
> created nodes. However, if I create a node, save the diagram, close the
> diagram, and then re-open the diagram, I will have refresh problems when
> adding new attributes to the existing nodes. I can add an attribute and
> then type in a new text value for the attribute. When I hit enter or click
> somewhere else on the diagram, the attribute's properties will get set
> correctly (ie, the name field and the property field will get set to the new
> values). However, the label will not display the new attribute's text and
> instead revert back to the default label text. Like I said earlier, this
> problem only happens when I try and edit nodes that were in the diagram
> before I opened it; my diagram works flawlessly with newly created nodes.
>
> Does anybody have any ideas?
>
> Thanks,
> Joe.
>
>
Re: Refresh issues with re-opened diagrams [message #153148 is a reply to message #153124] Tue, 02 October 2007 17:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jdente.21technologies.com

Thanks for the response.
It turns out not to be a parsing issue. I realized that I have the same
refresh issue with the titles on my nodes, which don't involve any parsing
or edit/view patterns. They are a simple label containing the text of a
single String attribute. The updating that occurs is strange:

1) Add a new node (call it N) to a diagram. I can change the name of node N
as much as I want without any refresh issues.
2) Save and close my diagram.
3) Open the diagram. At this point if I change the name of node N, I will
have refresh issues.
4) Say the initial name of the node is "n1".
5) I edit this field and change it's name to "n2". The label will still
display "n1" on the node, but the node properties will now say "n2".
6) Click on the node label again to change its name. Type in "n3" and hit
enter. The label will now display "n2" and the properties of the node will
now say "n3".

As I said before, this problem ONLY happens on nodes that existed before I
opened the diagram. If I create a new node, I can change the names as much
as I want without any issues. Also, this problem does not exist in an
earlier prototype GMF project I created. I've compared the mappings and
ecores of the nodes and node labels between my two projects. The node and
label definitions appear identical at first glance, although I am still in
the process of going through the comparison.

Thanks,
Joe


"Dmitry Stadnik" <5d5@mail.ru> wrote in message
news:fdu168$tlh$3@build.eclipse.org...
> I'd start with adding tracing calls to the parser to see what it gets from
> the editpart and what it sends back.
>
> Joe Dente wrote:
>> Hi,
>>
>> I have an interesting problem in which newly created node lables will not
>> update on a previously closed diagram. My diagram looks a lot like the
>> UML 2 diagram. There is a square node, with labels that represent
>> attributes that are displayed inside a compartment. This attribute label
>> gets parsed into two different properties on the attribute ("name:String"
>> populates the attribute-name field and type field). This works perfectly
>> for newly created nodes. However, if I create a node, save the diagram,
>> close the diagram, and then re-open the diagram, I will have refresh
>> problems when adding new attributes to the existing nodes. I can add an
>> attribute and then type in a new text value for the attribute. When I
>> hit enter or click somewhere else on the diagram, the attribute's
>> properties will get set correctly (ie, the name field and the property
>> field will get set to the new values). However, the label will not
>> display the new attribute's text and instead revert back to the default
>> label text. Like I said earlier, this problem only happens when I try
>> and edit nodes that were in the diagram before I opened it; my diagram
>> works flawlessly with newly created nodes.
>>
>> Does anybody have any ideas?
>>
>> Thanks,
>> Joe.
Re: Refresh issues with re-opened diagrams [message #153154 is a reply to message #153148] Tue, 02 October 2007 18:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jdente.21technologies.com

I fixed the problem.

In my ecore model, I have an aggregation relationship from Graph --> Node.
In the properties for the Graph --> Node aggregation relationship, the
"Derived" field was accidentally set to "true". Changing this field back to
"false" fixed all of my bizarre refresh errors.

Can someone please explain to me what "Derived" does and why it affected my
diagram the way it did? I have the Eclipse Modeling Framework book and it
doesn't even explain "Derived". The Java docs are also useless since they
are simply auto-generated. It would be really helpful if there existed a
website or set of documentation that listed all of the different properties,
what they mean, and what their possible values could be.

Thanks,
Joe.

"Joe Dente" <jdente@21technologies.com> wrote in message
news:fduccl$d4u$1@build.eclipse.org...
> Thanks for the response.
> It turns out not to be a parsing issue. I realized that I have the same
> refresh issue with the titles on my nodes, which don't involve any parsing
> or edit/view patterns. They are a simple label containing the text of a
> single String attribute. The updating that occurs is strange:
>
> 1) Add a new node (call it N) to a diagram. I can change the name of node
> N as much as I want without any refresh issues.
> 2) Save and close my diagram.
> 3) Open the diagram. At this point if I change the name of node N, I will
> have refresh issues.
> 4) Say the initial name of the node is "n1".
> 5) I edit this field and change it's name to "n2". The label will still
> display "n1" on the node, but the node properties will now say "n2".
> 6) Click on the node label again to change its name. Type in "n3" and hit
> enter. The label will now display "n2" and the properties of the node
> will now say "n3".
>
> As I said before, this problem ONLY happens on nodes that existed before I
> opened the diagram. If I create a new node, I can change the names as
> much as I want without any issues. Also, this problem does not exist in
> an earlier prototype GMF project I created. I've compared the mappings
> and ecores of the nodes and node labels between my two projects. The node
> and label definitions appear identical at first glance, although I am
> still in the process of going through the comparison.
>
> Thanks,
> Joe
>
>
> "Dmitry Stadnik" <5d5@mail.ru> wrote in message
> news:fdu168$tlh$3@build.eclipse.org...
>> I'd start with adding tracing calls to the parser to see what it gets
>> from the editpart and what it sends back.
>>
>> Joe Dente wrote:
>>> Hi,
>>>
>>> I have an interesting problem in which newly created node lables will
>>> not update on a previously closed diagram. My diagram looks a lot like
>>> the UML 2 diagram. There is a square node, with labels that represent
>>> attributes that are displayed inside a compartment. This attribute
>>> label gets parsed into two different properties on the attribute
>>> ("name:String" populates the attribute-name field and type field). This
>>> works perfectly for newly created nodes. However, if I create a node,
>>> save the diagram, close the diagram, and then re-open the diagram, I
>>> will have refresh problems when adding new attributes to the existing
>>> nodes. I can add an attribute and then type in a new text value for the
>>> attribute. When I hit enter or click somewhere else on the diagram, the
>>> attribute's properties will get set correctly (ie, the name field and
>>> the property field will get set to the new values). However, the label
>>> will not display the new attribute's text and instead revert back to the
>>> default label text. Like I said earlier, this problem only happens when
>>> I try and edit nodes that were in the diagram before I opened it; my
>>> diagram works flawlessly with newly created nodes.
>>>
>>> Does anybody have any ideas?
>>>
>>> Thanks,
>>> Joe.
>
>
Re: Refresh issues with re-opened diagrams [message #153225 is a reply to message #153154] Wed, 03 October 2007 07:26 Go to previous message
Eclipse UserFriend
Originally posted by: 5d5.mail.ru

Derived properties are not stored in the model - their value is derived
from other properties or runtime context or whatever. Basically you
should write code by hand to read/write the value.

Joe Dente wrote:
> I fixed the problem.
>
> In my ecore model, I have an aggregation relationship from Graph --> Node.
> In the properties for the Graph --> Node aggregation relationship, the
> "Derived" field was accidentally set to "true". Changing this field back to
> "false" fixed all of my bizarre refresh errors.
>
> Can someone please explain to me what "Derived" does and why it affected my
> diagram the way it did? I have the Eclipse Modeling Framework book and it
> doesn't even explain "Derived". The Java docs are also useless since they
> are simply auto-generated. It would be really helpful if there existed a
> website or set of documentation that listed all of the different properties,
> what they mean, and what their possible values could be.
>
> Thanks,
> Joe.
>
> "Joe Dente" <jdente@21technologies.com> wrote in message
> news:fduccl$d4u$1@build.eclipse.org...
>> Thanks for the response.
>> It turns out not to be a parsing issue. I realized that I have the same
>> refresh issue with the titles on my nodes, which don't involve any parsing
>> or edit/view patterns. They are a simple label containing the text of a
>> single String attribute. The updating that occurs is strange:
>>
>> 1) Add a new node (call it N) to a diagram. I can change the name of node
>> N as much as I want without any refresh issues.
>> 2) Save and close my diagram.
>> 3) Open the diagram. At this point if I change the name of node N, I will
>> have refresh issues.
>> 4) Say the initial name of the node is "n1".
>> 5) I edit this field and change it's name to "n2". The label will still
>> display "n1" on the node, but the node properties will now say "n2".
>> 6) Click on the node label again to change its name. Type in "n3" and hit
>> enter. The label will now display "n2" and the properties of the node
>> will now say "n3".
>>
>> As I said before, this problem ONLY happens on nodes that existed before I
>> opened the diagram. If I create a new node, I can change the names as
>> much as I want without any issues. Also, this problem does not exist in
>> an earlier prototype GMF project I created. I've compared the mappings
>> and ecores of the nodes and node labels between my two projects. The node
>> and label definitions appear identical at first glance, although I am
>> still in the process of going through the comparison.
>>
>> Thanks,
>> Joe
>>
>>
>> "Dmitry Stadnik" <5d5@mail.ru> wrote in message
>> news:fdu168$tlh$3@build.eclipse.org...
>>> I'd start with adding tracing calls to the parser to see what it gets
>>> from the editpart and what it sends back.
>>>
>>> Joe Dente wrote:
>>>> Hi,
>>>>
>>>> I have an interesting problem in which newly created node lables will
>>>> not update on a previously closed diagram. My diagram looks a lot like
>>>> the UML 2 diagram. There is a square node, with labels that represent
>>>> attributes that are displayed inside a compartment. This attribute
>>>> label gets parsed into two different properties on the attribute
>>>> ("name:String" populates the attribute-name field and type field). This
>>>> works perfectly for newly created nodes. However, if I create a node,
>>>> save the diagram, close the diagram, and then re-open the diagram, I
>>>> will have refresh problems when adding new attributes to the existing
>>>> nodes. I can add an attribute and then type in a new text value for the
>>>> attribute. When I hit enter or click somewhere else on the diagram, the
>>>> attribute's properties will get set correctly (ie, the name field and
>>>> the property field will get set to the new values). However, the label
>>>> will not display the new attribute's text and instead revert back to the
>>>> default label text. Like I said earlier, this problem only happens when
>>>> I try and edit nodes that were in the diagram before I opened it; my
>>>> diagram works flawlessly with newly created nodes.
>>>>
>>>> Does anybody have any ideas?
>>>>
>>>> Thanks,
>>>> Joe.
>>
>
>
Previous Topic:Wrong size of ScalableImageFigures (SVG)
Next Topic:Creation tool for combined figures
Goto Forum:
  


Current Time: Sat Jul 12 23:20:31 EDT 2025

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

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

Back to the top