Top Description Fields Constructors Methods
com.sun.scenario.effect

public Class DropShadow

extends DelegateEffect
Class Inheritance

A high-level effect that renders a shadow of the given content behind the content with the specified color, radius, and offset.

Field Summary

Modifier and TypeField and Description
private final Merge
private final Offset
private AbstractShadow

Constructor Summary

AccessConstructor and Description
public
DropShadow()

Constructs a new DropShadow effect, with the default blur radius (10.0), x offset (0.0), and y offset (0.0), using the default input for source data.

public
DropShadow(Effect
the single input Effect
input
)

Constructs a new DropShadow effect, with the default blur radius (10.0), x offset (0.0), and y offset (0.0).

public
DropShadow(Effect
the input Effect used to create the background shadow
shadowSourceInput
,
Effect
the input Effect used to render the content over the shadow
contentInput
)

Constructs a new DropShadow effect, with the default blur radius (10.0), x offset (0.0), and y offset (0.0).

Method Summary

Modifier and TypeMethod and Description
public Effect.AccelType
getAccelType(FilterContext fctx)

Overrides com.sun.scenario.effect.DelegateEffect.getAccelType.

Returns one of the AccelType values, indicating whether this Effect is accelerated in hardware for the given FilterContext.

public Color4f

Returns:

the shadow color
getColor
()

Returns the shadow color.

public final Effect

Returns:

the content input for this Effect
getContentInput
()

Returns the content input for this Effect.

protected Effect
getDelegate()

Implements abstract com.sun.scenario.effect.DelegateEffect.getDelegate.

Returns the Effect object to delegate all operations to.

public float
public float
public float
public int

Returns:

the offset in the x direction, in pixels.
getOffsetX
()

Returns the offset in the x direction, in pixels.

public int

Returns:

the offset in the x direction, in pixels.
getOffsetY
()

Returns the offset in the x direction, in pixels.

public float

Returns:

the radius of the Gaussian kernel
getRadius
()

Returns the radius of the Gaussian kernel.

public AbstractShadow.ShadowMode
public final Effect

Returns:

the shadow source input for this Effect
getShadowSourceInput
()

Returns the shadow source input for this Effect.

public float

Returns:

the spread of the shadow effect
getSpread
()

Gets the spread of the shadow effect.

public void
setColor(Color4f
the shadow color
color
)

Sets the shadow color.

public void
setContentInput(Effect
the content input for this Effect
contentInput
)

Sets the content input for this Effect.

public void
public void
public void
public void
setOffsetX(int
the offset in the x direction, in pixels
xoff
)

Sets the offset in the x direction, in pixels.

public void
setOffsetY(int
the offset in the y direction, in pixels
yoff
)

Sets the offset in the y direction, in pixels.

public void
setRadius(float
the radius of the shadow blur kernel
radius
)

Sets the radius of the shadow blur kernel.

public void
public void
setShadowSourceInput(Effect
the shadow source input for this Effect
shadowSourceInput
)

Sets the shadow source input for this Effect.

public void
setSpread(float
the spread of the shadow effect
spread
)

Sets the spread of the shadow effect.

Inherited from com.sun.scenario.effect.DelegateEffect:
filtergetBoundsgetDirtyRegionsreducesOpaquePixelstransformuntransform

Field Detail

mergeback to summary
private final Merge merge
offsetback to summary
private final Offset offset
shadowback to summary
private AbstractShadow shadow

Constructor Detail

DropShadowback to summary
public DropShadow()

Constructs a new DropShadow effect, with the default blur radius (10.0), x offset (0.0), and y offset (0.0), using the default input for source data. This is a shorthand equivalent to:

    new DropShadow(DefaultInput, DefaultInput)
DropShadowback to summary
public DropShadow(Effect input)

Constructs a new DropShadow effect, with the default blur radius (10.0), x offset (0.0), and y offset (0.0). This is a shorthand equivalent to:

    new DropShadow(input, input);
Parameters
input:Effect

the single input Effect

DropShadowback to summary
public DropShadow(Effect shadowSourceInput, Effect contentInput)

Constructs a new DropShadow effect, with the default blur radius (10.0), x offset (0.0), and y offset (0.0).

This constructor is intended for advanced developers only. Most developers will only ever need to use the default constructor.

The shadowSourceInput is used to create the background shadow, and the contentInput is used to render the content over that shadow.

Parameters
shadowSourceInput:Effect

the input Effect used to create the background shadow

contentInput:Effect

the input Effect used to render the content over the shadow

Method Detail

getAccelTypeback to summary
public Effect.AccelType getAccelType(FilterContext fctx)

