Connection Colors [message #136298] |
Fri, 15 June 2007 07:37  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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.
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.28349 seconds