RenderedMapModeGraphics has not implemented graphics rotate function [message #1780062] |
Wed, 17 January 2018 03:00 |
lee lucky Messages: 26 Registered: October 2017 |
Junior Member |
|
|
Hi, guys:
I have met with a strange problem, an exception said:
java.lang.RuntimeException: The class: class org.eclipse.gmf.runtime.draw2d.ui.render.internal.graphics.RenderedMapModeGraphics has not implemented this new graphics function
at org.eclipse.draw2d.Graphics.throwNotImplemented(Graphics.java:1228)
at org.eclipse.draw2d.Graphics.rotate(Graphics.java:926)
.......
I checked the API of Draw2d.graphics, [u]http://help.eclipse.org/neon/ntopic/org.eclipse.draw2d.doc.isv/reference/api/org/eclipse/draw2d/Graphics.html[/u],
and the rotate function is not implememented, while SWTGraphics implements the rotate function.
Can I have the way to use the rotate function in RenderedMapModeGraphics class?
or must implement the rotate function? How can I use SWTGraphics's rotate function in RenderedMapModeGraphics class? Is it possible?
Here are my codes:
@Override
public void paintFigure(Graphics graphics) {
Rectangle bounds = this.getBounds();
float x = bounds.x;
float y = bounds.y;
float width = bounds.width;
float height = bounds.height;
if (x > 0) {
graphics.pushState();
graphics.translate(x, (float) (y - 0.5 * width + 0.5 * height));
graphics.rotate(-90);
graphics.translate(-x, (float) -(y - 0.5 * width + 0.5 * height));
graphics.popState();
super.paintFigure(graphics);
}else{
super.paintFigure(graphics);
}
}
Thanks in advance. Any help is greatfull.
[Updated on: Wed, 17 January 2018 05:59] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02864 seconds