Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » RenderedMapModeGraphics has not implemented graphics rotate function
RenderedMapModeGraphics has not implemented graphics rotate function [message #1780062] Wed, 17 January 2018 03:00
lee lucky is currently offline lee luckyFriend
Messages: 23
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

Previous Topic:How to Apply a Search Filter in GMF tool palette
Next Topic:Not able to modify model
Goto Forum:
  


Current Time: Mon Oct 15 14:36:15 GMT 2018

Powered by FUDForum. Page generated in 0.01851 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top