[英]How to visualize a table using Prefuse with typical functions of JTable
My question is: 我的问题是:
To add details about my data: 要添加有关我的数据的详细信息,请执行以下操作:
I have an implementation using JTable in java swing to show a list of documents which each row contains 10 columns showing different variable values associate with this document. 我有一个在Java swing中使用JTable的实现,以显示文档列表,每行包含10列,这些列显示了与此文档关联的不同变量值。 The table structure is not uniform, in a sense that the first two rows show other information, each cell in the first row is a comboBox to do selection and each cell in the second row is a bar chart showing distribution for the variable shown in this column( each bar is a JPanel display with mouse click event enabled).
表的结构是不统一的,从某种意义上说,前两行显示了其他信息,第一行中的每个单元格都是一个comboBox进行选择,第二行中的每个单元格是一个条形图,显示了此变量的分布列(每个栏都是一个启用了鼠标单击事件的JPanel显示)。
Given such table model, I am also not sure how to put the first two rows into Data in prefuse since they are drawn using Graphics2D in java swing. 给定这样的表模型,我也不确定如何将前两行预先放入Data中,因为它们是使用java swing中的Graphics2D绘制的。 The data type(.class) cannot even be specified, right?
甚至不能指定数据类型(.class),对吗?
The data type (
.class
) cannot even be specified, right?甚至无法指定数据类型(
.class
),对吗?
No. As discussed in How to Use Tables , the table model's getColumnClass()
implementation can specify the type of data for each cell as a class literal . 不能。如如何使用表中所述,表模型的
getColumnClass()
实现可以将每个单元格的数据类型指定为类文字 。 The type is one way JTable
uses to select a suitable renderer . 该类型是
JTable
选择合适的渲染器的一种方式。 Icons and small images are a reasonable choice for display in situ , but a ListSelectionListener
can be used to display larger elements in an adjacent component. 图标和小图像是就地显示的合理选择,但是
ListSelectionListener
可以用于在相邻组件中显示较大的元素。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.