private void revalidateTextField() { int row = TreeTable.this.editingRow; if (row == -1) { offset = 0; return; } determineOffset(tree.getPathForRow(row).getLastPathComponent(), TreeTable.this.isRowSelected(row), row); ((TreeTableTextField) super.getComponent()).offset = offset; getComponent().setBounds(TreeTable.this.getCellRect(row, getTreeColumnIndex(), false)); }
/** Overridden to manually draw the focused rectangle for the tree column */ @Override public void paintComponent(Graphics g) { super.paintComponent(g); if (hasFocus() && (getSelectedColumn() == 0) && (getSelectedRow() > 0)) { Color bdr = UIManager.getColor("Tree.selectionBorderColor"); //NOI18N if (bdr == null) { //Button focus color doesn't work on win classic - better to //get the color from a value we know will work - Tim if (getForeground().equals(Color.BLACK)) { //typical bdr = getBackground().darker(); } else { bdr = getForeground().darker(); } } g.setColor(bdr); Rectangle r = getCellRect(getSelectedRow(), getSelectedColumn(), false); g.drawRect(r.x + 1, r.y + 1, r.width - 3, r.height - 3); } }
private void revalidateTextField() { int row = TreeTable.this.editingRow; if (row == -1) { offset = 0; return; } determineOffset(tree.getPathForRow(row).getLastPathComponent(), TreeTable.this.isRowSelected(row), row); ((TreeTableTextField)super.getComponent()).offset = offset; getComponent().setBounds(TreeTable.this.getCellRect(row, getTreeColumnIndex(), false)); }
private void revalidateTextField() { int row = TreeTable.this.editingRow; if (row == -1) { offset = 0; return; } determineOffset(tree.getPathForRow(row).getLastPathComponent(), TreeTable.this.isRowSelected(row), row); ((TreeTableTextField)super.getComponent()).offset = offset; getComponent().setBounds(TreeTable.this.getCellRect(row, getTreeColumnIndex(), false)); }
/** Overridden to manually draw the focused rectangle for the tree column */ public void paintComponent(Graphics g) { super.paintComponent(g); if (hasFocus() && getSelectedColumn() == 0 && getSelectedRow() > 0) { Color bdr = UIManager.getColor("Tree.selectionBorderColor"); //NOI18N if (bdr == null) { //Button focus color doesn't work on win classic - better to //get the color from a value we know will work - Tim if (getForeground().equals(Color.BLACK)) { //typical bdr = getBackground().darker(); } else { bdr = getForeground().darker(); } } g.setColor(bdr); Rectangle r = getCellRect (getSelectedRow(), getSelectedColumn(), false); g.drawRect(r.x+1, r.y+1, r.width - 3, r.height - 3); } }
/** Overridden to manually draw the focused rectangle for the tree column */ public void paintComponent(Graphics g) { super.paintComponent(g); if (hasFocus() && getSelectedColumn() == 0 && getSelectedRow() > 0) { Color bdr = UIManager.getColor("Tree.selectionBorderColor"); //NOI18N if (bdr == null) { //Button focus color doesn't work on win classic - better to //get the color from a value we know will work - Tim if (getForeground().equals(Color.BLACK)) { //typical bdr = getBackground().darker(); } else { bdr = getForeground().darker(); } } g.setColor(bdr); Rectangle r = getCellRect (getSelectedRow(), getSelectedColumn(), false); g.drawRect(r.x+1, r.y+1, r.width - 3, r.height - 3); } }
(TreeTable.this.tree, me.getID(), me.getWhen(), me.getModifiers(), me.getX() - getCellRect(0, column, true).x + positionX, me.getY(), me.getClickCount(), me.isPopupTrigger());
(TreeTable.this.tree, me.getID(), me.getWhen(), me.getModifiers(), me.getX() - getCellRect(0, column, true).x + positionX, me.getY(), me.getClickCount(), me.isPopupTrigger());
me.getX() - getCellRect(0, column, true).x + positionX, me.getY(), me.getClickCount(), me.isPopupTrigger() );
/** 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); } }
final Rectangle r = getCellRect(row, column, true);
final Rectangle r = getCellRect (row, column, true);
final Rectangle r = getCellRect (row, column, true);