在eclipse插件中使用draw2d绘制垂直标签

时间:2012-06-12 13:22:06

标签: eclipse eclipse-plugin eclipse-rcp draw2d

我正在使用gef做一个Eclipse插件。有谁知道怎么画 垂直标签?

亲切的问候, Kyriakos Georgiou

2 个答案:

答案 0 :(得分:1)

在帖子的末尾查看this个帖子。

答案 1 :(得分:1)

在链接帖子中使用ImageUtilities效果很好。以下是如何在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);
    }
}