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$
*
* 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 static org.jdesktop.swingx.painter.PainterUtils.getBackgroundPaint;
import static org.jdesktop.swingx.painter.PainterUtils.getForegroundPaint;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Paint;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.geom.Ellipse2D;
import org.jdesktop.beans.JavaBean;
import org.jdesktop.swingx.painter.effects.AreaEffect;
/**
*
A Painter that paints java.awt.Shapes. It uses a stroke and a fillPaint to do so. The
* shape is painted as is, at a specific location. If no Shape is specified, nothing
* will be painted. If no stroke is specified, the default for the Graphics2D
* will be used. If no fillPaint is specified, the component background color
* will be used. The shape can be positioned using the insets, horizontal, and
* vertical properties.
*
*
Here is an example that draws a rectangle aligned on the center right:
*
* Rectangle2D.Double rect = new Rectangle2D.Double(0, 0, 50, 50);
* ShapePainter p = new ShapePainter(rect);
* p.setHorizontal(HorizontalAlignment.RIGHT);
* p.setVertical(VerticalAlignment.CENTER);
*
* @author rbair
*/
@JavaBean
@SuppressWarnings("nls")
public class ShapePainter extends AbstractAreaPainter