Draw Vertical Label using draw2d in eclipse plugin
-
14-06-2021 - |
Question
I am doing an Eclipse plugin using gef. Does anybody knows how to draw a vertical label?
Kind Regards, Kyriakos Georgiou
La solution
Check out this thread, at the end of the thread.
Autres conseils
Using ImageUtilities as in the linked post worked well. Here is how to use it in a Label.
@Override
protected void paintFigure(Graphics graphics) {
if (vertical) {
Image image = ImageUtilities.createRotatedImageOfString(getSubStringText(), getFont(), getForegroundColor(), getBackgroundColor());
graphics.drawImage(image, new Point(getTextLocation()).translate(getLocation()));
image.dispose();
} else {
super.paintFigure(graphics);
}
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow