2
* $Id: TestablePainter.java 3475 2009-08-28 08:30:47Z kleopatra $
4
* Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
5
* Santa Clara, California 95054, U.S.A. All rights reserved.
7
* This library is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Lesser General Public
9
* License as published by the Free Software Foundation; either
10
* version 2.1 of the License, or (at your option) any later version.
12
* This library is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
17
* You should have received a copy of the GNU Lesser General Public
18
* License along with this library; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
package org.jdesktop.swingx.painter;
23
import java.awt.Graphics2D;
24
import java.awt.image.BufferedImageOp;
27
* A useful Painter implementation for Testing purposes
30
class TestablePainter extends AbstractPainter {
31
boolean painted = false;
32
boolean configured = false;
33
boolean configureCalledFirst = false;
36
public TestablePainter() {
40
public TestablePainter(boolean cacheable) {
45
protected void doPaint(Graphics2D g, Object obj, int width, int height) {
51
protected void validate(Object object) {
59
protected void configureGraphics(Graphics2D g) {
61
configureCalledFirst = configured && !painted;
69
setFilters((BufferedImageOp[])null);