Skip to main content



      Home
Home » Eclipse Projects » GEF » How to change the width of connection?
How to change the width of connection? [message #211838] Wed, 15 March 2006 21:22 Go to next message
Eclipse UserFriend
Originally posted by: brandonchen.realtek.com.tw

Can I change the width of the conection line? I want to
let user set the line width while connecting from different
nodes. Appreciated for any reply.

Brandon
Re: How to change the width of connection? [message #211927 is a reply to message #211838] Thu, 16 March 2006 10:04 Go to previous messageGo to next message
Eclipse UserFriend
If you are using the standard PolylineConnection in your connection edit
part, you can override the createFigure() method of the
AbstractConnectionEditPart like the following:

protected IFigure createFigure() {
PolylineConnection conn =
(PolylineConnection) super.createFigure();
conn.setLineWidth(10);
return conn;
}

Hope this helps.


Brandon wrote:
> Can I change the width of the conection line? I want to
> let user set the line width while connecting from different
> nodes. Appreciated for any reply.
>
> Brandon
>
>
Re: How to change the width of XYAnchor connection? [message #211978 is a reply to message #211927] Thu, 16 March 2006 21:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brandonchen.realtek.com.tw

Appreciated for reply.
But if I use XYAnchor to set up a line, how to change the width of XYAnchor
Connection?
I can not find the method that draws the connection from XYAnchor. Where is
the method?
It would be great if I can override that method. Appreciated for any reply.

Brandon


"Scott Hathaway" <scott_hathaway@iwaysoftware.com> ???
news:dvbuut$ksa$1@utils.eclipse.org ???...
> If you are using the standard PolylineConnection in your connection edit
> part, you can override the createFigure() method of the
> AbstractConnectionEditPart like the following:
>
> protected IFigure createFigure() {
> PolylineConnection conn =
> (PolylineConnection) super.createFigure();
> conn.setLineWidth(10);
> return conn;
> }
>
> Hope this helps.
>
>
> Brandon wrote:
> > Can I change the width of the conection line? I want to
> > let user set the line width while connecting from different
> > nodes. Appreciated for any reply.
> >
> > Brandon
> >
> >
Re: How to change the width of XYAnchor connection? [message #212010 is a reply to message #211978] Fri, 17 March 2006 02:17 Go to previous message
Eclipse UserFriend
Originally posted by: brandonchen.realtek.com.tw

Thanks Scott. Your idea just gave me some clues and solved
the problem. Because it helps me to think that the XYAnchor
connection might be also drawn from a PolylinConnection, I
find it is refreshed in AbstractConnectionEditPart # refreshTargetAnchor()

Thus All I have to let myLineEditPart inherits AbstractConnectionEditPart
and overwrites the method like this:

protected void refreshTargetAnchor() {
int width = 5;
if(connection instanceof PolylineConnection){
((PolylineConnection)connection).setLineWidth(width);
}
}

Then the line width is set.

Thanks

Brandon


>
> "Scott Hathaway" <scott_hathaway@iwaysoftware.com> ???
> news:dvbuut$ksa$1@utils.eclipse.org ???...
> > If you are using the standard PolylineConnection in your connection edit
> > part, you can override the createFigure() method of the
> > AbstractConnectionEditPart like the following:
> >
> > protected IFigure createFigure() {
> > PolylineConnection conn =
> > (PolylineConnection) super.createFigure();
> > conn.setLineWidth(10);
> > return conn;
> > }
> >
> > Hope this helps.
> >
> >
> > Brandon wrote:
> > > Can I change the width of the conection line? I want to
> > > let user set the line width while connecting from different
> > > nodes. Appreciated for any reply.
> > >
> > > Brandon
> > >
> > >
>
>
Previous Topic:Serial Version InvalidClassException
Next Topic:How to draw a line?
Goto Forum:
  


Current Time: Sun Jul 06 13:35:32 EDT 2025

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

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

Back to the top