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: ImagePainter.java 4261 2012-11-19 18:38:46Z 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.painter.effects.AreaEffect;
import java.awt.BasicStroke;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Insets;
import java.awt.Paint;
import java.awt.Rectangle;
import java.awt.Shape;
import java.awt.TexturePaint;
import java.awt.geom.Area;
import java.awt.image.BufferedImage;
/**
*
A Painter instance that paints an image. Any Image is acceptable. This
* Painter also allows the developer to specify a "Style" -- CENTERED, TILED,
* SCALED, POSITIONED, and CSS_POSITIONED; with the following meanings:
*
*
*
CENTERED: draws the image unscaled and positioned in the center of
* the component
*
TILED: draws the image repeatedly across the component, filling the
* entire background.
*
SCALED: draws the image stretched large enough (or small enough) to
* cover the entire component. The stretch may not preserve the aspect ratio of the
* original image.
*
POSITIONED: draws the image at the location specified by the imageLocation
* property. This style of drawing will respect the imageScale property.
*
CSS_POSITIONED: draws the image using CSS style background positioning.
* It will use the location specified by the imageLocation property. This property should
* contain a point with the x and y values between 0 and 1. 0,0 will put the image in the
* upper left hand corner, 1,1 in the lower right, and 0.5,0.5 in the center. All other values
* will be interpolated accordingly. For a more
* complete definition of the positioning algorithm see the
* CSS 2.1 spec.
*
*
*
* @author Richard
*/
@JavaBean
@SuppressWarnings("nls")
public class ImagePainter extends AbstractAreaPainter