Set Location of a Node [message #188713] |
Thu, 22 May 2008 07:30  |
Eclipse User |
|
|
|
Originally posted by: carlos.munoz.justinmind.com
Hi everyone,
When I create a type of Node, my application must create another type and
locate it in an specific place of the diagram.
I have cerate the second Node, but i don't know how to locate it where I
want in the diagram.
I have use the SetBoundsCommand but ther's no result. The Node is located
in the center of the diagram always.
Anyone knows how can I do this??
Thanks and sorry, my english isn't good, I'm from Spain.
|
|
|
|
|
Re: Set Location of a Node [message #190589 is a reply to message #189898] |
Mon, 02 June 2008 12:46  |
Eclipse User |
|
|
|
Try reqVEC.setLocation(Point)
CreateViewRequest inherits setLocation from CreateRequest.
- Rich
On 5/29/08 3:17 AM, in article
1ad4112d2a32385e03d44f0ae3c70e39$1@www.eclipse.org, "Carlos Muñoz"
<carlos.munoz@justinmind.com> wrote:
> The CreateViewElement doesn't have a parameter for the location.
>
> I tried this:
>
> CompositeTransactionalCommand cc = new CompositeTransactionalCommand(
> domain, DiagramUIMessages.AddCommand_Label);
>
> PreferencesHint hint = new PreferencesHint(node.getName());
>
> CreateViewAndElementRequest reqVEC = new
> CreateViewAndElementRequest(ActivityScenariosElementTypes.Sc enarioPage_1001,
> hint);
>
> Iterator iter = reqVEC.getViewDescriptors().iterator();
>
> CreateViewRequest.ViewDescriptor viewDescriptor =
> (CreateViewRequest.ViewDescriptor)iter.next();
>
> Point rectangle = new Point(1000,1000);
>
> cc.compose(new SetBoundsCommand(domain,
> DiagramUIMessages.SetLocationCommand_Label_Resize,
> viewDescriptor,
> rectangle));
>
> try {
> cc.execute(null, null);
> ..
>
>
>
> is a SetBoundsCommand, but this is doing nothing.
>
|
|
|
Powered by
FUDForum. Page generated in 0.05231 seconds