Skip to main content



      Home
Home » Eclipse Projects » GEF » Connection creation
Connection creation [message #80885] Mon, 26 May 2003 15:12 Go to next message
Eclipse UserFriend
Originally posted by: grandan.libero.it

Hi!

I need some suggestions about GEF. I'd like to realize different kinds of
connections between the figures of my GEF application.
I see that in the Logic Example there is only one type of connection, the
Wire connection, which can interconnect the anchors of the figures in the
editor.
In my application I need a new type of connection which can interconnect
other kinds of anchors on the figures. I. e. I want to:
_ add to my figures two kinds of anchors, A and B;
_ use the Wire connection to connect anchors of type A, but not anchors of
type B;
_ use MyNewConnection to connect anchors of type B, but not anchors of
type A;
_ add the appropriate button to the palette for MyNewConnection.

Is it possibile to create MyNewConnection?

Can you tell me which classes in particular I have to define?

Thank you in advance.
Best regards.
Bye bye!

Daniele
Re: Connection creation [message #80904 is a reply to message #80885] Mon, 26 May 2003 15:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

The way to do this is to implement getObjectType on your CreationFactory.
CreateRequest makes getNewObjectType() available everywhere, so this is how
you know which connection is being created.

"Daniele Grandi" <grandan@libero.it> wrote in message
news:batovh$im1$1@rogue.oti.com...
> Hi!
>
> I need some suggestions about GEF. I'd like to realize different kinds of
> connections between the figures of my GEF application.
> I see that in the Logic Example there is only one type of connection, the
> Wire connection, which can interconnect the anchors of the figures in the
> editor.
> In my application I need a new type of connection which can interconnect
> other kinds of anchors on the figures. I. e. I want to:
> _ add to my figures two kinds of anchors, A and B;
> _ use the Wire connection to connect anchors of type A, but not anchors of
> type B;
> _ use MyNewConnection to connect anchors of type B, but not anchors of
> type A;
> _ add the appropriate button to the palette for MyNewConnection.
>
> Is it possibile to create MyNewConnection?
>
> Can you tell me which classes in particular I have to define?
>
> Thank you in advance.
> Best regards.
> Bye bye!
>
> Daniele
>
>
>
Re: Connection creation [message #81425 is a reply to message #80904] Wed, 28 May 2003 14:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: grandan.libero.it

Hi Randy,

If I want to create a new connection I have to add it to my palette using
ConnectionCreationToolEntry, is it right?
I think I have to specify the factory parameter, right?

I see that for the Logic Example the creation factory is named
LogicElementFactory, but this is not specified in the factory parameter of
the ConnectionCreationToolEntry, can you tell me why?

Then I think I have to create a new class derived from the
AbstractConnectionEditPart, like the WireEditPart, which is the EditPart
of my new connection, right?

It is not clear for me where I can use the getObjectType/getNewObjectType
methods to know which connection is being created.
Can I use it inside my NodeEditPolicy, in the methods
getConnectionCreateCommand - getConnectionCompleteCommand?

Thank you in advance,

Daniele



Randy Hudson wrote:

> The way to do this is to implement getObjectType on your CreationFactory.
> CreateRequest makes getNewObjectType() available everywhere, so this is how
> you know which connection is being created.

> "Daniele Grandi" <grandan@libero.it> wrote in message
> news:batovh$im1$1@rogue.oti.com...
> > Hi!
> >
> > I need some suggestions about GEF. I'd like to realize different kinds of
> > connections between the figures of my GEF application.
> > I see that in the Logic Example there is only one type of connection, the
> > Wire connection, which can interconnect the anchors of the figures in the
> > editor.
> > In my application I need a new type of connection which can interconnect
> > other kinds of anchors on the figures. I. e. I want to:
> > _ add to my figures two kinds of anchors, A and B;
> > _ use the Wire connection to connect anchors of type A, but not anchors of
> > type B;
> > _ use MyNewConnection to connect anchors of type B, but not anchors of
> > type A;
> > _ add the appropriate button to the palette for MyNewConnection.
> >
> > Is it possibile to create MyNewConnection?
> >
> > Can you tell me which classes in particular I have to define?
> >
> > Thank you in advance.
> > Best regards.
> > Bye bye!
> >
> > Daniele
> >
> >
> >
Re: Connection creation [message #81451 is a reply to message #81425] Wed, 28 May 2003 14:59 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

There is only one type of connection in the Logic example, so a factory is
not used at all. The fact that the request is for connection creation is
all the information that is needed.

This is probably not the best example for applications with multiple
connection types. Maybe we should start using a real factory for creating
connections just for instructional purposes.

"Daniele Grandi" <grandan@libero.it> wrote in message
news:bb2uvc$hbo$1@rogue.oti.com...
> Hi Randy,
>
> If I want to create a new connection I have to add it to my palette using
> ConnectionCreationToolEntry, is it right?
> I think I have to specify the factory parameter, right?
>
> I see that for the Logic Example the creation factory is named
> LogicElementFactory, but this is not specified in the factory parameter of
> the ConnectionCreationToolEntry, can you tell me why?
>
> Then I think I have to create a new class derived from the
> AbstractConnectionEditPart, like the WireEditPart, which is the EditPart
> of my new connection, right?
>
> It is not clear for me where I can use the getObjectType/getNewObjectType
> methods to know which connection is being created.
> Can I use it inside my NodeEditPolicy, in the methods
> getConnectionCreateCommand - getConnectionCompleteCommand?
>
> Thank you in advance,
>
> Daniele
>
>
>
> Randy Hudson wrote:
>
> > The way to do this is to implement getObjectType on your
CreationFactory.
> > CreateRequest makes getNewObjectType() available everywhere, so this is
how
> > you know which connection is being created.
>
> > "Daniele Grandi" <grandan@libero.it> wrote in message
> > news:batovh$im1$1@rogue.oti.com...
> > > Hi!
> > >
> > > I need some suggestions about GEF. I'd like to realize different kinds
of
> > > connections between the figures of my GEF application.
> > > I see that in the Logic Example there is only one type of connection,
the
> > > Wire connection, which can interconnect the anchors of the figures in
the
> > > editor.
> > > In my application I need a new type of connection which can
interconnect
> > > other kinds of anchors on the figures. I. e. I want to:
> > > _ add to my figures two kinds of anchors, A and B;
> > > _ use the Wire connection to connect anchors of type A, but not
anchors of
> > > type B;
> > > _ use MyNewConnection to connect anchors of type B, but not anchors of
> > > type A;
> > > _ add the appropriate button to the palette for MyNewConnection.
> > >
> > > Is it possibile to create MyNewConnection?
> > >
> > > Can you tell me which classes in particular I have to define?
> > >
> > > Thank you in advance.
> > > Best regards.
> > > Bye bye!
> > >
> > > Daniele
> > >
> > >
> > >
>
>
>
>
>
Previous Topic:understanding connection invalidation
Next Topic:draw2d.text bug
Goto Forum:
  


Current Time: Tue Jul 22 14:52:50 EDT 2025

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

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

Back to the top