Skip to main content



      Home
Home » Eclipse Projects » GEF » Connection and it's Labels
Connection and it's Labels [message #54881] Tue, 14 January 2003 10:10 Go to next message
Eclipse UserFriend
I want to create a Connection with "floating" labels. The "floating" means
that I can place the label anywhere. I think that for this feature it is
better to use XYLayout because I can specify bounds of the label. But now
there is a problem with decorations of the Connection (for example arrow).
Because the decorations expect DelegatingLayout or antoher layout which uses
Locators as constraints.

Is it some better solution or I must to implement my own heterogenous layout
which accept both types of constraints?

Which EditPolices for which roles do I have to install for
ConnectionEditPart and for LabelEditPart?

Thanks.
<*.bosy>
Re: Connection and it's Labels [message #55043 is a reply to message #54881] Wed, 15 January 2003 04:13 Go to previous message
Eclipse UserFriend
I've just completed an implemention of this. I'm quite new to GEF so I may
have made it a bit complicated.

From the users perspective it is a connection having a label that is
initially centered at its midpoint. Clicking the label selects the
connection line. Dragging it changes its position. It is not possible to
select the label itself. The label placement is relative to the connection
midpoint, so that it will follow the connection if it is moved.

I have implemented is as a AbstractConnectionEditPart subclass with a sub
edit part for the label that is an AbstractGraphicalEditPart subclass.
The connection edit part has an edit policy (AbstractEditPolicy subclass)
that creates a command for setting a new label position.
The label part has a getDragTracker method that returns a variant of the
DragEditPartsTracker that is default for all graphical editparts. My tracker
makes clicks go to the parent connection edit part, and draggs only this
label part and not all selected parts as the defalt tracker does.
For the presentation i use the standard PolyLineConnection and Label
classes, with the label positioned by a variant of MidpointLocator that has
an settable offset from the midpoint.

If you have a simpler solution I am interested.

Regards,
Dag Rende

"Roman Bos
Previous Topic:Old Palette looked better
Next Topic:Logic Example I20030114 is broken under Linux
Goto Forum:
  


Current Time: Wed May 07 19:38:15 EDT 2025

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

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

Back to the top