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: PinstripePainter.java 4259 2012-11-14 20:07:00Z 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 java.awt.BasicStroke;
import java.awt.Graphics2D;
import java.awt.Paint;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.geom.Area;
import java.awt.geom.Line2D;
import static java.lang.Math.hypot;
import static java.lang.Math.round;
import static java.lang.Math.toRadians;
import static org.jdesktop.swingx.painter.PainterUtils.getForegroundPaint;
/**
*
* A fun Painter that paints pinstripes. You can specify the Paint to paint those pinstripes in
* (could even be a texture paint!), the angle at which to paint the pinstripes, and the spacing
* between stripes.
*
*
*
* The default PinstripePainter configuration will paint the pinstripes using the foreground color
* of the component (the default behavior if a Paint is not specified) at a 45 degree angle with 8
* pixels between stripes
*
*
*
* Here is a custom code snippet that paints Color.GRAY pinstripes at a 135 degree angle:
*
*
*
* PinstripePainter p = new PinstripePainter();
* p.setAngle(135);
* p.setPaint(Color.GRAY);
*
*
*
* @author rbair
*/
@JavaBean
public class PinstripePainter extends AbstractPainter