本文整理汇总了Java中com.rapidminer.gui.tools.ColoredTableCellRenderer类的典型用法代码示例。如果您正苦于以下问题:Java ColoredTableCellRenderer类的具体用法?Java ColoredTableCellRenderer怎么用?Java ColoredTableCellRenderer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ColoredTableCellRenderer类属于com.rapidminer.gui.tools包,在下文中一共展示了ColoredTableCellRenderer类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makePreviewTable
import com.rapidminer.gui.tools.ColoredTableCellRenderer; //导入依赖的package包/类
/**
* Fills the tablePane with content.
*/
private JComponent makePreviewTable() {
previewTable = new ExtendedJTable(false, false, false);
// ensure same background as JPanels in case of only few rows
previewTable.setBackground(Colors.PANEL_BACKGROUND);
previewTable.setColoredTableCellRenderer(new ColoredTableCellRenderer() {
private final Font boldFont = getFont().deriveFont(Font.BOLD);
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
int row, int column) {
JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
adjustCell(row, label, boldFont);
return label;
}
});
loadingContentPane = new LoadingContentPane("loading_data", previewTable);
tablePane = new JScrollPane(loadingContentPane);
tablePane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
tablePane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
tablePane.setBorder(null);
// add PREVIEW label in front of scrollpane
JLayeredPane layeredPane = new JLayeredPane();
layeredPane.setLayout(new OverlayLayout(layeredPane));
layeredPane.add(tablePane, JLayeredPane.DEFAULT_LAYER);
JPanel overlayPanel = new JPanel(new BorderLayout());
overlayPanel.setOpaque(false);
overlayLabel = new JLabel("", SwingConstants.CENTER);
showPreviewLettering();
overlayPanel.add(overlayLabel, BorderLayout.CENTER);
layeredPane.add(overlayPanel, JLayeredPane.PALETTE_LAYER);
return layeredPane;
}
示例2: getCellRenderer
import com.rapidminer.gui.tools.ColoredTableCellRenderer; //导入依赖的package包/类
/**
* Returns a cell renderer with red background if the model indicates an error in that cell.
* Returns the default cell renderer otherwise.
* @see com.rapidminer.gui.tools.ExtendedJTable#getCellRenderer(int, int)
*/
@Override
public TableCellRenderer getCellRenderer(int row, int col) {
ColoredTableCellRenderer renderer = (ColoredTableCellRenderer)super.getCellRenderer(row, col);
ErrorAwareTableModel model = (ErrorAwareTableModel)((ExtendedJTableSorterModel)getModel()).getTableModel();
if (model.hasError(row, col)) {
renderer.setColor(Color.RED);
}
return renderer;
}