This class is not threadsafe.
347348349350351352353354355356
* * @param p the new painter * @see #getBackgroundPainter() */ public void setBackgroundPainter(Painter p) { Painter old = getBackgroundPainter(); backgroundPainter = p; firePropertyChange("backgroundPainter", old, getBackgroundPainter()); repaint(); }
256257258259260261262263264265266
* * @param textComponent * @return the background painter of the text component */ public static Painter getBackgroundPainter(JTextComponent textComponent) { Painter painter = (Painter) textComponent.getClientProperty(BACKGROUND_PAINTER); if (painter == null) { painter = Painters.EMPTY_PAINTER; }
407408409410411412413414415416417
* * @param p the new painter * @see #getBackgroundPainter() */ public void setBackgroundPainter(Painter p) { Painter old = getBackgroundPainter(); if (old instanceof AbstractPainter) { ((AbstractPainter) old).removePropertyChangeListener(painterChangeListener); } backgroundPainter = p; if (backgroundPainter instanceof AbstractPainter) {
8283848586878889909192
private boolean loaded = false; private void load() { try { Painter painter = PainterUtil.loadPainter(url); this.setPainters(painter); loaded = true; } catch (Exception ex) { ex.printStackTrace(); }
2021222324252627282930
@Override public void updateUI() { if ("Nimbus".equals(UIManager.getLookAndFeel().getName())) { UIDefaults map = new UIDefaults(); Painter painter = new Painter() { Color color = null; @Override public void paint(Graphics2D g, Object c, int w, int h) {
282283284285286287288289290291292
catch ( Exception e ) {} } else if ( attribNameLwr.equals( "painter" )) { try { Painter xp = (Painter)Class.forName( attribValueStr.trim()).newInstance(); setPainter( xp ); } catch ( Exception e ) {} }
443444445446447448449450451452453
antiAlias = attribValue.equals( "true" ); else if ( attribNameLwr.equals( "userenderer" )) textRenderer = new XTextRenderer(); else if ( attribNameLwr.equals( "painter" )) { try { Painter xp = (Painter)Class.forName( attribValueStr.trim()).newInstance(); setPainter( xp ); } catch ( Exception e ) {} }
459460461462463464465466467468469
setStretchMode( Math.max( 0, new Integer( attribValueStr ).intValue())); else if ( attribNameLwr.equals( "center" )) setCenterImage( attribValueLwr.equals( "true" )); else if ( attribNameLwr.equals( "painter" )) { try { Painter xp = (Painter)Class.forName( attribValueStr.trim()).newInstance(); setPainter( xp ); } catch ( Exception e ) {} }