use of org.knime.core.node.tableview.TableContentView in project knime-core by knime.
the class RankCorrelationComputeNodeView method changeRenderer.
private void changeRenderer(final String renderer) {
TableContentView tcv = m_tableView.getContentTable();
tcv.changeRenderer(DoubleCell.TYPE, renderer);
Component c = m_tableView.getCorner(ScrollPaneConstants.UPPER_LEFT_CORNER);
LegendCornerAll cornerRenderer = null;
if (c instanceof JTableHeader) {
JTableHeader corner = (JTableHeader) c;
TableCellRenderer ren = corner.getDefaultRenderer();
if (ren instanceof LegendCornerAll) {
cornerRenderer = (LegendCornerAll) ren;
}
}
if (cornerRenderer != null) {
if (renderer.equals(ColorRender.DESCRIPTION)) {
cornerRenderer.setPaintLegend(true);
// no need to set column header height, done by label UI
tcv.setColumnWidth(15);
TableCellRenderer r = m_tableView.getContentTable().getTableHeader().getDefaultRenderer();
if (r instanceof JLabel) {
((JLabel) r).setUI(new VerticalLabelUI());
}
} else {
cornerRenderer.setPaintLegend(false);
m_tableView.setColumnHeaderViewHeight(16);
tcv.setColumnWidth(75);
TableCellRenderer r = m_tableView.getContentTable().getTableHeader().getDefaultRenderer();
if (r instanceof JLabel) {
((JLabel) r).updateUI();
}
}
}
m_currentRendererID = renderer;
}
use of org.knime.core.node.tableview.TableContentView in project knime-core by knime.
the class TableNodeView method updateTitle.
/**
* Updates the title of the frame. It prints: "Table (#rows[+] x #cols)". It
* is invoked each time new rows are inserted (user scrolls down).
*/
protected void updateTitle() {
final TableContentView view = m_tableView.getContentTable();
TableContentModel model = view.getContentModel();
StringBuffer title = new StringBuffer();
if (model.hasData()) {
String tableName = model.getTableName();
if (!tableName.equals("default")) {
title.append(" \"");
title.append(tableName);
title.append("\"");
}
title.append(" (");
int rowCount = model.getRowCount();
boolean isFinal = model.isRowCountFinal();
title.append(rowCount);
title.append(isFinal ? " x " : "+ x ");
title.append(model.getColumnCount());
title.append(")");
} else {
title.append(" <no data>");
}
super.setViewTitleSuffix(title.toString());
}
use of org.knime.core.node.tableview.TableContentView in project knime-core by knime.
the class AbstractCorrelationComputeNodeView method changeRenderer.
/**
* @param renderer the table's new renderer
*/
protected void changeRenderer(final String renderer) {
TableContentView tcv = m_tableView.getContentTable();
tcv.changeRenderer(DoubleCell.TYPE, renderer);
Component c = m_tableView.getCorner(ScrollPaneConstants.UPPER_LEFT_CORNER);
LegendCornerAll cornerRenderer = null;
if (c instanceof JTableHeader) {
JTableHeader corner = (JTableHeader) c;
TableCellRenderer ren = corner.getDefaultRenderer();
if (ren instanceof LegendCornerAll) {
cornerRenderer = (LegendCornerAll) ren;
}
}
if (cornerRenderer != null) {
if (renderer.equals(ColorRender.DESCRIPTION)) {
cornerRenderer.setPaintLegend(true);
// no need to set column header height, done by label UI
tcv.setColumnWidth(15);
TableCellRenderer r = m_tableView.getContentTable().getTableHeader().getDefaultRenderer();
if (r instanceof JLabel) {
((JLabel) r).setUI(new VerticalLabelUI());
}
m_tableView.setColumnHeaderViewHeight(-1);
} else {
cornerRenderer.setPaintLegend(false);
m_tableView.setColumnHeaderViewHeight(16);
tcv.setColumnWidth(75);
TableCellRenderer r = m_tableView.getContentTable().getTableHeader().getDefaultRenderer();
if (r instanceof JLabel) {
((JLabel) r).updateUI();
}
}
}
m_currentRendererID = renderer;
}
use of org.knime.core.node.tableview.TableContentView in project knime-core by knime.
the class PMCCNodeView method changeRenderer.
private void changeRenderer(final String renderer) {
TableContentView tcv = m_tableView.getContentTable();
tcv.changeRenderer(DoubleCell.TYPE, renderer);
Component c = m_tableView.getCorner(JScrollPane.UPPER_LEFT_CORNER);
LegendCornerAll cornerRenderer = null;
if (c instanceof JTableHeader) {
JTableHeader corner = (JTableHeader) c;
TableCellRenderer ren = corner.getDefaultRenderer();
if (ren instanceof LegendCornerAll) {
cornerRenderer = (LegendCornerAll) ren;
}
}
if (cornerRenderer != null) {
if (renderer.equals(ColorRender.DESCRIPTION)) {
cornerRenderer.setPaintLegend(true);
// no need to set column header height, done by label UI
tcv.setColumnWidth(15);
TableCellRenderer r = m_tableView.getContentTable().getTableHeader().getDefaultRenderer();
if (r instanceof JLabel) {
((JLabel) r).setUI(new VerticalLabelUI());
}
} else {
cornerRenderer.setPaintLegend(false);
m_tableView.setColumnHeaderViewHeight(16);
tcv.setColumnWidth(75);
TableCellRenderer r = m_tableView.getContentTable().getTableHeader().getDefaultRenderer();
if (r instanceof JLabel) {
((JLabel) r).updateUI();
}
}
}
m_currentRendererID = renderer;
}
Aggregations