Skip to main content



      Home
Home » Eclipse Projects » GEF » Connection Anchor
Connection Anchor [message #64277] Tue, 11 February 2003 16:12 Go to next message
Eclipse UserFriend
Originally posted by: oro7d3.netscape.net

Hi,

Is it possible to implement a connection anchor so that the connection
actually points to something inside the figure. For example, can I implement
a connection anchor so that the connection points to the letter "b" in the
words "label" inside the Logic Label. I don't want the connection to end at
the bound of the LogicLabel, I want it to point to letter "b".

Thank you.
Re: Connection Anchor [message #64440 is a reply to message #64277] Wed, 12 February 2003 07:41 Go to previous message
Eclipse UserFriend
Originally posted by: scheglov_ke.nlmk.ru

> Is it possible to implement a connection anchor so that the connection
> actually points to something inside the figure. For example, can I implement
> a connection anchor so that the connection points to the letter "b" in the
> words "label" inside the Logic Label. I don't want the connection to end at
> the bound of the LogicLabel, I want it to point to letter "b".
Why not? Create your own anchor. Here is simple example.
package ru.nlmk.eclipse.plugins.profiler.views.threadCallGraph;
import org.eclipse.draw2d.AbstractConnectionAnchor;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
/**
* @author scheglov_ke
*/
public class LeftCenterPointOfRectangleAnchor extends
AbstractConnectionAnchor {
public Point getLocation(Point reference) {
Rectangle r = Rectangle.SINGLETON;
r.setBounds(getOwner().getBounds());
getOwner().translateToAbsolute(r);
Point p = r.getCenter();
p.x = r.x;
p.x -= 4;
return p;
}
}
Previous Topic:draw2d TextExample.java
Next Topic:Moving TreeItems
Goto Forum:
  


Current Time: Thu May 08 09:04:04 EDT 2025

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

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

Back to the top