Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [gef-dev] Connection not touching figure.

You need to connect the connection to the inner figure.

One way to do this is to create your own Anchor type (try sub-classing
ChopBoxAnchor). Override the getLocation method to connect to the bounds
of the inner figure (the figure is passed as part of the constructor).
The getLocation method just allows you to specify the point at which
the connection is attached to your figure.

You may also want to control how it connects, for example only left, top
or right connections, but not bottom or it will obscure the text.

Fergal.

Michael MacFadden wrote:

All,

I am having a small but painful problem with GEF. I have created some custom figures. One of them has an icon with some text below it. Looks something like this

      _____
     |          |
     |_____|
Some Text Here

The bounds of the figure is a rectangle around the whole thing, encompassing the icon and the text label. The problem is when I have a connection attach to the figure that is coming off the left or right of the object the connection stops at the rectangular bounds of the object. I would like the arrow to be drawn all the way to where it actually hits some part of the figure that is actually being drawn. I guess I should mention that for selection purposes I need to keep the bounds a rectangle around the whole object. Any ideas on how I would do this? Thanks.

Mike




Back to the top