2 nattable中树根的图像 [英] 2 Image in root of tree in nattable

查看:140
本文介绍了2 nattable中树根的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在其中一列中的树体中插入了一张图片

I have inserted one image in the tree body in one of my columns with

 new TreeImagePainter(true, GUIHelper.getImage("right"), GUIHelper.getImage("right_down"), image);

在类TreeConfiguration中,但是我需要在根行旁边再添加一个图像.

in class TreeConfiguration, but I need to add one more image beside root rows.

此外,我需要从其他已经读取数据的类中动态获取此图像.事实证明,我不能因为该类为null或它的调用时间晚于其应有的时间.你能告诉我该怎么做.

Moreover I need to dynamicly obtain this image from some other class, where data is already read . As it turns out i can't because either this class is null or it is called later than it should. Could you guild me how to do that.

亲切的问候

推荐答案

带有结点图标等的树形结构的绘制由IndentedTreeImagePainter完成. TreeImagePainter用作内容(通常是文本)的基础绘画的修饰器.如果需要其他图标,则需要用另一个CellPainterDecorator包装IndentedTreeImagePainter. 或者,如果其他图标应位于树形图标的右侧,则基础绘画者可能已经是将ImagePainterTextPainter结合在一起的CellPainterDecorator.

The painting of the tree structure with node icons etc. is done by the IndentedTreeImagePainter. The TreeImagePainter is used as a decorator to the base painter for the content (typically text). If you need an additional icon you need to wrap the IndentedTreeImagePainter with another CellPainterDecorator. Or in case the additional icon should be on the right of the tree icon, maybe the base painter can already be a CellPainterDecorator that combines both, an ImagePainter and a TextPainter.

如果只想在根节点上显示该图标,则可能需要使用自定义绘画工具进行更多自定义.

If you only want to show that icon on root nodes, you will need some more customization, probably with a custom painter.

对不起,我不太了解您的要求.

Sorry, I don't really understand your requirement.

这篇关于2 nattable中树根的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