Java Reference
In-Depth Information
public
Point getLocation(Point reference) {
Point right =
getOwner().getBounds().getBottomRight();
Point p =
new
PrecisionPoint(right.x + 1, right.y - 1);
getOwner().translateToAbsolute(p);
return
p;
}
}
public class
TargetFixedConnectionAnchor
extends
AbstractConnectionAnchor {
public
TargetFixedConnectionAnchor(IFigure owner) {
super
(owner);
}
public
Point getLocation(Point reference) {
Point left = getOwner().getBounds().getBottomLeft();
Point p =
new
PrecisionPoint(left.x + 10, left.y - 1);
getOwner().translateToAbsolute(p);
return
p;
}
}
Figure 4-11 shows an updated image of our mindmap that, again, uses our
default layout. Clearly, this is an improvement, but we still have some tweaking
to do. Note that although the left-to-right anchor and layout have been imple-
mented, we need to modify the implementation if we are to support right-to-left
layout as well.
A SubSubtopic
A Subtopic
Another SubSubtopic
Topic
Another Subtopic
Yet Another
Figure 4-11
Mindmap fixed anchors
Search WWH ::
Custom Search