Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Connection Colors
Connection Colors [message #136298] Fri, 15 June 2007 07:37 Go to next message
Eclipse UserFriend
Hi,

In my diagram I am able to change the prefered line color to set the
polyline connection color in the following way (in class
DiagramRulersAndGridPreferencePage):

PreferenceConverter.setDefault(preferenceStore,IPreferenceCo nstants.PREF_LINE_COLOR,
ColorConstants.red.getRGB());

But the thing is that I want to use diferent colors for the diferent types
of connections which I have in my diagram, so I need to set the color by
the connection type. I'm afraid the main problem with this is the
appearance tab on the properties view, isn't it???

Does any one have tried this?

Thanks in advance.
Re: Connection Colors [message #136315 is a reply to message #136298] Fri, 15 June 2007 07:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: 5d5.mail.ru

You may do it in XXXViewFactory of your connection.

Richy wrote:
> Hi,
> In my diagram I am able to change the prefered line color to set the
> polyline connection color in the following way (in class
> DiagramRulersAndGridPreferencePage):
>
> PreferenceConverter.setDefault(preferenceStore,IPreferenceCo nstants.PREF_LINE_COLOR,
> ColorConstants.red.getRGB());
>
> But the thing is that I want to use diferent colors for the diferent
> types of connections which I have in my diagram, so I need to set the
> color by the connection type. I'm afraid the main problem with this is
> the appearance tab on the properties view, isn't it???
>
> Does any one have tried this?
>
> Thanks in advance.
>
>
Re: Connection Colors [message #136426 is a reply to message #136298] Fri, 15 June 2007 09:41 Go to previous message
Eclipse UserFriend
Richy,

Do you want the user to be able to change the preferred line color of
all your connections using preferences? If so, you will need to add new
preferences for each connection type.

If not, you can set the connection color in the decorateView() method in
the ViewFactory class for each of your connections like this:

LineStyle lineStyle = (LineStyle)
view.getStyle(NotationPackage.Literals.LINE_STYLE);
if (lineStyle != null) {
lineStyle.setLineColor(FigureUtilities.RGBToInteger(myColor)
.intValue());
}

Regards,
Cherie

Richy wrote:
> Hi,
> In my diagram I am able to change the prefered line color to set the
> polyline connection color in the following way (in class
> DiagramRulersAndGridPreferencePage):
>
> PreferenceConverter.setDefault(preferenceStore,IPreferenceCo nstants.PREF_LINE_COLOR,
> ColorConstants.red.getRGB());
>
> But the thing is that I want to use diferent colors for the diferent
> types of connections which I have in my diagram, so I need to set the
> color by the connection type. I'm afraid the main problem with this is
> the appearance tab on the properties view, isn't it???
>
> Does any one have tried this?
>
> Thanks in advance.
>
>
Previous Topic:custom layout
Next Topic:BorderLayout trouble
Goto Forum:
  


Current Time: Fri Jul 18 03:35:21 EDT 2025

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

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

Back to the top