Logo Search packages:      
Sourcecode: visualvm version File versions  Download package

final Component org::netbeans::lib::profiler::ui::components::table::EnhancedTableCellRenderer::getTableCellRendererComponent ( JTable  table,
Object  value,
boolean  isSelected,
boolean  hasFocus,
int  row,
int  column 
) [inline, inherited]

Returns the default table cell renderer.

Parameters:
table the JTable
value the value to assign to the cell at [row, column]
isSelected true if cell is selected
hasFocus true if cell has focus
row the row of the cell to render
column the column of the cell to render
Returns:
the default table cell renderer

Definition at line 128 of file EnhancedTableCellRenderer.java.

References org::netbeans::lib::profiler::ui::components::table::EnhancedTableCellRenderer::setRowBackground(), org::netbeans::lib::profiler::ui::components::table::EnhancedTableCellRenderer::setRowForeground(), org::netbeans::lib::profiler::ui::components::table::EnhancedTableCellRenderer::setState(), and org::netbeans::lib::profiler::ui::components::table::EnhancedTableCellRenderer::setValue().

Referenced by org::netbeans::lib::profiler::ui::components::table::LabelTableCellRenderer::getTableCellRendererComponentPersistent(), org::netbeans::lib::profiler::ui::components::table::LabelBracketTableCellRenderer::getTableCellRendererComponentPersistent(), and org::netbeans::lib::profiler::ui::components::table::ClassNameTableCellRenderer::getTableCellRendererComponentPersistent().

                                                                              {
        if (supportsFocusBorder) {
            if ((hasFocus) && (isSelected) && (originalBorder != null)) {
                Border focusBorder = BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(UIUtils.getDarkerLine(table
                                                                                                                             .getSelectionBackground(),
                                                                                                                             0.65f)),
                                                                        BorderFactory.createEmptyBorder(originalBorderInsets.top,
                                                                                                        originalBorderInsets.left
                                                                                                        - 1,
                                                                                                        originalBorderInsets.bottom,
                                                                                                        originalBorderInsets.right));
                super.setBorder(focusBorder);
            } else {
                super.setBorder(originalBorder);
            }
        }

        if (isSelected && table.isEnabled()) {
            setRowForeground(table.isFocusOwner() ? table.getSelectionForeground() : UIUtils.getUnfocusedSelectionForeground());
            setRowBackground(table.isFocusOwner() ? table.getSelectionBackground() : UIUtils.getUnfocusedSelectionBackground());
        } else if (!table.isEnabled()) {
            setRowForeground(UIManager.getColor("TextField.inactiveForeground")); // NOI18N
            setRowBackground(UIManager.getColor("TextField.inactiveBackground")); // NOI18N
        } else {
            if ((row & 0x1) == 0) { //even row
                setRowForeground((unselectedForeground != null) ? unselectedForeground : table.getForeground());
                setRowBackground((darkerUnselectedBackground != null) ? darkerUnselectedBackground
                                                                      : UIUtils.getDarker(table.getBackground()));
            } else {
                setRowForeground((unselectedForeground != null) ? unselectedForeground : table.getForeground());
                setRowBackground((unselectedBackground != null) ? unselectedBackground : table.getBackground());
            }
        }

        setState(table, value, isSelected, hasFocus, row, column);
        setValue(table, value, row, column);

        return this;
    }


Generated by  Doxygen 1.6.0   Back to index