Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

oracle.javatools.ui.border
Class ShadowBorder

java.lang.Object
  extended by oracle.javatools.ui.border.ShadowBorder
All Implemented Interfaces:
javax.swing.border.Border

public final class ShadowBorder
extends java.lang.Object
implements javax.swing.border.Border

A Border that draws a drop shadow for a component.

This border must be used on a transparent component. TransparentBorderComponent is a convenient container you can use in conjunction with this class.

                     |-| growth
 |-| xOffset       |-|   xOffset
   +-------------------+
 +-----------------+   |
 |                 |   |
 |                 |   |
 |                 |---+
 +-----------------+
 

Since:
11.1.1
See Also:
TransparentBorderComponent

Constructor Summary
ShadowBorder()
          Constructs a ShadowBorder with the following defaults:
ShadowBorder(int arcSize, int xOffset, int yOffset, int growth, double shadeIntensity)
          Constructs a ShadowBorder
 
Method Summary
 int getArcSize()
          Returns the size of the arc for the corners of the shadow rectangle.
 java.awt.Insets getBorderInsets(java.awt.Component c)
           
 java.awt.Color getColor()
          Returns the color of the shadow.
 int getGrowth()
          Returns the number of pixels to grow the shadow rectangle both horizontally and vertically compared to the component rectangle.
 double getIntensity()
          Returns the intensity of the shadow.
 int getXOffset()
          Returns the number of pixels by which the shadow rectangle is shifted horizontally from the origin of the component rectangle.
 int getYOffset()
          Returns the number of pixels by which the shadow rectangle is shifted vertically from the origin of the component rectangle.
 boolean isBorderOpaque()
           
 void paintBorder(java.awt.Component c, java.awt.Graphics gAWT, int x, int y, int width, int height)
           
 void setArcSize(int arcSize)
          Determines the size of the arc for the corners of the shadow rectangle.
 void setColor(java.awt.Color color)
          Sets the color of the shadow.
 void setGrowth(int growth)
          Sets the number of pixels to grow the shadow rectangle both horizontally and vertically compared to the component rectangle.
 void setIntensity(double intensity)
          Sets the intensity of the shadow.
 void setXOffset(int offset)
          Sets the number of pixels by which the shadow rectangle will be shifted horizontally from the origin of the component rectangle.
 void setYOffset(int offset)
          Sets the number of pixels by which the shadow rectangle will be shifted vertically from the origin of the component rectangle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShadowBorder

public ShadowBorder()
Constructs a ShadowBorder with the following defaults:
   arcSize = 20
   xOffset = 3
   yOffset = 3
   growth = 4
   shadeIntensity = 1d
 


ShadowBorder

public ShadowBorder(int arcSize,
                    int xOffset,
                    int yOffset,
                    int growth,
                    double shadeIntensity)
Constructs a ShadowBorder

Parameters:
arcSize - the size of the arc for the rounded corners of the shadow rectangle. Must be >= 0.
xOffset - the number of pixels to offset the shadow horizontally.
yOffset - the number of pixels to offset the shadow vertically.
growth - specifies a number of pixels by which the shadow area should be enlarged both horizontally and vertically compared to the component rectangle.
shadeIntensity - The intensity of the shade. A double value between 0.0 and 1.0.
Method Detail

paintBorder

public void paintBorder(java.awt.Component c,
                        java.awt.Graphics gAWT,
                        int x,
                        int y,
                        int width,
                        int height)
Specified by:
paintBorder in interface javax.swing.border.Border

getBorderInsets

public java.awt.Insets getBorderInsets(java.awt.Component c)
Specified by:
getBorderInsets in interface javax.swing.border.Border

isBorderOpaque

public boolean isBorderOpaque()
Specified by:
isBorderOpaque in interface javax.swing.border.Border

setXOffset

public void setXOffset(int offset)
Sets the number of pixels by which the shadow rectangle will be shifted horizontally from the origin of the component rectangle.

Parameters:
offset - The number of pixels by which the shadow is shifted horizontally. A positive value indicates a shift to the right, a negative value indicates a shift to the left.

getXOffset

public int getXOffset()
Returns the number of pixels by which the shadow rectangle is shifted horizontally from the origin of the component rectangle.

Returns:
The number of pixels by which the shadow is shifted horizontally. A positive value indicates a shift to the right, a negative value indicates a shift to the left.

setYOffset

public void setYOffset(int offset)
Sets the number of pixels by which the shadow rectangle will be shifted vertically from the origin of the component rectangle.

Parameters:
offset - The number of pixels by which the shadow is shifted vertically. A positive value indicates a shift down, a negative value indicates a shift up.

getYOffset

public int getYOffset()
Returns the number of pixels by which the shadow rectangle is shifted vertically from the origin of the component rectangle.

Returns:
The number of pixels by which the shadow is shifted vertically. A positive value indicates a shift down, a negative value indicates a shift up.

setGrowth

public void setGrowth(int growth)
Sets the number of pixels to grow the shadow rectangle both horizontally and vertically compared to the component rectangle.

Parameters:
growth - the number of pixels by which the shadow rectangle grows. A positive value indicates growth, a negative value indicates that the shadow rectangle is smaller than the component rectangle.

getGrowth

public int getGrowth()
Returns the number of pixels to grow the shadow rectangle both horizontally and vertically compared to the component rectangle.

Returns:
the number of pixels by which the shadow rectangle grows. A positive value indicates growth, a negative value indicates that the shadow rectangle is smaller than the component rectangle.

setArcSize

public void setArcSize(int arcSize)
Determines the size of the arc for the corners of the shadow rectangle.

Parameters:
arcSize - The size of the arc that rounds off the corners. Must be a positive integer or 0.
Throws:
java.lang.IllegalArgumentException - if arcSize is < 0.
See Also:
RoundRectangle2D}

getArcSize

public int getArcSize()
Returns the size of the arc for the corners of the shadow rectangle.

Returns:
The size of the arc that rounds off the corners.

setIntensity

public void setIntensity(double intensity)
Sets the intensity of the shadow. A larger value indicates a darker, less transparent shadow.

Parameters:
intensity - a value between 0 and 1.
Throws:
java.lang.IllegalArgumentException - if intensity is not in the range 0 to 1.

getIntensity

public double getIntensity()
Returns the intensity of the shadow. A larger value indicates a darker, less transparent shadow.

Returns:
a value between 0 and 1.

getColor

public java.awt.Color getColor()
Returns the color of the shadow. The default color is black.

Returns:
the color of the shadow. Will not return null.

setColor

public void setColor(java.awt.Color color)
Sets the color of the shadow. If null is specified, the color will be reset to the default color: black.

Parameters:
color - the color of the shadow. May be null.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

Copyright © 1997, 2009, Oracle. All rights reserved.