How to Manually Update Graphiti RulerFigure [message #1736723] |
Fri, 01 July 2016 06:21  |
Eclipse User |
|
|
|
Hi Guys,
Is there a way to update manually/pragmatically the RulerFigure of the diagram when there is changes in the underlying EObject?
I have created a EMF based application and used Graphiti for my graphical editor. I have implemented custom units for the rulers in my graphical editor. I need to update the ruler based on the new units specified on the underlying EObject.
Is there a way to trigger the updates on RulerFigure?
Many Thanks,
Ken
|
|
|
Re: How to Manually Update Graphiti RulerFigure [message #1737130 is a reply to message #1736723] |
Tue, 05 July 2016 22:14  |
Eclipse User |
|
|
|
Hi All,
I have a work around in my problem. In the extended RulerComposite and use it in my GraphicalEditor. Inside the RulerComposite create a public method that contains the following:
public void updateRulers() {
setRuler((RulerProvider) diagramViewer.getProperty(RulerProvider.PROPERTY_HORIZONTAL_RULER), PositionConstants.NORTH);
setRuler((RulerProvider) diagramViewer.getProperty(RulerProvider.PROPERTY_VERTICAL_RULER), PositionConstants.WEST);
}
With this, we can call and trigger the updates on ruler whenever we want it.
If there is another way, please do tell in this thread.
Thanks,
Ken
|
|
|
Powered by
FUDForum. Page generated in 0.02929 seconds