APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.scenario.effect

public Class GeneralShadow

extends DelegateEffect
Class Inheritance

A blurred shadow effect using either a Gaussian convolution or a Box filter kernel, with a configurable radius and shadow color. Only the alpha channel of the input is used to create the shadow effect. The alpha value of each pixel from the result of the blur operation is modulated with the specified shadow color to produce the resulting image.

Field Summary

Modifier and TypeField and Description
private AbstractShadow

Constructor Summary

AccessConstructor and Description
public
GeneralShadow()

Constructs a new GeneralShadow effect, with the default blur radius (10.0), using the default input for source data.

public
GeneralShadow(Effect
the input Effect used to create the shadow
input
)

Constructs a new GeneralShadow effect, with the default blur radius (10.0).

Method Summary

Modifier and TypeMethod and Description
public Color4f

Returns:

the shadow color
getColor
()

Returns the shadow color.

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 final Effect

Returns:

the shadow source input for this Effect
getInput
()

Returns the shadow source input for this Effect.

public float

Returns:

the radius of the Gaussian kernel
getRadius
()

Returns the radius of the Gaussian kernel.

public AbstractShadow.ShadowMode
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
public void
public void
public void
setInput(Effect
the shadow source input for this Effect
input
)

Sets the shadow source input for this Effect.

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

Sets the radius of the shadow blur kernel.

public void
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:
filtergetAccelTypegetBoundsgetDirtyRegionsreducesOpaquePixelstransformuntransform

Field Detail

shadowback to summary
private AbstractShadow shadow

Constructor Detail

GeneralShadowback to summary
public GeneralShadow()

Constructs a new GeneralShadow effect, with the default blur radius (10.0), using the default input for source data. This is a shorthand equivalent to:

    new GeneralShadow(DefaultInput)
GeneralShadowback to summary
public GeneralShadow(Effect input)

Constructs a new GeneralShadow effect, with the default blur radius (10.0).

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

Parameters
input:Effect

the input Effect used to create the shadow

Method Detail

getColorback to summary
public Color4f getColor()

Returns the shadow color.

Returns:Color4f

the shadow color

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.

Annotations
@Override
getGaussianHeightback to summary
public float getGaussianHeight()
getGaussianRadiusback to summary
public float getGaussianRadius()
getGaussianWidthback to summary
public float getGaussianWidth()
getInputback to summary
public final Effect getInput()

Returns the shadow source input for this Effect.

Returns:Effect

the shadow source input for this Effect

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()
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
setGaussianHeightback to summary
public void setGaussianHeight(float h)
setGaussianRadiusback to summary
public void setGaussianRadius(float r)
setGaussianWidthback to summary
public void setGaussianWidth(float w)
setInputback to summary
public void setInput(Effect input)

Sets the shadow source input for this Effect.

Parameters
input:Effect

the shadow source input for this Effect

Exceptions
IllegalArgumentException:
if input is null
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)
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