public static Painter getFGP(JComponent comp) { if(comp instanceof JXLabel) { return ((JXLabel)comp).getForegroundPainter(); } if(comp instanceof JXButton) { return ((JXButton)comp).getForegroundPainter(); } return null; }
public static Painter getFGP(JComponent comp) { if(comp instanceof JXLabel) { return ((JXLabel)comp).getForegroundPainter(); } if(comp instanceof JXButton) { return ((JXButton)comp).getForegroundPainter(); } return null; }
/** * Sets a new foregroundPainter on the label. This will replace the existing foreground painter. Existing painters * can be wrapped by using a CompoundPainter. * * @param painter */ public void setForegroundPainter(Painter painter) { Painter old = this.getForegroundPainter(); if (painter == null) { //restore default painter initPainterSupport(); } else { this.foregroundPainter = painter; } firePropertyChange("foregroundPainter", old, getForegroundPainter()); repaint(); }
/** * Sets a new foregroundPainter on the label. This will replace the existing foreground painter. Existing painters * can be wrapped by using a CompoundPainter. * * @param painter */ public void setForegroundPainter(Painter painter) { Painter old = this.getForegroundPainter(); if (painter == null) { //restore default painter initPainterSupport(); } else { this.foregroundPainter = painter; } firePropertyChange("foregroundPainter", old, getForegroundPainter()); repaint(); }
/** * Sets a new foregroundPainter on the label. This will replace the existing foreground painter. Existing painters * can be wrapped by using a CompoundPainter. * * @param painter */ public void setForegroundPainter(Painter painter) { Painter old = this.getForegroundPainter(); if (painter == null) { //restore default painter initPainterSupport(); } else { this.foregroundPainter = painter; } firePropertyChange("foregroundPainter", old, getForegroundPainter()); repaint(); }
/** * Sets a new foregroundPainter on the label. This will replace the existing foreground painter. Existing painters * can be wrapped by using a CompoundPainter. * * @param painter */ public void setForegroundPainter(Painter painter) { Painter old = this.getForegroundPainter(); if (painter == null) { //restore default painter initPainterSupport(); } else { this.foregroundPainter = painter; } firePropertyChange("foregroundPainter", old, getForegroundPainter()); repaint(); }
/** * Sets a new foregroundPainter on the label. This will replace the existing foreground painter. Existing painters * can be wrapped by using a CompoundPainter. * * @param painter */ public void setForegroundPainter(Painter painter) { Painter old = this.getForegroundPainter(); if (painter == null) { //restore default painter initPainterSupport(); } else { this.foregroundPainter = painter; } firePropertyChange("foregroundPainter", old, getForegroundPainter()); repaint(); }
/** * Enables line wrapping support for plain text. By default this support is disabled to mimic default of the JLabel. * Value of this property has no effect on HTML text. * * @param b the new value */ public void setLineWrap(boolean b) { boolean old = isLineWrap(); this.multiLine = b; if (isLineWrap() != old) { firePropertyChange("lineWrap", old, isLineWrap()); if (getForegroundPainter() != null) { // XXX There is a bug here. In order to make painter work with this, caching has to be disabled ((AbstractPainter) getForegroundPainter()).setCacheable(!b); } //repaint(); } }
/** * Enables line wrapping support for plain text. By default this support is disabled to mimic default of the JLabel. * Value of this property has no effect on HTML text. * * @param b the new value */ public void setLineWrap(boolean b) { boolean old = isLineWrap(); this.multiLine = b; if (isLineWrap() != old) { firePropertyChange("lineWrap", old, isLineWrap()); if (getForegroundPainter() != null) { // XXX There is a bug here. In order to make painter work with this, caching has to be disabled ((AbstractPainter) getForegroundPainter()).setCacheable(!b); } //repaint(); } }
/** * Enables line wrapping support for plain text. By default this support is disabled to mimic default of the JLabel. * Value of this property has no effect on HTML text. * * @param b the new value */ public void setLineWrap(boolean b) { boolean old = isLineWrap(); this.multiLine = b; if (isLineWrap() != old) { firePropertyChange("lineWrap", old, isLineWrap()); if (getForegroundPainter() != null) { // XXX There is a bug here. In order to make painter work with this, caching has to be disabled ((AbstractPainter) getForegroundPainter()).setCacheable(!b); } //repaint(); } }
/** * Enables line wrapping support for plain text. By default this support is disabled to mimic default of the JLabel. * Value of this property has no effect on HTML text. * * @param b the new value */ public void setLineWrap(boolean b) { boolean old = isLineWrap(); this.multiLine = b; if (isLineWrap() != old) { firePropertyChange("lineWrap", old, isLineWrap()); if (getForegroundPainter() != null) { // XXX There is a bug here. In order to make painter work with this, caching has to be disabled ((AbstractPainter) getForegroundPainter()).setCacheable(!b); } //repaint(); } }
/** * Enables line wrapping support for plain text. By default this support is disabled to mimic default of the JLabel. * Value of this property has no effect on HTML text. * * @param b the new value */ public void setLineWrap(boolean b) { boolean old = isLineWrap(); this.multiLine = b; if (isLineWrap() != old) { firePropertyChange("lineWrap", old, isLineWrap()); if (getForegroundPainter() != null) { // XXX There is a bug here. In order to make painter work with this, caching has to be disabled ((AbstractPainter) getForegroundPainter()).setCacheable(!b); } //repaint(); } }