/** * Lazily creates a string renderer */ private StringRenderer stringRenderer() { if (stringRenderer == null) { stringRenderer = new StringRenderer(tableUI); //Mainly for debugging ((JComponent) stringRenderer).setName("StringRenderer for " + getClass().getName() + "@" + System.identityHashCode(this)); //NOI18N } return stringRenderer; }
public void paint(Graphics g) { if (editor != null) { setEnabled(PropUtils.checkEnabled(this, editor, env)); setForeground(PropUtils.getErrorColor()); delegatedPaint(g); } else { String htmlDisplayValue = (env == null) ? null : String text = htmlValueUsed ? htmlDisplayValue : getText(); text = makeDisplayble( text, getFont() ); lbl.setFont(getFont()); lbl.setEnabled(isEnabled()); lbl.setIcon(getIcon()); lbl.setIconTextGap(getIconTextGap()); lbl.setBounds(getBounds()); lbl.setOpaque(true); lbl.setBackground(getBackground()); lbl.setForeground(getForeground()); lbl.setBorder( getBorder() ); if ((isGTK || "com.sun.java.swing.plaf.windows.WindowsLabelUI".equals(lbl.getUI().getClass().getName())) && ! isEnabled() && ! htmlValueUsed) { clear();
public void paint (Graphics g) { if (editor != null) { setEnabled(PropUtils.checkEnabled (this, editor, env)); setForeground(PropUtils.getErrorColor()); delegatedPaint (g); } else { JLabel lbl = htmlLabel; String text = getText(); if (text != null && text.length() < 512) { ((HtmlRenderer.Renderer) htmlLabel).setHtml(false); lbl.setFont (getFont()); lbl.setEnabled (isEnabled()); lbl.setText (text == null ? "" : text); //NOI18N lbl.setIcon (getIcon()); lbl.setIconTextGap (getIconTextGap()); lbl.setBounds (getBounds()); lbl.setOpaque (true); lbl.setBackground (getBackground()); lbl.setForeground (getForeground()); lbl.paint (g); clear();
public void paint (Graphics g) { if (editor != null) { setEnabled(PropUtils.checkEnabled (this, editor, env)); setForeground(PropUtils.getErrorColor()); delegatedPaint (g); } else { JLabel lbl = htmlLabel; String text = getText(); if (text != null && text.length() < 512) { ((HtmlRenderer.Renderer) htmlLabel).setHtml(false); lbl.setFont (getFont()); lbl.setEnabled (isEnabled()); lbl.setText (text == null ? "" : text); //NOI18N lbl.setIcon (getIcon()); lbl.setIconTextGap (getIconTextGap()); lbl.setBounds (getBounds()); lbl.setOpaque (true); lbl.setBackground (getBackground()); lbl.setForeground (getForeground()); lbl.paint (g); clear();
private void delegatedPaint (Graphics g) { Color c = g.getColor(); try { g.setColor(getBackground()); g.fillRect(0,0,getWidth(),getHeight()); g.setColor(getForeground()); if (!tableUI) { //in the panel, give self-painting editors a lowered //border so they look like something Border b = BorderFactory.createBevelBorder( BevelBorder.LOWERED); b.paintBorder(this, g, 0, 0, getWidth(), getHeight()); } Rectangle r = getBounds(); //XXX May be the source of Rochelle's multiple rows of error //marking misalignment problem...(I do not jest) r.x = getWidth() > 16 ? editor instanceof Boolean3WayEditor ? 0 : 3 : 0; //align text with other renderers r.width -= getWidth() > 16 ? editor instanceof Boolean3WayEditor ? 0 : 3 : 0; //align text with other renderers r.y = 0; editor.paintValue(g, r); } finally { g.setColor(c); } }
private void delegatedPaint (Graphics g) { Color c = g.getColor(); try { g.setColor(getBackground()); g.fillRect(0,0,getWidth(),getHeight()); g.setColor(getForeground()); if (!tableUI) { //in the panel, give self-painting editors a lowered //border so they look like something Border b = BorderFactory.createBevelBorder( BevelBorder.LOWERED); b.paintBorder(this, g, 0, 0, getWidth(), getHeight()); } Rectangle r = getBounds(); //XXX May be the source of Rochelle's multiple rows of error //marking misalignment problem...(I do not jest) r.x = getWidth() > 16 ? editor instanceof Boolean3WayEditor ? 0 : 3 : 0; //align text with other renderers r.width -= getWidth() > 16 ? editor instanceof Boolean3WayEditor ? 0 : 3 : 0; //align text with other renderers r.y = 0; editor.paintValue(g, r); } finally { g.setColor(c); } }
private void delegatedPaint(Graphics g) { Color c = g.getColor(); try { g.setColor(getBackground()); g.fillRect(0, 0, getWidth(), getHeight()); g.setColor(getForeground()); if (!tableUI) { //in the panel, give self-painting editors a lowered //border so they look like something Border b = BorderFactory.createBevelBorder(BevelBorder.LOWERED); b.paintBorder(this, g, 0, 0, getWidth(), getHeight()); } Rectangle r = getBounds(); //XXX May be the source of Rochelle's multiple rows of error //marking misalignment problem...(I do not jest) r.x = (getWidth() > 16) ? ((editor instanceof Boolean3WayEditor) ? 0 : 3) : 0; //align text with other renderers r.width -= ((getWidth() > 16) ? ((editor instanceof Boolean3WayEditor) ? 0 : 3) : 0); //align text with other renderers r.y = 0; editor.paintValue(g, r); } finally { g.setColor(c); } }
public JComponent getStringRenderer() { StringRenderer result = stringRenderer(); result.clear(); result.setEnabled(true); return result; }
/** * Lazily creates a string renderer */ private StringRenderer stringRenderer() { if (stringRenderer == null) { stringRenderer = new StringRenderer(tableUI); //Mainly for debugging ((JComponent) stringRenderer).setName( "StringRenderer for " + getClass().getName() + "@" + System.identityHashCode(this) ); //NOI18N } return stringRenderer; }
/** * Lazily creates a string renderer */ private StringRenderer stringRenderer() { if (stringRenderer == null) { stringRenderer = new StringRenderer(tableUI); //Mainly for debugging ((JComponent) stringRenderer).setName("StringRenderer for " + getClass().getName() + "@" + System.identityHashCode(this)); //NOI18N } return stringRenderer; }
public JComponent getStringRenderer() { StringRenderer result = stringRenderer(); result.clear(); result.setEnabled(true); return result; }
public JComponent getStringRenderer() { StringRenderer result = stringRenderer(); result.clear(); result.setEnabled(true); return result; }