de.javasoft.plaf.synthetica.painter
Class ImagePainter

java.lang.Object
  extended by de.javasoft.plaf.synthetica.painter.ImagePainter

public class ImagePainter
extends java.lang.Object

ImagePainter generally used to paint background images.

Version:
1.55, 25.02.2012

Field Summary
static java.util.logging.Logger logger
           
static int STRETCHED
           
static int TILED
           
 
Constructor Summary
ImagePainter(java.awt.Graphics g, int x, int y, int w, int h, java.lang.String imagePath, java.awt.Insets sourceInsets, java.awt.Insets destinationInsets, int xPolicy, int yPolicy)
          Constructor.
ImagePainter(java.awt.Image image, java.awt.Graphics g, int x, int y, int w, int h, java.awt.Insets sourceInsets, java.awt.Insets destinationInsets)
           
ImagePainter(javax.swing.JComponent c, java.awt.Graphics g, int x, int y, int w, int h, java.lang.String imagePath, java.awt.Insets sInsets, java.awt.Insets dInsets, java.awt.Insets sInsets2, java.awt.Insets dInsets2, int xPolicy, int yPolicy)
           
ImagePainter(javax.swing.JComponent c, java.awt.Graphics g, int x, int y, int w, int h, java.lang.String imagePaths, java.awt.Insets sourceInsets, java.awt.Insets destinationInsets, int xPolicy, int yPolicy)
          Constructor with colorizing support.
ImagePainter(javax.swing.JComponent c, int red, int green, int blue, java.awt.Insets colorizeInsets, java.awt.Graphics g, int x, int y, int w, int h, java.lang.String imagePath, java.awt.Insets sourceInsets, java.awt.Insets destinationInsets, int xPolicy, int yPolicy)
          Constructor for colorized images.
ImagePainter(javax.swing.JComponent c, int red, int green, int blue, java.awt.Insets colorizeInsets, java.awt.Graphics g, int x, int y, int w, int h, java.lang.String imagePath, java.awt.Insets sourceInsets, java.awt.Insets destinationInsets, int xPolicy, int yPolicy, boolean hFlip, boolean vFlip)
          Constructor for colorized images.
ImagePainter(javax.swing.JComponent c, int cycles, int delay, int type, int state, java.awt.Graphics g, int x, int y, int w, int h, java.lang.String imagePaths, java.awt.Insets sourceInsets, java.awt.Insets destinationInsets, int xPolicy, int yPolicy)
          Constructor - use for animated components.
ImagePainter(javax.swing.JComponent c, java.lang.String id, int cycles, int delay, int type, int state, java.awt.Graphics g, int x, int y, int w, int h, java.lang.String imagePaths, java.awt.Insets sourceInsets, java.awt.Insets destinationInsets, int xPolicy, int yPolicy)
          Constructor - use for animated components.
ImagePainter(javax.swing.JComponent c, java.lang.String id, int cycles, int delay, int type, int state, java.awt.Graphics g, int x, int y, int w, int h, java.lang.String imagePaths, java.awt.Insets sourceInsets, java.awt.Insets destinationInsets, int xPolicy, int yPolicy, boolean hFlip, boolean vFlip)
          Constructor - use for animated components.
 
Method Summary
static void clearImageCache()
          Clears the image cache.
 void draw()
          Paints complete image.
 void drawBorder()
          Paints image border.
 void drawBottomCenter()
          Paints bottom center border of the image.
 void drawBottomLeft()
          Paints bottom left border of the image.
 void drawBottomRight()
          Paints bottom right border of the image.
 void drawCenter()
          Paints center area of the image.
 void drawLeft()
          Paints left center border of the image.
 void drawRight()
          Paints right center border of the image.
 void drawTopCenter()
          Paints top center border of the image.
 void drawTopLeft()
          Paints top left border of the image.
 void drawTopRight()
          Paints top right border of the image.
 void setAngle(int angle)
          Set angle for painting.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static final java.util.logging.Logger logger

STRETCHED

public static final int STRETCHED
See Also:
Constant Field Values

TILED

public static final int TILED
See Also:
Constant Field Values
Constructor Detail

ImagePainter

