I found a way to hide/show the grid in the diagram editor but I am wondering if there is a way to change it's color. Does anybody know how to achieve this?
Hernan Gonzalez Messages: 148 Registered: October 2010 Location: Buenos Aires, Argentina
Senior Member
It seems that is deeply hardcoded in class
org.eclipse.graphiti.internal.util.DefaultLook
Actually, there is a LookManager that is oriented (I guess)
to support some pluggable "Looks" but
1) The LookManager is "internal" (not intended to be accessed by client code)
2) The LookManager methods are accesed statically and it does not support pluggin other looks
3) The DefaultLook look itself does not take its values (eg colors) from some configuration or properties file, but from hardcoded strings.
4) The ILook properties (few) are not very clear to me, for example, for example, i'm not sure about how these Major/MinorGridLineDistance relate with the Diagram gridUnit, etc
So I at least managed to change the minor grid color with the below lines...
IColorConstant cc = ...
GraphicsAlgorithm ga = myDiagram.getGraphicsAlgorithm();
ga.setForeground(GraphitiUi.getGaService().manageColor(myDiagram, cc));
But going this way you loose the major line color it seams and that looks not as good as the initial style.