Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » coordinate mapping
coordinate mapping [message #148298] Sat, 21 August 2004 12:23
Bernd Hofner is currently offline Bernd Hofner
Messages: 59
Registered: July 2009
Member
Hello,

I'd like to use the XYLayout to generate a simple technical drawing.
Naturally, my model coordinates are in some real-world unit, like
millimetres.
I guess that draw2d uses pixel coordinates when placing figures.

How do I map between the two coordinate systems?

Is it possible to set a org.eclipse.draw2d.geometry.Transform object on a
view?

Or do I have to translate my model coordinates to the draw2d coordinates
each time I update my EditPart/Figure from the model?

If so, how do I get the scaling factors?
I can compuse the largest x/y extend of my model components and would get
something like realWorldMaxX and realWorldMaxY.
To get a scaling factor I would need the x/y extend of the canvas, which
probably changes if I use
the GEF Zooming features.

Any hints?

Cheers,

Bernd
Previous Topic:editor with no palette..Possible?
Next Topic:Text manipulation
Goto Forum:
  


Current Time: Sun May 19 10:09:48 EDT 2013

Powered by FUDForum. Page generated in 0.06713 seconds