public ImagePainter(javax.swing.JComponent c,
                    int cycles,
                    int delay,
                    int type,
                    int state,
                    java.awt.Graphics g,
                    int x,
                    int y,
                    int w,
                    int h,
                    java.lang.String imagePaths,
                    java.awt.Insets sourceInsets,
                    java.awt.Insets destinationInsets,
                    int xPolicy,
                    int yPolicy)
Constructor - use for animated components.

Parameters:
c - The component.
cycles - Number of animation cyles.
delay - Delay in milliseconds for image sequence.
type - Animation type.
g - Graphics.
x - X position.
y - Y position.
w - Width.
h - Height.
imagePaths - Comma separated image paths.
sourceInsets - Source Insets.
destinationInsets - Destination Insets.
xPolicy - Policy for horizontal painting (STRETCHED, TILED).
yPolicy - Policy for vertical painting (STRETCHED, TILED).

ImagePainter

public ImagePainter(javax.swing.JComponent c,
                    java.lang.String id,
                    int cycles,
                    int delay,
                    int type,
                    int state,
                    java.awt.Graphics g,
                    int x,
                    int y,
                    int w,
                    int h,
                    java.lang.String imagePaths,
                    java.awt.Insets sourceInsets,
                    java.awt.Insets destinationInsets,
                    int xPolicy,
                    int yPolicy)
Constructor - use for animated components.

Parameters:
c - The component.
id - An id for a components subregion. A subregion is a painted part of a component like the tabs of a JTabbedPane. Use null if you don't need to address a subregion.
cycles - Number of animation cyles.
delay - Delay in milliseconds for image sequence.
type - Animation type.
g - Graphics.
x - X position.
y - Y position.
w - Width.
h - Height.
imagePaths - Comma separated image paths.
sourceInsets - Source Insets.
destinationInsets - Destination Insets.
xPolicy - Policy for horizontal painting (STRETCHED, TILED).
yPolicy - Policy for vertical painting (STRETCHED, TILED).

ImagePainter

public ImagePainter(javax.swing.JComponent c,
                    java.lang.String id,
                    int cycles,
                    int delay,
                    int type,
                    int state,
                    java.awt.Graphics g,
                    int x,
                    int y,
                    int w,
                    int h,
                    java.lang.String imagePaths,
                    java.awt.Insets sourceInsets,
                    java.awt.Insets destinationInsets,
                    int xPolicy,
                    int yPolicy,
                    boolean hFlip,
                    boolean vFlip)
Constructor - use for animated components.

Parameters:
c - The component.
id - An id for a components subregion. A subregion is a painted part of a component like the tabs of a JTabbedPane. Use null if you don't need to address a subregion.
cycles - Number of animation cyles.
delay - Delay in milliseconds for image sequence.
type - Animation type.
g - Graphics.
x - X position.
y - Y position.
w - Width.
h - Height.
imagePaths - Comma separated image paths.
sourceInsets - Source Insets.
destinationInsets - Destination Insets.
xPolicy - Policy for horizontal painting (STRETCHED, TILED).
yPolicy - Policy for vertical painting (STRETCHED, TILED).
hFlip - Flip image horizontal.
vFlip - Flip image vertical.

ImagePainter

public ImagePainter(javax.swing.JComponent c,
                    java.awt.Graphics g,
                    int x,
                    int y,
                    int w,
                    int h,
                    java.lang.String imagePaths,
                    java.awt.Insets sourceInsets,
                    java.awt.Insets destinationInsets,
                    int xPolicy,
                    int yPolicy)
Constructor with colorizing support.

Parameters:
c - The related component.
g - Graphics.
x - X position.
y - Y position.
w - Width.
h - Height.
imagePaths - Comma separated image paths.
sourceInsets - Source Insets.
destinationInsets - Destination Insets.
xPolicy - Policy for horizontal painting (STRETCHED, TILED).
yPolicy - Policy for vertical painting (STRETCHED, TILED).

ImagePainter

public ImagePainter(java.awt.Graphics g,
                    int x,
                    int y,
                    int w,
                    int h,
                    java.lang.String imagePath,
                    java.awt.Insets sourceInsets,
                    java.awt.Insets destinationInsets,
                    int xPolicy,
                    int yPolicy)
Constructor.

