重新对齐 Eclipse Draw2D 标签中的文本

发布于 2024-08-23 01:51:50 字数 98 浏览 5 评论 0原文

我正在使用 Draw2D 标签(带文本的图形)构建基于 RCP 的应用程序。当我的图形编辑器重新调整标签大小时,文本保留在其初始位置。无论如何,是否可以根据标签的新约束重新定位文本?

I am building an RCP-based application with Draw2D Labels (Figures with text). When my graphical editor re-sizes the label, the text stays in it's initial position. Is there anyway to have the text reposition based on the new constraints of the label?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

锦爱 2024-08-30 01:51:50

事实证明,您只需要使用 setConstriants(IFigure Parent, 矩形边界) 方法来设置位于父图窗顶部的标签的边界。

It turns out you just need to use the setConstriants(IFigure parent, Rectangle bounds) method to set the bounds of the label that is residing on top of the parent figure.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文