Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Setting diagram measurement unit to Pixel not working
Setting diagram measurement unit to Pixel not working [message #222307] Mon, 23 March 2009 07:30 Go to next message
Haoyue Feng is currently offline Haoyue FengFriend
Messages: 2
Registered: July 2009
Junior Member
Hi everybody,
I'm using GMF build 2.2.0m5(2009/02/09),and I found a problem, please help
take a look if it is a GMF probelm or I did something wrong.

I define my own diagram and set the diagram measurement unit to "Pixel" in
the GMF GenModel, but when I create my own diagram editor, in the model
file, I find the unit is set to "Himetric":
<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation"
type="UEP" name="sup.model_diagram" measurementUnit="Himetric">

If I open an editor whose measurementUnit is "Pixel", after opening the
editor, the unit is automatically changed to "Himetric"

I tried to do some debugging, and find in the class
org.eclipse.gmf.runtime.notation.impl.DiagramImpl, when set this unit with
the method setMeasurementUnit(MeasurementUnit newMeasurementUnit), the
eFlags is set by eFlags |= MEASUREMENT_UNIT_ESETFLAG;
But when get the unit, it is done by return
MEASUREMENT_UNIT_EFLAG_VALUES[(eFlags & MEASUREMENT_UNIT_EFLAG) >>>
MEASUREMENT_UNIT_EFLAG_OFFSET];

Here I think MEASUREMENT_UNIT_ESETFLAG and MEASUREMENT_UNIT_EFLAG should
have the same offset, and that should be MEASUREMENT_UNIT_EFLAG_OFFSET.
But actually, MEASUREMENT_UNIT_EFLAG_OFFSET is set to 11,
MEASUREMENT_UNIT_EFLAG is set to 1 << MEASUREMENT_UNIT_EFLAG_OFFSET,
MEASUREMENT_UNIT_ESETFLAG is set to 1 << 12

Can anybody help me on this? Thanks
Re: Setting diagram measurement unit to Pixel not working [message #222397 is a reply to message #222307] Mon, 23 March 2009 17:24 Go to previous messageGo to next message
Tatiana Fesenko is currently offline Tatiana FesenkoFriend
Messages: 530
Registered: July 2009
Senior Member
Hello Haoyue,

Just switch to 2.2.0m5a(2009/02/12) or later build. It should help. 2.2.0m5a
build was announced in news://news.eclipse.org/gn1m0l$5c1$1@build.eclipse.org

You can get more details in bug 264438 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=264438).

Best wishes,
Tanya.

> Hi everybody,
> I'm using GMF build 2.2.0m5(2009/02/09),and I found a problem, please
> help
> take a look if it is a GMF probelm or I did something wrong.
> I define my own diagram and set the diagram measurement unit to
> "Pixel" in
> the GMF GenModel, but when I create my own diagram editor, in the
> model
> file, I find the unit is set to "Himetric":
> <notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation"
> type="UEP" name="sup.model_diagram" measurementUnit="Himetric">
> If I open an editor whose measurementUnit is "Pixel", after opening
> the editor, the unit is automatically changed to "Himetric"
>
> I tried to do some debugging, and find in the class
> org.eclipse.gmf.runtime.notation.impl.DiagramImpl, when set this unit
> with
> the method setMeasurementUnit(MeasurementUnit newMeasurementUnit), the
> eFlags is set by eFlags |= MEASUREMENT_UNIT_ESETFLAG;
> But when get the unit, it is done by return
> MEASUREMENT_UNIT_EFLAG_VALUES[(eFlags & MEASUREMENT_UNIT_EFLAG) >>>
> MEASUREMENT_UNIT_EFLAG_OFFSET];
> Here I think MEASUREMENT_UNIT_ESETFLAG and MEASUREMENT_UNIT_EFLAG
> should have the same offset, and that should be
> MEASUREMENT_UNIT_EFLAG_OFFSET. But actually,
> MEASUREMENT_UNIT_EFLAG_OFFSET is set to 11, MEASUREMENT_UNIT_EFLAG is
> set to 1 << MEASUREMENT_UNIT_EFLAG_OFFSET, MEASUREMENT_UNIT_ESETFLAG
> is set to 1 << 12
>
> Can anybody help me on this? Thanks
>
Re: Setting diagram measurement unit to Pixel not working [message #512382 is a reply to message #222307] Thu, 04 February 2010 20:25 Go to previous message
Laura Hernández is currently offline Laura HernándezFriend
Messages: 22
Registered: September 2009
Junior Member
Hi all,
I have installed the last GMF version and still have the same problem with Himetric units... Sad

Please, can anyone help me?

Thanks a lot!

Laura.
Previous Topic:Scalable polygon resize problem
Next Topic:Only few elements are displayed from generated model
Goto Forum:
  


Current Time: Thu Apr 25 08:33:17 GMT 2024

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

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

Back to the top