/** Repaint the selected row */ private void repaintSelection(boolean focused) { int start = getSelectionModel().getMinSelectionIndex(); int end = getSelectionModel().getMaxSelectionIndex(); if (end != -1) { if (end != start) { Rectangle begin = getCellRect(start, 0, false); Rectangle r = getCellRect(end, 0, false); r.y =begin.y; r.x = 0; r.width = getWidth(); r.height = r.y + r.height - begin.y; repaint (r.x, r.y, r.width, r.height); } else { Rectangle r = getCellRect(start, 0, false); r.width = getWidth(); r.x = 0; repaint (r.x, r.y, r.width, r.height); } } if (isEditing() && editorComp != null) { editorComp.setBackground(focused ? getSelectionBackground() : getUnfocusedSelectedBackground()); editorComp.setForeground(focused ? getSelectionForeground() : getUnfocusedSelectedForeground()); } }
/** Repaint the selected row */ private void repaintSelection(boolean focused) { int start = getSelectionModel().getMinSelectionIndex(); int end = getSelectionModel().getMaxSelectionIndex(); if (end != -1) { if (end != start) { Rectangle begin = getCellRect(start, 0, false); Rectangle r = getCellRect(end, 0, false); r.y =begin.y; r.x = 0; r.width = getWidth(); r.height = r.y + r.height - begin.y; repaint (r.x, r.y, r.width, r.height); } else { Rectangle r = getCellRect(start, 0, false); r.width = getWidth(); r.x = 0; repaint (r.x, r.y, r.width, r.height); } } if (isEditing() && editorComp != null) { editorComp.setBackground(focused ? getSelectionBackground() : getUnfocusedSelectedBackground()); editorComp.setForeground(focused ? getSelectionForeground() : getUnfocusedSelectedForeground()); } }
/** Repaint the selected row */ private void repaintSelection(boolean focused) { if (Children.MUTEX.isReadAccess() || Children.MUTEX.isWriteAccess()) { int start = getSelectionModel().getMinSelectionIndex(); int end = getSelectionModel().getMaxSelectionIndex(); if (end != -1) { if (end != start) { Rectangle begin = getCellRect(start, 0, false); Rectangle r = getCellRect(end, 0, false); r.y = begin.y; r.x = 0; r.width = getWidth(); r.height = (r.y + r.height) - begin.y; repaint(r.x, r.y, r.width, r.height); } else { Rectangle r = getCellRect(start, 0, false); r.width = getWidth(); r.x = 0; repaint(r.x, r.y, r.width, r.height); } } if (isEditing() && (editorComp != null)) { editorComp.setBackground(focused ? getSelectionBackground() : getUnfocusedSelectedBackground()); editorComp.setForeground(focused ? getSelectionForeground() : getUnfocusedSelectedForeground()); } } else { new GuardedActions(3, focused); } }