Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Selecting anchors (based on logic example)
Selecting anchors (based on logic example) [message #221318] Fri, 11 August 2006 15:13 Go to next message
Dan Phifer is currently offline Dan PhiferFriend
Messages: 72
Registered: July 2009
Member
I trying to create an editor that is very similar in look and feel to the
Logic example, with a few differences. In my editor, the user should be
able to set properties for a given terminal. Ideally, by clicking on the
terminal itself and changing properties in the properties view. I've back
and forth between two approaches.

First, I tried creating figures that had multiple anchor points each
corresponing to a terminal (just like the logic example). This works fine
for setting up the connections, but I could not figure out how to allow
the user to select a terminal and edit a property (such as a default value
if no connection is present).

In the second approach, I create an edit part for each terminal (by making
the terminals children of the circuit) and then gave each terminal a
single connection anchor. I don't have this working yet, but one problem
I noticed is that my ShortestPathConenctionRouter no longer routers
properly (it goes right through the circuits). Also, laying out the
terminals is problematic. In the first approach I could simply lay them
out in the circuit figure, but in the second approach each terminal has
its own figure. When I resize the circuit, the terminals don't get
repositioned unless I explicitly call a method from the circut's edit part
to each child, giving it the new dimensions of the cicuit.

Any suggestions would be apreciated.
Re: Selecting anchors (based on logic example) [message #221507 is a reply to message #221318] Tue, 15 August 2006 14:19 Go to previous messageGo to next message
Nhu Le is currently offline Nhu LeFriend
Messages: 47
Registered: July 2009
Member
Comment on your second approach:

1. Re routing, you will have to change the list of obstacle and make
sure that the terminal obstacles are right beside the main figure (or
overlap a bit) so that the connections do not go in between them

2. Re layout, I assume that you use your special layout manager to put
the connectors at the correct place in the circuit. When you resize the
circuit, the layout() method of the layout manager should be called
automatically and in there you can update the position of the connectors
based on the new information.

Nhu Le

Dan Phifer wrote:
> I trying to create an editor that is very similar in look and feel to
> the Logic example, with a few differences. In my editor, the user
> should be able to set properties for a given terminal. Ideally, by
> clicking on the terminal itself and changing properties in the
> properties view. I've back and forth between two approaches.
> First, I tried creating figures that had multiple anchor points each
> corresponing to a terminal (just like the logic example). This works
> fine for setting up the connections, but I could not figure out how to
> allow the user to select a terminal and edit a property (such as a
> default value if no connection is present).
>
> In the second approach, I create an edit part for each terminal (by
> making the terminals children of the circuit) and then gave each
> terminal a single connection anchor. I don't have this working yet, but
> one problem I noticed is that my ShortestPathConenctionRouter no longer
> routers properly (it goes right through the circuits). Also, laying out
> the terminals is problematic. In the first approach I could simply lay
> them out in the circuit figure, but in the second approach each terminal
> has its own figure. When I resize the circuit, the terminals don't get
> repositioned unless I explicitly call a method from the circut's edit
> part to each child, giving it the new dimensions of the cicuit.
>
> Any suggestions would be apreciated.
>
Re: Selecting anchors (based on logic example) [message #222037 is a reply to message #221507] Thu, 24 August 2006 14:58 Go to previous message
Eclipse UserFriend
Originally posted by: pilgrim.us.ibm.com

I had a similar need, but what I opted to do was attach properties to the
line rather than create editparts for each terminal. Each connection has
two ends and either can be edited when the line is selected.
Previous Topic:How Roles works?
Next Topic:How does ShortestPath routing algorithm work?
Goto Forum:
  


Current Time: Thu Apr 25 02:01:00 GMT 2024

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

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

Back to the top