Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Re: Has anyone experienced something like this?
Re: Has anyone experienced something like this? [message #423183] Wed, 24 September 2008 14:24 Go to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Víctor,

> http://img530.imageshack.us/img530/5522/gmfscreenshotxu0.png
>
> It happened to me when moved to EMF 2.5.0 and GMF 2.2.0 (both latest
> integration builds). As the screenshot shows, the labels started to
> show up wrong, like having different encoding... I tried regenerating
> both the emf model and the gmf diagram editor, but didn't help.
>
> Any clue?
>

Looks like diagram/model files stored by prev. version of EMF was not correctly
loaded..
I'm adding EMF newsgroup as a CC to this posting - m.b. Ed Merks can add
some comments to this thread..

-----------------
Alex Shatalin
Re: Has anyone experienced something like this? [message #423186 is a reply to message #423183] Wed, 24 September 2008 14:31 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30813
Registered: July 2009
Senior Member
Alex,

It definitely looks like an encoding problem. But EMF reads the XML
using SAX and that will always respects the encoding specified in the
XML header. So the most likely explanation seems to be that some tool
has edited the XML and saved the file with an encoding different from
the encoding specified in the XML header... I.e., to me it looks like a
mismatch between the actual encoding of the file and the specified
encoding in the header of the file...


Alex Shatalin wrote:
> Hello Víctor,
>
>> http://img530.imageshack.us/img530/5522/gmfscreenshotxu0.png
>>
>> It happened to me when moved to EMF 2.5.0 and GMF 2.2.0 (both latest
>> integration builds). As the screenshot shows, the labels started to
>> show up wrong, like having different encoding... I tried regenerating
>> both the emf model and the gmf diagram editor, but didn't help.
>>
>> Any clue?
>>
>
> Looks like diagram/model files stored by prev. version of EMF was not
> correctly loaded..
> I'm adding EMF newsgroup as a CC to this posting - m.b. Ed Merks can
> add some comments to this thread..
> -----------------
> Alex Shatalin
>
>
Re: Has anyone experienced something like this? [message #423190 is a reply to message #423186] Wed, 24 September 2008 15:25 Go to previous messageGo to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
Alex, Ed,

I also thought so, but seems that's not the reason. Specially when I
happens no matter where the resource come from: CDO or XMI. Furthermore,
all the values of the XML appear correctly in the properties view. It's
just a problem on how the diagram is showing them. And even more weird:
if I double click on any box in the diagram to edit the name, an editing
box appears with the correct value!!

I've tried a clean installation of eclipse, with latest integration
builds of most of the typical plugins (EMF, transaction, validation,
ocl, GMF, GEF...). I deleted deleted and regenerated the diagram editor
code. Even regenerated the .gmfgen. Even regenerated the model itself,
extending EObject and extending CDOObject, both with the same result.

I'll keep investigating...


Ed Merks escribió:
> Alex,
>
> It definitely looks like an encoding problem. But EMF reads the XML
> using SAX and that will always respects the encoding specified in the
> XML header. So the most likely explanation seems to be that some tool
> has edited the XML and saved the file with an encoding different from
> the encoding specified in the XML header... I.e., to me it looks like a
> mismatch between the actual encoding of the file and the specified
> encoding in the header of the file...
>
>
> Alex Shatalin wrote:
>> Hello Víctor,
>>
>>> http://img530.imageshack.us/img530/5522/gmfscreenshotxu0.png
>>>
>>> It happened to me when moved to EMF 2.5.0 and GMF 2.2.0 (both latest
>>> integration builds). As the screenshot shows, the labels started to
>>> show up wrong, like having different encoding... I tried regenerating
>>> both the emf model and the gmf diagram editor, but didn't help.
>>>
>>> Any clue?
>>>
>>
>> Looks like diagram/model files stored by prev. version of EMF was not
>> correctly loaded..
>> I'm adding EMF newsgroup as a CC to this posting - m.b. Ed Merks can
>> add some comments to this thread..
>> -----------------
>> Alex Shatalin
>>
>>
Re: Has anyone experienced something like this? [message #423194 is a reply to message #423190] Wed, 24 September 2008 16:56 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Víctor,

> Furthermore, all the values of the XML appear correctly in the
> properties view. It's just a problem on how the diagram is showing
> them. And even more weird: if I double click on any box in the diagram
> to edit the name, an editing box appears with the correct value!!
Wow!.. Can you try one more thing - remove .diagram file and re-create it
using model one as an input?
BTW, am i right that everything is ok if you are creating new diagram?
This is definitely not a problem of EMF..

-----------------
Alex Shatalin
Re: Has anyone experienced something like this? [message #423199 is a reply to message #423194] Wed, 24 September 2008 17:49 Go to previous messageGo to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
Alex,

nope, already tried that too.
I suspect of GEF ....

Alex Shatalin escribió:
> Hello Víctor,
>
>> Furthermore, all the values of the XML appear correctly in the
>> properties view. It's just a problem on how the diagram is showing
>> them. And even more weird: if I double click on any box in the diagram
>> to edit the name, an editing box appears with the correct value!!
> Wow!.. Can you try one more thing - remove .diagram file and re-create
> it using model one as an input?
> BTW, am i right that everything is ok if you are creating new diagram?
> This is definitely not a problem of EMF..
> -----------------
> Alex Shatalin
>
>
Re: Has anyone experienced something like this? [message #423225 is a reply to message #423199] Thu, 25 September 2008 09:14 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Víctor,

> nope, already tried that too.
Do you mean, newly intialized diagram used existing model was displayed with
incorrect labels?
Can you create new diagram and model/save/load it without any problems in
new version (is described problem visible only on legacy diagrams)?

> I suspect of GEF ....
Well, the reason can be in GMF as well.. Can you place a breakpoint into
???EditPart generated for one of the labels? (specifically into getLabelText/setLabelText
methods) I suppose you'll determine the place where label text was scrambled
inspecting stack trace in a debugger.

-----------------
Alex Shatalin
Re: Has anyone experienced something like this? [message #423232 is a reply to message #423225] Thu, 25 September 2008 10:42 Go to previous messageGo to next message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
Alex,

thanks for your feedback. I've spent a lot of time on this, but finally
found the problem. I hacked variables value in the code, and suddenly
everything started to show up fine!

The problem is in org.eclipse.draw2d.text.TextFlow.paintText(Graphics g,
String draw, int x, int y, int bidiLevel)

protected void paintText(Graphics g, String draw, int x, int y, int
bidiLevel) {
if (bidiLevel == -1) {
g.drawString(draw, x, y);
} else {
TextLayout tl = FlowUtilities.getTextLayout();
if (isMirrored())
tl.setOrientation(SWT.RIGHT_TO_LEFT);
tl.setFont(g.getFont());
tl.setText(draw);
g.drawTextLayout(tl, x, y);
}
}

And the responsible is the "bidiLevel".

While debugging, I realized that the value of the text was never
scrambled, but rather just drawn incorrectly. This argument was always
set to "-1". I hacked it to be set always to something different to
"-1", and it worked!

I suspected from it yesterday while trying different eclipse
installations, GMF crashed with problems related with com.ibm.icu, the
owner of the "BidiProcessor".

Anyway. Do you have a clue why I'm receiving "-1" in the BidiLevel?
Re: Has anyone experienced something like this? [message #423237 is a reply to message #423232] Thu, 25 September 2008 11:28 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Víctor,

> Anyway. Do you have a clue why I'm receiving "-1" in the BidiLevel?
Unfortunately not ;-(. Can you please file a request for GMF then runtime
team will be able to finally haldle that.

-----------------
Alex Shatalin
Re: Has anyone experienced something like this? [message #423241 is a reply to message #423237] Thu, 25 September 2008 11:54 Go to previous message
Victor Roldan Betancort is currently offline Victor Roldan BetancortFriend
Messages: 524
Registered: July 2009
Senior Member
Thanks again, Alex.

I've filed the bug:

"BidiLevel is improperly set to -1"
https://bugs.eclipse.org/bugs/show_bug.cgi?id=248551

Regards,
Víctor.
Previous Topic:How to make EMF use extendedMetaData
Next Topic:EOperation at runtime
Goto Forum:
  


Current Time: Fri Jan 24 18:36:50 GMT 2020

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

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

Back to the top