[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Re: Location of a EditPart and setLocation in CreateViewRequest

Thanks.

This is exactly what I was looking for.

Cheers,
 Jörg

"Cherie Revells" <crevells@xxxxxxxxxx> wrote in message 
news:ep8b55$r41$1@xxxxxxxxxxxxxxxxxxxx
> Jörg,
>
> If the location is relative to myEditPart's parent bounds, try this:
> myEditPart.getFigure().getParent().translateToAbsolute(theLocation);
>
> If you wanted to convert the absolute value to be relative to another 
> editpart you could do this:
> anotherEditPart.getFigure().translateToRelative(theLocation);
>
> I hope that helps.
>
> - Cherie
>
>
> Jörg Weinmann wrote:
>> Hi!
>>
>> I have some problems with the conversion between relative and absolute 
>> coordinates.
>>
>> I have a gmf generated editor and I want to use the CreateViewRequest 
>> Request to create a new model element and its view.
>> AFAIU expects the setLocation methode of the request an absolute 
>> location, but the EditPart.getLocation returns a location realive to the 
>> EditParts parent.
>>
>> So my question is: If I have the realitve location of a EditPart 
>> (strictly speaking the corresponding View), how can I convert this 
>> location to absolute value?
>>
>> Thanks for your help,
>>  Jörg
>>