This class is not threadsafe.
55565758596061626364
return (Painter)super.getValue(); } @Override public String getJavaInitializationString() { Painter painter = getValue(); //TODO!!! return painter == null ? "null" : "new org.jdesktop.swingx.painter.CheckerboardPainter()"; }
4142434445464748495051
/** * {@inheritDoc} */ public void setPainter(Painter painter) { Painter old = getPainter(); this.painter = painter; if (painter != null) { // ui maps to !opaque // Note: this is incomplete - need to keep track of the // "real" contentfilled property
270271272273274275276277278
* an appropriate look * * @param p The Painter to use. May be null */ public void setTitlePainter(Painter p) { Painter old = getTitlePainter(); this.titlePainter = p; firePropertyChange("titlePainter", old, getTitlePainter()); }
262263264265266267268269270271272
* being used, because Painters may paint transparent pixels or not * paint certain pixels, such as around the border insets. */ public void setBackgroundPainter(Painter p) { Painter old = getBackgroundPainter(); this.backgroundPainter = p; if (p != null) { setOpaque(false); }
99100101102103104105106107
/** * {@inheritDoc} */ public void setPainter(Painter painter) { Painter old = getPainter(); this.painter = painter; firePropertyChange("painter", old, getPainter()); }
5152535455565758596061
1556155715581559156015611562156315641565156615671568
* @see #isBackgroundPainted() * @see #setBackgroundPainted(boolean) */ protected void paintBackground(Graphics2D g2) { if (isBackgroundPainted()) { Painter p = getBackgroundPainter(); if (p != null) { p.paint(g2, this, getWidth(), getHeight()); } else { g2.setColor(getBackground()); g2.fill(g2.getClipBounds()); } }
142143144145146147148149150151
public Painter<JXButton> getBackgroundPainter() { return bgPainter; } public void setBackgroundPainter(Painter<JXButton> p) { Painter old = getBackgroundPainter(); this.bgPainter = p; firePropertyChange("backgroundPainter", old, getBackgroundPainter()); repaint(); }
152153154155156157158159160161
public Painter<JXButton> getForegroundPainter() { return fgPainter; } public void setForegroundPainter(Painter<JXButton> p) { Painter old = getForegroundPainter(); this.fgPainter = p; firePropertyChange("foregroundPainter", old, getForegroundPainter()); repaint(); }
327328329330331332333334335336337
* 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;