Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* $Id: CheckerboardPainter.java 4147 2012-02-01 17:13:24Z kschaefe $
*
* Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle,
* Santa Clara, California 95054, U.S.A. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
package org.jdesktop.swingx.painter;
import org.jdesktop.beans.JavaBean;
import org.jdesktop.swingx.util.PaintUtils;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Paint;
/**
*
A Painter implementation that paints a checkerboard pattern. The light
* and dark colors (Paint instances) are configurable, as are the size of the
* squares (squareSize).
*
*
To configure a checkerboard pattern that used a gradient for the dark
* tiles and Color.WHITE for the light tiles, you could:
*
* GradientPaint gp = new GradientPaint(
* new Point2D.Double(0, 0),
* Color.BLACK,
* new Point2D.Double(0, 32),
* Color.GRAY);
* CheckerboardPainter p = new CheckerboardPainter();
* p.setDarkPaint(gp);
* p.setLightPaint(Color.WHITE);
* p.setSquareSize(32);
* panel.seBackgroundPainter(p);
*
*
*
Note that in this example, the "32" in the GradientPaint matches the "32"
* set for the squareSize. This is necessary because GradientPaints don't
* readjust themselves for the size of the square. They are fixed and immutable
* at the time of creation.
*
* @author rbair
*/
@JavaBean
@SuppressWarnings("nls")
public class CheckerboardPainter extends AbstractPainter