Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Draw2D PolylineConnection
Draw2D PolylineConnection [message #226815] Thu, 23 November 2006 16:52 Go to next message
Eclipse UserFriend
Originally posted by: ben00ze.gmail.com

Sorry for have posted this thread in the wrong newsgroup, I hope it's the
right one now.

Hi all,

I have a question about PolyLineConnection


I made a class named SystemeFigure in which I can added some kind of
Rectangle.
In the class named SystemeFigure, I added a MouseMotion listener which
allow me to move the RectangleSysteme selected and this works well.
But I also tried to add a PolyLineConnection when a button is enabled.

public class SystemeFigure extends Figure {
.....

new MouseMotionListener() {
.....
public void mouseDragged(MouseEvent me) {
if ( me.getSource() instanceof RectangleSysteme){
((RectangleSysteme)me.getSource()).setLocation(me.getLocatio n());
}
}

}


new MouseListener() {
public void mousePressed(MouseEvent me) {
PolylineConnection c = new PolylineConnection();
ChopboxAnchor sourceAnchor = new ChopboxAnchor(source);
ChopboxAnchor targetAnchor = new
ChopboxAnchor(((RectangleSysteme)me.getSource()));
c.setSourceAnchor(sourceAnchor);
c.setTargetAnchor(targetAnchor);
add(c);
}

}




private class RectangleSysteme extends RectangleFigure
{
.....

public void setLocation(Point p)
{
super.setLocation(p);
.... // some stuff to do
}
}




But when I add the PolyLineConnection, my RectangleSysteme go to their
first position, and it's impossible to move them again.

Someone can help me please ?


ps : sorry for my english
Re: Draw2D PolylineConnection [message #226840 is a reply to message #226815] Thu, 23 November 2006 21:02 Go to previous message
Eclipse UserFriend
Originally posted by: spider_a.freenet.am

Please open your thread here http://www.javalobby.org/java/forums/c5601.html, and write whole code, that you've created.
Previous Topic:what are the steps to track mouse event in GEF?
Next Topic:XYLayout problem.
Goto Forum:
  


Current Time: Fri Apr 19 01:39:04 GMT 2024

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

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

Back to the top