|
Re: Zest Bendpoint [message #242750 is a reply to message #242721] |
Wed, 07 May 2008 16:21 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: irbull.cs.uvic.ca
We currently don't have bendpoints, but I think this is an easy fix.
Let me investigate a bit.
cheers,
ian
kentusha wrote:
> I need to define a connection with a bendpoint.
>
> How would I do that in Zest?
>
> thanks.
>
|
|
|
Re: Zest Bendpoint [message #242755 is a reply to message #242750] |
Wed, 07 May 2008 16:40 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
kent gibson![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=kentgibson%40yahoo.com) Messages: 114 Registered: July 2009 |
Senior Member |
|
|
I got it to work by modifying createTreeGraph in SimpleSWTExample.
The new method looks like this:
private void createTreeGraph(int maxLevels, int maxChildren, boolean
random) {
entities = new ArrayList();
relationships = new ArrayList();
SimpleNode root = createSimpleNode("root", 0, 0);
entities.add(root);
SimpleNode root2 = createSimpleNode("root2", 50, 50);
entities.add(root2);
SimpleNode root3 = createSimpleNode("root3", 100, 100);
entities.add(root3);
// ccallendar - adding relationships from the parent to the 2 roots
SimpleRelationship rel = new SimpleRelationship(root, root2, false);
root.addRelationship(rel);
root2.addRelationship(rel);
relationships.add(rel);
rel = new SimpleRelationship(root3, root2, false);
root2.addRelationship(rel);
root3.addRelationship(rel);
BendPoint one = new BendPoint(root2.getX() + root2.getWidth(), root2
getY()
+ (root2.getHeight() / 2.0));
BendPoint two = new BendPoint(root3.getX() + (root3.getWidth() / 2.0),
root2.getY() + (root2.getHeight() / 2.0));
BendPoint three = new BendPoint(
root3.getX() + (root3.getWidth() / 2.0), root3.getY());
rel.setBendPoints(new BendPoint[] { one, two, three });
relationships.add(rel);
// end
}
|
|
|
Powered by
FUDForum. Page generated in 0.03735 seconds