Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Zest Bendpoint
Zest Bendpoint [message #242721] Tue, 06 May 2008 14:07 Go to next message
kent gibson is currently offline kent gibsonFriend
Messages: 114
Registered: July 2009
Senior Member
I need to define a connection with a bendpoint.

How would I do that in Zest?

thanks.
Re: Zest Bendpoint [message #242750 is a reply to message #242721] Wed, 07 May 2008 16:21 Go to previous messageGo to next message
Eclipse UserFriend
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
kent gibson is currently offline kent gibsonFriend
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

}
Previous Topic:Extended Zest Tree Layouts
Next Topic:redo and undo in the GEF multipage editor
Goto Forum:
  


Current Time: Wed Jul 17 13:59:04 GMT 2024

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

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

Back to the top