How to change the width of connection? [message #211838] |
Thu, 16 March 2006 02:22 |
Eclipse User |
|
|
|
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 XYAnchor connection? [message #211978 is a reply to message #211927] |
Fri, 17 March 2006 02:49 |
Eclipse User |
|
|
|
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 07:17 |
Eclipse User |
|
|
|
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
> > >
> > >
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03148 seconds