Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Creating connection between two nodes with ports
Creating connection between two nodes with ports [message #175148] Mon, 03 March 2008 14:02 Go to next message
Eclipse UserFriend
Originally posted by: surayya.daimi.au.dk

This is a multi-part message in MIME format.
--------------000400020807010001000004
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Hi

I want to create connection by drawing it from a toolbar
The source is TaskEditPart the target is TaskEditPart

Those EditParts contain ports in their semantic model

EditPart i represented as figure Rectangle with child figures ports.

Ports are combination of a wraplabel with a triangle figure, as shown in
attached image

Ports do not have their own EditPart they only exist as figures.


When user want to create a connection between one port and another port
than the installed semantic policy (installed on TaskEditPart) creates a
ConnectionCreateCommand.

ConnectionCreateCommand knows the source (which is TaksEditPart) and
knows the target (which is the target TaskEditPart)

The request knows that the semantic model contains list of ports.

In the ConnectionCreateCommand a new connection model is created called
newElement. This connection has 3 constructors where one takes 4
parameters, that is (Task)source, (InputValues)port, target, and anotheport)

My problem is that i dont know what user chose to be the ports but only
know the source and target editparts.

How kan i know what user have chosen to be the source port and target
port, if i don
Creating connection between two nodes with ports [message #175162 is a reply to message #175148] Mon, 03 March 2008 15:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: surayya.daimi.au.dk

I still havenøt found out how i can know what port is used for creating
a connection.

If i har a way of knowing that a particular anchor is used for that
conneciton i would know what model element tow use for connection creation

I dont know if i can solve the problem without introducing a special
editpart for the port

Any help will be appreciated

Surayya Urazimbetova


surayya wrote:
> Hi
>
> I want to create connection by drawing it from a toolbar
> The source is TaskEditPart the target is TaskEditPart
>
> Those EditParts contain ports in their semantic model
>
> EditPart i represented as figure Rectangle with child figures ports.
>
> Ports are combination of a wraplabel with a triangle figure, as shown in
> attached image
>
> Ports do not have their own EditPart they only exist as figures.
>
>
> When user want to create a connection between one port and another port
> than the installed semantic policy (installed on TaskEditPart) creates a
> ConnectionCreateCommand.
>
> ConnectionCreateCommand knows the source (which is TaksEditPart) and
> knows the target (which is the target TaskEditPart)
>
> The request knows that the semantic model contains list of ports.
>
> In the ConnectionCreateCommand a new connection model is created called
> newElement. This connection has 3 constructors where one takes 4
> parameters, that is (Task)source, (InputValues)port, target, and
> anotheport)
>
> My problem is that i dont know what user chose to be the ports but only
> know the source and target editparts.
>
> How kan i know what user have chosen to be the source port and target
> port, if i donøt have editparts for ports.
>
> Should i fire mouseeventchanged from the figure of the TaskEditpart
> contaning the port figures?
>
>
> The thing is that i can create a connection by giving it static ports ,
> but how do i do it dynamically?
>
> The attached file shows the ports and connection between them with red.
>
> Best regards Surayya
>
>
>
>
>
> ------------------------------------------------------------ ------------
>
Creating connection between two nodes with ports [message #175735 is a reply to message #175162] Wed, 05 March 2008 09:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: surayya.daimi.au.dk

Hi

I dont know how i can create a connection in the ConnectionCreateCommand
This command is send by TaskEditPart when calling
completeCreateRelationship(req)

I should be able here tell the ConnectionCreatecomannd that i have ports
attached to the TaskEditPart.

But As those ports leave as Figures in the TaskEditPat i dont know how
to get the locations of those ports

any Help will be appreciated

thank you in advance

Surayya Urazimbetova

surayya wrote:
> I still havenøt found out how i can know what port is used for creating
> a connection.
>
> If i har a way of knowing that a particular anchor is used for that
> conneciton i would know what model element tow use for connection creation
>
> I dont know if i can solve the problem without introducing a special
> editpart for the port
>
> Any help will be appreciated
>
> Surayya Urazimbetova
>
>
> surayya wrote:
>> Hi
>>
>> I want to create connection by drawing it from a toolbar
>> The source is TaskEditPart the target is TaskEditPart
>>
>> Those EditParts contain ports in their semantic model
>>
>> EditPart i represented as figure Rectangle with child figures ports.
>>
>> Ports are combination of a wraplabel with a triangle figure, as shown
>> in attached image
>>
>> Ports do not have their own EditPart they only exist as figures.
>>
>>
>> When user want to create a connection between one port and another
>> port than the installed semantic policy (installed on TaskEditPart)
>> creates a ConnectionCreateCommand.
>>
>> ConnectionCreateCommand knows the source (which is TaksEditPart) and
>> knows the target (which is the target TaskEditPart)
>>
>> The request knows that the semantic model contains list of ports.
>>
>> In the ConnectionCreateCommand a new connection model is created
>> called newElement. This connection has 3 constructors where one takes
>> 4 parameters, that is (Task)source, (InputValues)port, target, and
>> anotheport)
>>
>> My problem is that i dont know what user chose to be the ports but
>> only know the source and target editparts.
>>
>> How kan i know what user have chosen to be the source port and target
>> port, if i donøt have editparts for ports.
>>
>> Should i fire mouseeventchanged from the figure of the TaskEditpart
>> contaning the port figures?
>>
>>
>> The thing is that i can create a connection by giving it static ports
>> , but how do i do it dynamically?
>>
>> The attached file shows the ports and connection between them with red.
>>
>> Best regards Surayya
>>
>>
>>
>>
>>
>> ------------------------------------------------------------ ------------
>>
Re: Creating connection between two nodes with ports [message #176464 is a reply to message #175735] Fri, 07 March 2008 15:43 Go to previous message
Cherie Revells is currently offline Cherie RevellsFriend
Messages: 299
Registered: July 2009
Senior Member
Surayya,

I can only suggest creating an editpart for the port itself. I think
you will find you get more behavior for free this way. This is how it
is done in the GMF Logic Example for the terminals on circuits and in
any client applications I have seen.

You may run into further limitations with your ports without an
editpart. For example, what about if you wanted to be able to move the
port, show properties of the port, or have menu items appear on the port?

Regards,
Cherie

surayya wrote:
> Hi
>
> I dont know how i can create a connection in the ConnectionCreateCommand
> This command is send by TaskEditPart when calling
> completeCreateRelationship(req)
>
> I should be able here tell the ConnectionCreatecomannd that i have ports
> attached to the TaskEditPart.
>
> But As those ports leave as Figures in the TaskEditPat i dont know how
> to get the locations of those ports
>
> any Help will be appreciated
>
> thank you in advance
>
> Surayya Urazimbetova
>
> surayya wrote:
>> I still havenøt found out how i can know what port is used for
>> creating a connection.
>>
>> If i har a way of knowing that a particular anchor is used for that
>> conneciton i would know what model element tow use for connection
>> creation
>>
>> I dont know if i can solve the problem without introducing a special
>> editpart for the port
>>
>> Any help will be appreciated
>>
>> Surayya Urazimbetova
>>
>>
>> surayya wrote:
>>> Hi
>>>
>>> I want to create connection by drawing it from a toolbar
>>> The source is TaskEditPart the target is TaskEditPart
>>>
>>> Those EditParts contain ports in their semantic model
>>>
>>> EditPart i represented as figure Rectangle with child figures ports.
>>>
>>> Ports are combination of a wraplabel with a triangle figure, as shown
>>> in attached image
>>>
>>> Ports do not have their own EditPart they only exist as figures.
>>>
>>>
>>> When user want to create a connection between one port and another
>>> port than the installed semantic policy (installed on TaskEditPart)
>>> creates a ConnectionCreateCommand.
>>>
>>> ConnectionCreateCommand knows the source (which is TaksEditPart) and
>>> knows the target (which is the target TaskEditPart)
>>>
>>> The request knows that the semantic model contains list of ports.
>>>
>>> In the ConnectionCreateCommand a new connection model is created
>>> called newElement. This connection has 3 constructors where one takes
>>> 4 parameters, that is (Task)source, (InputValues)port, target, and
>>> anotheport)
>>>
>>> My problem is that i dont know what user chose to be the ports but
>>> only know the source and target editparts.
>>>
>>> How kan i know what user have chosen to be the source port and target
>>> port, if i donøt have editparts for ports.
>>>
>>> Should i fire mouseeventchanged from the figure of the TaskEditpart
>>> contaning the port figures?
>>>
>>>
>>> The thing is that i can create a connection by giving it static ports
>>> , but how do i do it dynamically?
>>>
>>> The attached file shows the ports and connection between them with red.
>>>
>>> Best regards Surayya
>>>
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------ ------------
>>>
Previous Topic:Out of memory when saving Image
Next Topic:Connection creation using Port eObjects
Goto Forum:
  


Current Time: Wed Apr 24 22:32:07 GMT 2024

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

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

Back to the top