Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Dashed Connections
Dashed Connections [message #660471] Fri, 18 March 2011 14:53 Go to next message
Ali is currently offline AliFriend
Messages: 18
Registered: July 2009
Junior Member
Hi,

I would like to create dashed connection:

I can create my dashed connection with the code below and it works fine:

IGaService gaService = Graphiti.getGaService();
Polyline polyline = gaService.createPolyline(connection);
polyline.setLineWidth(2);
polyline.setForeground(manageColor(IColorConstant.BLACK));
polyline.setLineStyle(LineStyle.DASH);

But, if I create a style and then set the style on the polyline as shown
below, it doesn't work:

IGaService gaService = Graphiti.getGaService();
dashedStyle = gaService.createStyle(diagram, styleId);
dashedStyle.setLineStyle(LineStyle.DASH);
dashedStyle.setLineWidth(2);
dashedStyle.setForeground(gaService.manageColor(diagram,ICol orConstant.BLACK));

polyline.setStyle(dashedStyle);

Do I miss something ??

Thank you in advance,
Ali
Re: Dashed Connections [message #660703 is a reply to message #660471] Mon, 21 March 2011 09:45 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
This appears to be a bug. In order for the Graphiti framework to use the
line style set at the style object, the value at the GA needs to be
LineStyle.UNSPECIFIED. Since this is not set as default for the attribute at
AbstractStyle, the framework uses SOLID (0, standard default value). As a
workaround you may set the value at the Polyline explicitly to UNSPECIFIED.

Could you please open a bugzilla to track this? Thanks!

Michael


"Ali" wrote in message news:ilvr3m$q9g$1@news.eclipse.org...

Hi,

I would like to create dashed connection:

I can create my dashed connection with the code below and it works fine:

IGaService gaService = Graphiti.getGaService();
Polyline polyline = gaService.createPolyline(connection);
polyline.setLineWidth(2);
polyline.setForeground(manageColor(IColorConstant.BLACK));
polyline.setLineStyle(LineStyle.DASH);

But, if I create a style and then set the style on the polyline as shown
below, it doesn't work:

IGaService gaService = Graphiti.getGaService();
dashedStyle = gaService.createStyle(diagram, styleId);
dashedStyle.setLineStyle(LineStyle.DASH);
dashedStyle.setLineWidth(2);
dashedStyle.setForeground(gaService.manageColor(diagram,ICol orConstant.BLACK));

polyline.setStyle(dashedStyle);

Do I miss something ??

Thank you in advance,
Ali
Re: Dashed Connections [message #661053 is a reply to message #660703] Tue, 22 March 2011 22:43 Go to previous message
Ali is currently offline AliFriend
Messages: 18
Registered: July 2009
Junior Member
Le 21/03/2011 10:45, Michael Wenz a écrit :
> This appears to be a bug. In order for the Graphiti framework to use the
> line style set at the style object, the value at the GA needs to be
> LineStyle.UNSPECIFIED. Since this is not set as default for the
> attribute at AbstractStyle, the framework uses SOLID (0, standard
> default value). As a workaround you may set the value at the Polyline
> explicitly to UNSPECIFIED.
>
> Could you please open a bugzilla to track this? Thanks!
>
> Michael
>
>
> "Ali" wrote in message news:ilvr3m$q9g$1@news.eclipse.org...
Hi again,

I Opened a bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=340712

Ali

>
> Hi,
>
> I would like to create dashed connection:
>
> I can create my dashed connection with the code below and it works fine:
>
> IGaService gaService = Graphiti.getGaService();
> Polyline polyline = gaService.createPolyline(connection);
> polyline.setLineWidth(2);
> polyline.setForeground(manageColor(IColorConstant.BLACK));
> polyline.setLineStyle(LineStyle.DASH);
>
> But, if I create a style and then set the style on the polyline as shown
> below, it doesn't work:
>
> IGaService gaService = Graphiti.getGaService();
> dashedStyle = gaService.createStyle(diagram, styleId);
> dashedStyle.setLineStyle(LineStyle.DASH);
> dashedStyle.setLineWidth(2);
> dashedStyle.setForeground(gaService.manageColor(diagram,ICol orConstant.BLACK));
>
>
> polyline.setStyle(dashedStyle);
>
> Do I miss something ??
>
> Thank you in advance,
> Ali
Previous Topic:how to proceed with Graphiti
Next Topic:how to create a circle in Graphiti
Goto Forum:
  


Current Time: Fri Apr 26 12:33:18 GMT 2024

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

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

Back to the top