Skip to main content



      Home
Home » Eclipse Projects » GEF » Connections
Connections [message #83276] Wed, 11 June 2003 12:02 Go to next message
Eclipse UserFriend
Originally posted by: joe999.walla.co.il

How can i prevent a Connection EditPart to be on-top of other edit part
which connected with that connection?
Re: Connections [message #83300 is a reply to message #83276] Wed, 11 June 2003 11:18 Go to previous messageGo to next message
Eclipse UserFriend
Can you give a specific scenario or maybe a picture? I'm not sure what you're
asking.

Eric


Joe wrote:

> How can i prevent a Connection EditPart to be on-top of other edit part
> which connected with that connection?
>
>
Re: Connections [message #83324 is a reply to message #83300] Wed, 11 June 2003 12:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: joe999.walla.co.il

simple scenario:

asume you have some simple EditParts conected between them with connections.
now what i would like to happen is that whenever i select one EditPart and
place it on-top of a connection (which of course does not connect this
EditPart...) the connection line will not cross the EditPart figure (it will
be hidden behind it).

by changing the order of EditParts in their parent i didn't manage to solve
this problem.

thanks.

"Eric Bordeau" <ebordeau@us.ibm.com> wrote in message
news:bc7h7a$ufl$2@rogue.oti.com...
> Can you give a specific scenario or maybe a picture? I'm not sure what
you're
> asking.
>
> Eric
>
>
> Joe wrote:
>
> > How can i prevent a Connection EditPart to be on-top of other edit part
> > which connected with that connection?
> >
> >
>
Re: Connections [message #83337 is a reply to message #83324] Wed, 11 June 2003 11:58 Go to previous messageGo to next message
Eclipse UserFriend
The connection layer is on top of the main layer where the edit parts' figures
reside. This causes all connections to be on top of other edit parts in this
situation. The only alternative I can think of is to use a better connection
router that include collision avoidance algorithms to route connections around
edit parts that are in the way. This is not a trivial task.

Eric


Joe wrote:
> simple scenario:
>
> asume you have some simple EditParts conected between them with connections.
> now what i would like to happen is that whenever i select one EditPart and
> place it on-top of a connection (which of course does not connect this
> EditPart...) the connection line will not cross the EditPart figure (it will
> be hidden behind it).
>
> by changing the order of EditParts in their parent i didn't manage to solve
> this problem.
>
> thanks.
>
> "Eric Bordeau" <ebordeau@us.ibm.com> wrote in message
> news:bc7h7a$ufl$2@rogue.oti.com...
>
>>Can you give a specific scenario or maybe a picture? I'm not sure what
>
> you're
>
>>asking.
>>
>>Eric
>>
>>
>>Joe wrote:
>>
>>
>>>How can i prevent a Connection EditPart to be on-top of other edit part
>>>which connected with that connection?
>>>
>>>
>>
>
>
Re: Connections [message #83418 is a reply to message #83337] Wed, 11 June 2003 14:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jpl.remotejava.com

Eric Bordeau wrote:

> The connection layer is on top of the main layer where the edit parts'
figures
> reside. This causes all connections to be on top of other edit parts in
this
> situation. The only alternative I can think of is to use a better
connection
> router that include collision avoidance algorithms to route connections
around
> edit parts that are in the way. This is not a trivial task.

The other solution is to reorder the layers. Define your own root EditPart
subclass and install it in the viewer. In my application, I am subclassing
ScalableFreeformRootEditPart. There I can override createPrintableLayers
to swap the order in which layers are created:

protected LayeredPane createPrintableLayers()
{
FreeformLayeredPane layeredPane = new FreeformLayeredPane();

layeredPane.add(new ConnectionLayer(), CONNECTION_LAYER);
layeredPane.add(new FreeformLayer(), PRIMARY_LAYER);
return layeredPane;
}

-JPL
Re: Connections [message #83451 is a reply to message #83418] Wed, 11 June 2003 14:54 Go to previous messageGo to next message
Eclipse UserFriend
This has its own set of problems, though, which may not matter to certain
applications. The primary layer must be transparent in order to see the
connections behind it. Then if you have containers with nodes inside of them,
the connections won't draw on top of the container to the node inside it. I'm
specifically thinking of a circuit in the logic example -- if it contains an LED
for example, and there's a connection to that LED, the connection will be behind
the container circuit.

Jan Ploski wrote:

> Eric Bordeau wrote:
>
>
>>The connection layer is on top of the main layer where the edit parts'
>
> figures
>
>>reside. This causes all connections to be on top of other edit parts in
>
> this
>
>>situation. The only alternative I can think of is to use a better
>
> connection
>
>>router that include collision avoidance algorithms to route connections
>
> around
>
>>edit parts that are in the way. This is not a trivial task.
>
>
> The other solution is to reorder the layers. Define your own root EditPart
> subclass and install it in the viewer. In my application, I am subclassing
> ScalableFreeformRootEditPart. There I can override createPrintableLayers
> to swap the order in which layers are created:
>
> protected LayeredPane createPrintableLayers()
> {
> FreeformLayeredPane layeredPane = new FreeformLayeredPane();
>
> layeredPane.add(new ConnectionLayer(), CONNECTION_LAYER);
> layeredPane.add(new FreeformLayer(), PRIMARY_LAYER);
> return layeredPane;
> }
>
> -JPL
>
Re: Connections [message #83465 is a reply to message #83451] Wed, 11 June 2003 14:55 Go to previous messageGo to next message
Eclipse UserFriend
Jan,
I just read your other post. I see you've addressed these problems already.


Eric Bordeau wrote:

> This has its own set of problems, though, which may not matter to
> certain applications. The primary layer must be transparent in order to
> see the connections behind it. Then if you have containers with nodes
> inside of them, the connections won't draw on top of the container to
> the node inside it. I'm specifically thinking of a circuit in the logic
> example -- if it contains an LED for example, and there's a connection
> to that LED, the connection will be behind the container circuit.
>
> Jan Ploski wrote:
>
>> Eric Bordeau wrote:
>>
>>
>>> The connection layer is on top of the main layer where the edit parts'
>>
>>
>> figures
>>
>>> reside. This causes all connections to be on top of other edit parts in
>>
>>
>> this
>>
>>> situation. The only alternative I can think of is to use a better
>>
>>
>> connection
>>
>>> router that include collision avoidance algorithms to route connections
>>
>>
>> around
>>
>>> edit parts that are in the way. This is not a trivial task.
>>
>>
>>
>> The other solution is to reorder the layers. Define your own root
>> EditPart
>> subclass and install it in the viewer. In my application, I am
>> subclassing
>> ScalableFreeformRootEditPart. There I can override createPrintableLayers
>> to swap the order in which layers are created:
>>
>> protected LayeredPane createPrintableLayers()
>> {
>> FreeformLayeredPane layeredPane = new
>> FreeformLayeredPane();
>> layeredPane.add(new ConnectionLayer(), CONNECTION_LAYER);
>> layeredPane.add(new FreeformLayer(), PRIMARY_LAYER);
>> return layeredPane;
>> }
>>
>> -JPL
>>
>
Re: Connections [message #83480 is a reply to message #83465] Wed, 11 June 2003 15:58 Go to previous message
Eclipse UserFriend
Originally posted by: jpl.remotejava.com

Eric Bordeau wrote:

> Jan,
> I just read your other post. I see you've addressed these problems already.

Only sort of... your remarks definitely weren't a waste of keystrokes ;-)

Much can be achieved easily if the set and organization of layers is left
open-ended. So far I have only run into that one problem with
deactivateFigure described in the other thread (maybe let's move the
discussion there). But seeing layer name constants around GEF code makes
me feel somewhat uneasy, like maybe my proposed solution works around
the official API.

Best regards -
Jan Ploski
Previous Topic:palette question
Next Topic:Resize points of an EditPart
Goto Forum:
  


Current Time: Wed Jul 23 12:02:19 EDT 2025

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

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

Back to the top