Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » glue figures to one another
glue figures to one another [message #193389] Thu, 25 August 2005 23:00 Go to next message
Jens Bartelheimer is currently offline Jens BartelheimerFriend
Messages: 44
Registered: July 2009
Member
Hi,

is it possible to glue different figures to one another?
I like to draw a line and glue this line on a figure.

Like this:
_____
|_____|
|
|
|

Further I have got the problem to draw a line that is scalable. The
Lines I draw with Polyline I can not stretch.

Has anybody an example to solve my problems?

Thanks,
Jens
Re: glue figures to one another [message #193397 is a reply to message #193389] Fri, 26 August 2005 04:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sgplkrsh.uiuc.edu

If I understand correctly, what you need is a figure and a connection
from/to the figure. Take a look at AbstractConnectionEditPart - this models
a connection from a figure.
GraphicalNodeEditPolicy.getConnectionCreateCommand() helps to tie the figure
to the connection. Once created, the connection is "glued" to the figure amd
moves along with it. I can send you some code examples if you need them.

Subhash

"Jens" <> wrote in message news:deliiu$a1t$1@news.eclipse.org...
> Hi,
>
> is it possible to glue different figures to one another?
> I like to draw a line and glue this line on a figure.
>
> Like this:
> _____
> |_____|
> |
> |
> |
>
> Further I have got the problem to draw a line that is scalable. The
> Lines I draw with Polyline I can not stretch.
>
> Has anybody an example to solve my problems?
>
> Thanks,
> Jens
Re: glue figures to one another [message #193402 is a reply to message #193397] Fri, 26 August 2005 06:30 Go to previous messageGo to next message
Jens Bartelheimer is currently offline Jens BartelheimerFriend
Messages: 44
Registered: July 2009
Member
I do not know if I could realize my problem with a connection because
the line I would like to "glue" has only a source and no target. I guess
that a target is neccassry to implement a conncetion and thus my first
idea was a Polyline. But I can hide the target source of my connection
to the user to solve my problem. But is this the best soultion? If there
is no other way I will try it with a AbstractConnectionEditPart.

Thanks,
Jens


Subhash Gopalakrishnan wrote:
> If I understand correctly, what you need is a figure and a connection
> from/to the figure. Take a look at AbstractConnectionEditPart - this models
> a connection from a figure.
> GraphicalNodeEditPolicy.getConnectionCreateCommand() helps to tie the figure
> to the connection. Once created, the connection is "glued" to the figure amd
> moves along with it. I can send you some code examples if you need them.
>
> Subhash
>
> "Jens" <> wrote in message news:deliiu$a1t$1@news.eclipse.org...
>
>>Hi,
>>
>>is it possible to glue different figures to one another?
>>I like to draw a line and glue this line on a figure.
>>
>>Like this:
>>_____
>>|_____|
>> |
>> |
>> |
>>
>>Further I have got the problem to draw a line that is scalable. The
>>Lines I draw with Polyline I can not stretch.
>>
>>Has anybody an example to solve my problems?
>>
>>Thanks,
>>Jens
>
>
>
Re: glue figures to one another [message #193409 is a reply to message #193402] Fri, 26 August 2005 06:44 Go to previous messageGo to next message
Jens Bartelheimer is currently offline Jens BartelheimerFriend
Messages: 44
Registered: July 2009
Member
Sorry, I have forgotten to mention that I have to add connections to the
line as well. Is it possible to anchor connections to other connections?

The figure I like to draw is similar to a UML sequence diagram with an
object, a lifeline, and messages from the lifeline.

Like this:
_____
|_____|
|
|--------->
|





Jens wrote:
> I do not know if I could realize my problem with a connection because
> the line I would like to "glue" has only a source and no target. I guess
> that a target is neccassry to implement a conncetion and thus my first
> idea was a Polyline. But I can hide the target source of my connection
> to the user to solve my problem. But is this the best soultion? If there
> is no other way I will try it with a AbstractConnectionEditPart.
>
> Thanks,
> Jens
>
>
> Subhash Gopalakrishnan wrote:
>
>>If I understand correctly, what you need is a figure and a connection
>>from/to the figure. Take a look at AbstractConnectionEditPart - this models
>>a connection from a figure.
>>GraphicalNodeEditPolicy.getConnectionCreateCommand() helps to tie the figure
>>to the connection. Once created, the connection is "glued" to the figure amd
>>moves along with it. I can send you some code examples if you need them.
>>
>>Subhash
>>
>>"Jens" <> wrote in message news:deliiu$a1t$1@news.eclipse.org...
>>
>>
>>>Hi,
>>>
>>>is it possible to glue different figures to one another?
>>>I like to draw a line and glue this line on a figure.
>>>
>>>Like this:
>>>_____
>>>|_____|
>>> |
>>> |
>>> |
>>>
>>>Further I have got the problem to draw a line that is scalable. The
>>>Lines I draw with Polyline I can not stretch.
>>>
>>>Has anybody an example to solve my problems?
>>>
>>>Thanks,
>>>Jens
>>
>>
>>
Re: glue figures to one another [message #193439 is a reply to message #193409] Fri, 26 August 2005 08:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sgplkrsh.uiuc.edu

Ok, now I understand why you would need a line hanging from a box. You are
making a sequence diagram :-)

I would suggest making the box and the line part of the same figure. After
all, both of them represent one object in the diagram. If you make them part
of the same figure, the messages could become connections between the
object-figures.

And when you connect two objects with a message, you'll need to introduce
timeslice boxes as part of the line. This will be easier if you make them
part of the object-figure.

Subhash


"Jens" <jens.bartelheimer@gmx.de> wrote in message
news:demdov$50p$1@news.eclipse.org...
> Sorry, I have forgotten to mention that I have to add connections to the
> line as well. Is it possible to anchor connections to other connections?
>
> The figure I like to draw is similar to a UML sequence diagram with an
> object, a lifeline, and messages from the lifeline.
>
> Like this:
> _____
> |_____|
> |
> |--------->
> |
>
>
>
>
>
> Jens wrote:
>> I do not know if I could realize my problem with a connection because
>> the line I would like to "glue" has only a source and no target. I guess
>> that a target is neccassry to implement a conncetion and thus my first
>> idea was a Polyline. But I can hide the target source of my connection
>> to the user to solve my problem. But is this the best soultion? If there
>> is no other way I will try it with a AbstractConnectionEditPart.
>>
>> Thanks,
>> Jens
>>
>>
>> Subhash Gopalakrishnan wrote:
>>
>>>If I understand correctly, what you need is a figure and a connection
>>>from/to the figure. Take a look at AbstractConnectionEditPart - this
>>>models
>>>a connection from a figure.
>>>GraphicalNodeEditPolicy.getConnectionCreateCommand() helps to tie the
>>>figure
>>>to the connection. Once created, the connection is "glued" to the figure
>>>amd
>>>moves along with it. I can send you some code examples if you need them.
>>>
>>>Subhash
>>>
>>>"Jens" <> wrote in message news:deliiu$a1t$1@news.eclipse.org...
>>>
>>>
>>>>Hi,
>>>>
>>>>is it possible to glue different figures to one another?
>>>>I like to draw a line and glue this line on a figure.
>>>>
>>>>Like this:
>>>>_____
>>>>|_____|
>>>> |
>>>> |
>>>> |
>>>>
>>>>Further I have got the problem to draw a line that is scalable. The
>>>>Lines I draw with Polyline I can not stretch.
>>>>
>>>>Has anybody an example to solve my problems?
>>>>
>>>>Thanks,
>>>>Jens
>>>
>>>
>>>
Re: glue figures to one another [message #193515 is a reply to message #193389] Fri, 26 August 2005 13:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Polyline should only be used for connections.
Your ASCII art looks like it could just be one figure, or maybe one figure
with a special border whose insets are based on some child figure's
preferred size or something.

"Jens" <jens.bartelheimer@gmx.de> wrote in message
news:deliiu$a1t$1@news.eclipse.org...
> Hi,
>
> is it possible to glue different figures to one another?
> I like to draw a line and glue this line on a figure.
>
> Like this:
> _____
> |_____|
> |
> |
> |
>
> Further I have got the problem to draw a line that is scalable. The
> Lines I draw with Polyline I can not stretch.
>
> Has anybody an example to solve my problems?
>
> Thanks,
> Jens
Re: glue figures to one another [message #193522 is a reply to message #193397] Fri, 26 August 2005 13:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Don't use a connection for this, but yes, you can have connections to
connections.
Re: glue figures to one another [message #193657 is a reply to message #193389] Fri, 26 August 2005 19:25 Go to previous message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
How about you make the line that is hanging down just a normal rectangle
Figure with width=1?

"Jens" <jens.bartelheimer@gmx.de> wrote in message
news:deliiu$a1t$1@news.eclipse.org...
> Hi,
>
> is it possible to glue different figures to one another?
> I like to draw a line and glue this line on a figure.
>
> Like this:
> _____
> |_____|
> |
> |
> |
>
> Further I have got the problem to draw a line that is scalable. The
> Lines I draw with Polyline I can not stretch.
>
> Has anybody an example to solve my problems?
>
> Thanks,
> Jens
Previous Topic:How to move child editparts correctly?
Next Topic:preferredSize problem
Goto Forum:
  


Current Time: Thu Apr 25 13:38:48 GMT 2024

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

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

Back to the top