Overrides com.sun.scenario.effect.DelegateEffect.getAccelType.

Doc from com.sun.scenario.effect.Effect.getAccelType.

Returns one of the AccelType values, indicating whether this Effect is accelerated in hardware for the given FilterContext.

Returns:Effect.AccelType

one of the AccelType values

Annotations
@Override
getColorback to summary
public Color4f getColor()

Returns the shadow color.

Returns:Color4f

the shadow color

getContentInputback to summary
public final Effect getContentInput()

Returns the content input for this Effect.

Returns:Effect

the content input for this Effect

getDelegateback to summary
protected Effect getDelegate()

Implements abstract com.sun.scenario.effect.DelegateEffect.getDelegate.

Doc from com.sun.scenario.effect.DelegateEffect.getDelegate.

Returns the Effect object to delegate all operations to.

Returns:Effect

the Effect object to delegate to.

Annotations
@Override
getGaussianHeightback to summary
public float getGaussianHeight()
getGaussianRadiusback to summary
public float getGaussianRadius()
getGaussianWidthback to summary
public float getGaussianWidth()
getOffsetXback to summary
public int getOffsetX()

Returns the offset in the x direction, in pixels.

Returns:int

the offset in the x direction, in pixels.

getOffsetYback to summary
public int getOffsetY()

Returns the offset in the x direction, in pixels.

Returns:int

the offset in the x direction, in pixels.

getRadiusback to summary
public float getRadius()

Returns the radius of the Gaussian kernel.

Returns:float

the radius of the Gaussian kernel

getShadowModeback to summary
public AbstractShadow.ShadowMode getShadowMode()
getShadowSourceInputback to summary
public final Effect getShadowSourceInput()

Returns the shadow source input for this Effect.

Returns:Effect

the shadow source input for this Effect

getSpreadback to summary
public float getSpread()

Gets the spread of the shadow effect.

Returns:float

the spread of the shadow effect

setColorback to summary
public void setColor(Color4f color)

Sets the shadow color.

      Min: n/a
      Max: n/a
  Default: Color4f.BLACK
 Identity: n/a
Parameters
color:Color4f

the shadow color

Exceptions
IllegalArgumentException:
if color is null
setContentInputback to summary
public void setContentInput(Effect contentInput)

Sets the content input for this Effect.

Parameters
contentInput:Effect

the content input for this Effect

Exceptions
IllegalArgumentException:
if contentInput is null
setGaussianHeightback to summary
public void setGaussianHeight(float h)
setGaussianRadiusback to summary
public void setGaussianRadius(float r)
setGaussianWidthback to summary
public void setGaussianWidth(float w)
setOffsetXback to summary
public void setOffsetX(int xoff)

Sets the offset in the x direction, in pixels.

      Min: Integer.MIN_VALUE
      Max: Integer.MAX_VALUE
  Default: 0
 Identity: 0
Parameters
xoff:int

the offset in the x direction, in pixels

setOffsetYback to summary
public void setOffsetY(int yoff)

Sets the offset in the y direction, in pixels.

      Min: Integer.MIN_VALUE
      Max: Integer.MAX_VALUE
  Default: 0
 Identity: 0
Parameters
yoff:int

the offset in the y direction, in pixels

setRadiusback to summary
public void setRadius(float radius)

Sets the radius of the shadow blur kernel.

      Min:   0.0
      Max: 127.0
  Default:  10.0
 Identity:   0.0
Parameters
radius:float

the radius of the shadow blur kernel

Exceptions
IllegalArgumentException:
if radius is outside the allowable range
setShadowModeback to summary
public void setShadowMode(AbstractShadow.ShadowMode mode)
setShadowSourceInputback to summary
public void setShadowSourceInput(Effect shadowSourceInput)

Sets the shadow source input for this Effect.

Parameters
shadowSourceInput:Effect

the shadow source input for this Effect

Exceptions
IllegalArgumentException:
if shadowSourceInput is null
setSpreadback to summary
public void setSpread(float spread)

Sets the spread of the shadow effect. The spread is the portion of the radius where the contribution of the source material will be 100%. The remaining portion of the radius will have a contribution controlled by the Gaussian kernel. A spread of 0.0 will result in a pure Gaussian distribution of the shadow. A spread of 1.0 will result in a solid growth outward of the source material opacity to the limit of the radius with a very sharp cutoff to transparency at the radius.

      Min: 0.0
      Max: 1.0
  Default: 0.0
 Identity: 0.0
Parameters
spread:float

the spread of the shadow effect

Exceptions
IllegalArgumentException:
if spread is outside the allowable range