org.openbp.swing.plaf.sky
Class SkyUtil

java.lang.Object
  extended by org.openbp.swing.plaf.sky.SkyUtil

public class SkyUtil
extends java.lang.Object

Some usefull methods for shadow and 3D effects.

Author:
Jens Ferchland

Field Summary
static int DEFAULTSHADOWDEPTH
          The default shadow depth in the Sky LookAndFeel package
static int MAXSHADOWDEPTH
          Max. shadow depth in the Sky LookAndFeel package
static int RADIUS
          The default radius in the Sky LookAndFeel package
 
Constructor Summary
SkyUtil()
           
 
Method Summary
static javax.swing.Icon createGrayIcon(javax.swing.Icon icon)
          Creates a 'disabled' version of an icon.
static void paint3DRectEffect(java.awt.Graphics graphics, int x, int y, int width, int height)
          Paint a 3D effect to a Rectangle
static void paint3DRectEffect(java.awt.Graphics graphics, int x, int y, int width, int height, int depth)
          Paint a 3D effect to a Rectangle.
static void paint3DRoundRectEffect(java.awt.Graphics g, int x, int y, int width, int height, int radius)
          Paint a 3D effect to a RoundRect.
static void paint3DRoundRectEffect(java.awt.Graphics g, int x, int y, int width, int height, int radius, int depth)
          Paint a 3D effect to a RoundRect.
static void paintRectShadow(java.awt.Graphics g, int x, int y, int width, int height)
          Draw a shadow shaped as a Rectangle with smooth edges with a depth of 5 if possible.
static void paintRectShadow(java.awt.Graphics g, int x, int y, int width, int height, int shadowsteps)
          Draw a shadow shaped as a Rectangle with smooth edges and a depth of shadowsteps if possible.
static void paintRoundRectShadow(java.awt.Graphics g, int x, int y, int width, int height, int radius)
          Draw a shadow shaped as a RoundRect with smooth edges and a depth of 5.
static void paintRoundRectShadow(java.awt.Graphics g, int x, int y, int width, int height, int radius, int shadowsteps)
          Draw a shadow shaped as a RoundRect with smooth edges.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RADIUS

public static final int RADIUS
The default radius in the Sky LookAndFeel package

See Also:
Constant Field Values

MAXSHADOWDEPTH

public static final int MAXSHADOWDEPTH
Max. shadow depth in the Sky LookAndFeel package

See Also:
Constant Field Values

DEFAULTSHADOWDEPTH

public static final int DEFAULTSHADOWDEPTH
The default shadow depth in the Sky LookAndFeel package

See Also:
Constant Field Values
Constructor Detail

SkyUtil

public SkyUtil()
Method Detail

paintRoundRectShadow

public static void paintRoundRectShadow(java.awt.Graphics g,
                                        int x,
                                        int y,
                                        int width,
                                        int height,
                                        int radius)
Draw a shadow shaped as a RoundRect with smooth edges and a depth of 5.

Parameters:
g - a Graphics value
radius - an int value

paintRoundRectShadow

public static void paintRoundRectShadow(java.awt.Graphics g,
                                        int x,
                                        int y,
                                        int width,
                                        int height,
                                        int radius,
                                        int shadowsteps)
Draw a shadow shaped as a RoundRect with smooth edges.

Parameters:
g - a Graphics value
radius - an int value
shadowsteps - an int value

paintRectShadow

public static void paintRectShadow(java.awt.Graphics g,
                                   int x,
                                   int y,
                                   int width,
                                   int height)
Draw a shadow shaped as a Rectangle with smooth edges with a depth of 5 if possible.

Parameters:
g - a Graphics value

paintRectShadow

public static void paintRectShadow(java.awt.Graphics g,
                                   int x,
                                   int y,
                                   int width,
                                   int height,
                                   int shadowsteps)
Draw a shadow shaped as a Rectangle with smooth edges and a depth of shadowsteps if possible.

Parameters:
g - a Graphics value
shadowsteps - an int value

paint3DRoundRectEffect

public static void paint3DRoundRectEffect(java.awt.Graphics g,
                                          int x,
                                          int y,
                                          int width,
                                          int height,
                                          int radius)
Paint a 3D effect to a RoundRect.

Parameters:
radius - an int value

paint3DRoundRectEffect

public static void paint3DRoundRectEffect(java.awt.Graphics g,
                                          int x,
                                          int y,
                                          int width,
                                          int height,
                                          int radius,
                                          int depth)
Paint a 3D effect to a RoundRect.

Parameters:
radius - an int value
depth - an int value

paint3DRectEffect

public static void paint3DRectEffect(java.awt.Graphics graphics,
                                     int x,
                                     int y,
                                     int width,
                                     int height)
Paint a 3D effect to a Rectangle

Parameters:
graphics - a Graphics value

paint3DRectEffect

public static void paint3DRectEffect(java.awt.Graphics graphics,
                                     int x,
                                     int y,
                                     int width,
                                     int height,
                                     int depth)
Paint a 3D effect to a Rectangle.

Parameters:
graphics - a Graphics value
depth - an int value

createGrayIcon

public static javax.swing.Icon createGrayIcon(javax.swing.Icon icon)
Creates a 'disabled' version of an icon.

Parameters:
icon - Icon to convert
Returns:
The 'grayed' version of the icon


Copyright © 2011. All Rights Reserved.