0

我找不到在 Roassal 可视化中获取垂直标签的方法。有办法吗?还是旋转元素的一般方法?

垂直标签

4

2 回答 2

2

Currently, Roassal does not support such a feature. However you can get something close to.

| view |
view := ROView new.
-15 to: 10 do: [ :i |
    view add: ((ROLabel verticalText interlineSpace: i) elementOn: 'hello world').
].
ROHorizontalLineLayout on: view elements.
view open

In Roassal 1.422

于 2013-09-01T15:48:53.360 回答
2

新版本 Roassal2 确实支持旋转标签。在上面的示例中,现在您可以执行以下操作:

| view |
view := RTView new.
-15 to: 10 do: [ :i |
    view add: ((RTRotatedLabel new angleInDegree: -90) elementOn: 'hello world').
].
RTHorizontalLineLayout on: view elements.
view open

你会得到:

在此处输入图像描述

另一个例子:

| v shape |
v := RTView new.
shape := RTRotatedLabel new.
shape angleInDegree: [ :cls | cls numberOfMethods negated / 1.5 ].
shape text: [ :cls | ' ', cls name ].
shape color: (Color black alpha: 0.2).
v addAll: (shape elementsOn: Collection withAllSubclasses).

v canvas color: Color white.
v open

你将会有:

在此处输入图像描述

我希望它有帮助:-)

于 2014-04-08T18:26:22.017 回答