void unlock() { if (!isLocked) { throw new RuntimeException( "Renderer was not locked!"); } reset(); isLocked = false; }
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 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; }