public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { setupLinkedObjectComponent(table, table.getCellRect(row, column, true)); preferredWidth = table.getParent().getWidth(); componentBeingRendered = table; // Set the size of the table cell // setPreferredWidth(table.getColumnModel().getColumn(column).getWidth()); return prepareRenderer(value, isSelected, hasFocus); }
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { componentBeingRendered = tree; Rectangle cellBounds = new Rectangle(); if (!gettingCellBounds) { gettingCellBounds = true; cellBounds = tree.getRowBounds(row); gettingCellBounds = false; } setupLinkedObjectComponent(tree, cellBounds); preferredWidth = -1; minTextHeight = 12; // textPane.setBorder(BorderFactory.createEmptyBorder(1, 2, 1, 2 + rightMargin)); tree.setToolTipText(value != null ? value.toString() : ""); Component c = prepareRenderer(value, selected, hasFocus); reset(); return c; }
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { componentBeingRendered = tree; Rectangle cellBounds = new Rectangle(); if (!gettingCellBounds) { gettingCellBounds = true; cellBounds = tree.getRowBounds(row); gettingCellBounds = false; } setupLinkedObjectComponent(tree, cellBounds); preferredWidth = -1; minTextHeight = 12; // textPane.setBorder(BorderFactory.createEmptyBorder(1, 2, 1, 2 + rightMargin)); tree.setToolTipText(value != null ? value.toString() : ""); Component c = prepareRenderer(value, selected, hasFocus); reset(); return c; }
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { componentBeingRendered = tree; Rectangle cellBounds = new Rectangle(); if (!gettingCellBounds) { gettingCellBounds = true; cellBounds = tree.getRowBounds(row); gettingCellBounds = false; } setupLinkedObjectComponent(tree, cellBounds); preferredWidth = -1; minTextHeight = 12; // textPane.setBorder(BorderFactory.createEmptyBorder(1, 2, 1, 2 + rightMargin)); tree.setToolTipText(value != null ? value.toString() : ""); Component c = prepareRenderer(value, selected, hasFocus); reset(); return c; }
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { setupLinkedObjectComponent(table, table.getCellRect(row, column, true)); preferredWidth = table.getParent().getWidth(); componentBeingRendered = table; // Set the size of the table cell // setPreferredWidth(table.getColumnModel().getColumn(column).getWidth()); return prepareRenderer(value, isSelected, hasFocus); // // This is a bit messy - the row height doesn't get reset if it is larger than the // // desired row height. // // Reset the row height if the text has been wrapped // int desiredRowHeight = getPrefSize(table, table.getGraphics(), c.getText()).height; // if (desiredRowHeight < table.getRowHeight()) { // desiredRowHeight = table.getRowHeight(); // } // else if (desiredRowHeight > table.getRowHeight(row)) { // // Add a bit of a margin, because wrapped lines // // tend to merge with adjacent lines too much // desiredRowHeight += 4; // } // if (table.getEditingRow() != row) { // if (table.getRowHeight(row) < desiredRowHeight) { // table.setRowHeight(row, desiredRowHeight); // } // } // reset(); // return c; }
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { lock(); try { setupLinkedObjectComponent(table, table.getCellRect(row, column, true)); preferredWidth = table.getParent().getWidth(); componentBeingRendered = table; // Set the size of the table cell return prepareRenderer(value, isSelected, hasFocus); } finally { unlock(); } }
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { setupLinkedObjectComponent(table, table.getCellRect(row, column, true)); preferredWidth = table.getParent().getWidth(); componentBeingRendered = table; // Set the size of the table cell // setPreferredWidth(table.getColumnModel().getColumn(column).getWidth()); return prepareRenderer(value, isSelected, hasFocus); // // This is a bit messy - the row height doesn't get reset if it is larger than the // // desired row height. // // Reset the row height if the text has been wrapped // int desiredRowHeight = getPrefSize(table, table.getGraphics(), c.getText()).height; // if (desiredRowHeight < table.getRowHeight()) { // desiredRowHeight = table.getRowHeight(); // } // else if (desiredRowHeight > table.getRowHeight(row)) { // // Add a bit of a margin, because wrapped lines // // tend to merge with adjacent lines too much // desiredRowHeight += 4; // } // if (table.getEditingRow() != row) { // if (table.getRowHeight(row) < desiredRowHeight) { // table.setRowHeight(row, desiredRowHeight); // } // } // reset(); // return c; }
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { componentBeingRendered = list; Rectangle cellBounds = new Rectangle(); // We need to prevent infinite recursion here! if (!gettingCellBounds) { gettingCellBounds = true; cellBounds = list.getCellBounds(index, index); gettingCellBounds = false; } minTextHeight = 12; if (list.getParent() != null) { preferredWidth = list.getParent().getWidth(); } // preferredWidth = -1; // textPane.setBorder(BorderFactory.createEmptyBorder(1, 2, 1, 2 + rightMargin)); setupLinkedObjectComponent(list, cellBounds); Component c = prepareRenderer(value, isSelected, cellHasFocus); reset(); return c; }
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { componentBeingRendered = list; Rectangle cellBounds = new Rectangle(); // We need to prevent infinite recursion here! if (!gettingCellBounds) { gettingCellBounds = true; cellBounds = list.getCellBounds(index, index); gettingCellBounds = false; } minTextHeight = 12; if (list.getParent() != null) { preferredWidth = list.getParent().getWidth(); } // preferredWidth = -1; // textPane.setBorder(BorderFactory.createEmptyBorder(1, 2, 1, 2 + rightMargin)); setupLinkedObjectComponent(list, cellBounds); Component c = prepareRenderer(value, isSelected, cellHasFocus); reset(); return c; }
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { componentBeingRendered = list; Rectangle cellBounds = new Rectangle(); // We need to prevent infinite recursion here! if (!gettingCellBounds) { gettingCellBounds = true; cellBounds = list.getCellBounds(index, index); gettingCellBounds = false; } minTextHeight = 12; if (list.getParent() != null) { preferredWidth = list.getParent().getWidth(); } // preferredWidth = -1; // textPane.setBorder(BorderFactory.createEmptyBorder(1, 2, 1, 2 + rightMargin)); setupLinkedObjectComponent(list, cellBounds); Component c = prepareRenderer(value, isSelected, cellHasFocus); reset(); return c; }
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { lock(); try { componentBeingRendered = tree; Rectangle cellBounds = new Rectangle(); if (!ignoreLinks) { ignoreLinks = true; save(); try { cellBounds = tree.getRowBounds(row); } finally { restore(); } ignoreLinks = false; } setupLinkedObjectComponent(tree, cellBounds); preferredWidth = -1; minTextHeight = 12; return prepareRenderer(value, selected, hasFocus); } finally { unlock(); } }
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { lock(); try { componentBeingRendered = list; Rectangle cellBounds = new Rectangle(); // We need to prevent infinite recursion here! if (!ignoreLinks) { ignoreLinks = true; save(); try { cellBounds = list.getCellBounds(index, index); } finally { restore(); } ignoreLinks = false; } minTextHeight = 12; if (list.getParent() != null) { preferredWidth = list.getParent().getWidth(); } // preferredWidth = -1; // textPane.setBorder(BorderFactory.createEmptyBorder(1, 2, 1, 2 + // rightMargin)); setupLinkedObjectComponent(list, cellBounds); return prepareRenderer(value, isSelected, cellHasFocus); } finally { unlock(); } }