Parameters:
g - Graphics.
x - X position.
y - Y position.
w - Width.
h - Height.
imagePath - Image path.
sourceInsets - Source Insets.
destinationInsets - Destination Insets.
xPolicy - Policy for horizontal painting (STRETCHED, TILED).
yPolicy - Policy for vertical painting (STRETCHED, TILED).

ImagePainter

public ImagePainter(javax.swing.JComponent c,
                    int red,
                    int green,
                    int blue,
                    java.awt.Insets colorizeInsets,
                    java.awt.Graphics g,
                    int x,
                    int y,
                    int w,
                    int h,
                    java.lang.String imagePath,
                    java.awt.Insets sourceInsets,
                    java.awt.Insets destinationInsets,
                    int xPolicy,
                    int yPolicy)
Constructor for colorized images.

Parameters:
c - The related component.
red - Red colorize value in percent from -100 to +100.
green - Green colorize value in percent from -100 to +100.
blue - Blue colorize value in percent from -100 to +100.
colorizeInsets - Insets for the colorized area, used to exclude image borders from colorizing. Insets of (0,0,0,0) means complete colorizing.
g - Graphics.
x - X position.
y - Y position.
w - Width.
h - Height.
imagePath - Image path.
sourceInsets - Source Insets.
destinationInsets - Destination Insets.
xPolicy - Policy for horizontal painting (STRETCHED, TILED).
yPolicy - Policy for vertical painting (STRETCHED, TILED).

ImagePainter

public ImagePainter(javax.swing.JComponent c,
                    int red,
                    int green,
                    int blue,
                    java.awt.Insets colorizeInsets,
                    java.awt.Graphics g,
                    int x,
                    int y,
                    int w,
                    int h,
                    java.lang.String imagePath,
                    java.awt.Insets sourceInsets,
                    java.awt.Insets destinationInsets,
                    int xPolicy,
                    int yPolicy,
                    boolean hFlip,
                    boolean vFlip)
Constructor for colorized images.

Parameters:
c - The related component.
red - Red colorize value in percent from -100 to +100.
green - Green colorize value in percent from -100 to +100.
blue - Blue colorize value in percent from -100 to +100.
colorizeInsets - Insets for the colorized area, used to exclude image borders from colorizing. Insets of (0,0,0,0) means complete colorizing.
g - Graphics.
x - X position.
y - Y position.
w - Width.
h - Height.
imagePath - Image path.
sourceInsets - Source Insets.
destinationInsets - Destination Insets.
xPolicy - Policy for horizontal painting (STRETCHED, TILED).
yPolicy - Policy for vertical painting (STRETCHED, TILED).
hFlip - Flip image horizontal.
vFlip - Flip image vertical.

ImagePainter

public ImagePainter(javax.swing.JComponent c,
                    java.awt.Graphics g,
                    int x,
                    int y,
                    int w,
                    int h,
                    java.lang.String imagePath,
                    java.awt.Insets sInsets,
                    java.awt.Insets dInsets,
                    java.awt.Insets sInsets2,
                    java.awt.Insets dInsets2,
                    int xPolicy,
                    int yPolicy)

ImagePainter

public ImagePainter(java.awt.Image image,
                    java.awt.Graphics g,
                    int x,
                    int y,
                    int w,
                    int h,
                    java.awt.Insets sourceInsets,
                    java.awt.Insets destinationInsets)
Method Detail

clearImageCache

public static void clearImageCache()
Clears the image cache.


setAngle

public void setAngle(int angle)
Set angle for painting. Currently only values of 0, 90 and -90 are supported.


draw

public void draw()
Paints complete image.


drawBorder

public void drawBorder()
Paints image border.


drawCenter

public void drawCenter()
Paints center area of the image.


drawTopLeft

public void drawTopLeft()
Paints top left border of the image.


drawTopRight

public void drawTopRight()
Paints top right border of the image.


drawBottomLeft

public void drawBottomLeft()
Paints bottom left border of the image.


drawBottomRight

public void drawBottomRight()
Paints bottom right border of the image.


drawTopCenter

public void drawTopCenter()
Paints top center border of the image.


drawLeft

public void drawLeft()
Paints left center border of the image.


drawRight

public void drawRight()
Paints right center border of the image.


drawBottomCenter

public void drawBottomCenter()
Paints bottom center border of the image.



Copyright © 2004-2011 Jyloo Software. All Rights Reserved.