How DDiagram Element can hold color if coloring done Programatically . [message #1809959] |
Fri, 26 July 2019 09:28  |
Eclipse User |
|
|
|
Hii
I have applied color for some DDiagram element programtaically through services .Again when I create new DDiagram elemnt the color what I have done Previous is setting to default. can anyone Please give me suggestion
Ex: By default Man color is of Gray from design.Programatically I have given man color to green. again when i create man type it is setting previous one (which is in green ) also to gray.
Color local_color = new Color(Display.getCurrent(), 255, 0, 0);
RGB local_rgb= local_color.getRGB();
//RGB rgb= new RGB(255, 225, 135);
final UserFixedColor newColor = DescriptionFactory.eINSTANCE.createUserFixedColor();
newColor.setName(Messages.AnonymousUserFixedColorName);
newColor.setBlue(local_rgb.blue);
newColor.setGreen(local_rgb.green);
newColor.setRed(local_rgb.red);
//EdgeStyle ownedstyle = ((DEdgeSpec) from).getOwnedStyle();
//ownedstyle.setStrokeColor(new RGBValuesProvider().getRGBValues(newColor));
((FlatContainerStyleImpl) local_style).setForegroundColor(new RGBValuesProvider().getRGBValues(newColor));
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.26745 seconds