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

public Class InnerShadow

extends DelegateEffect
Class Inheritance
Imports
com.sun.javafx.geom.Point2D, .BaseBounds, com.sun.javafx.geom.transform.BaseTransform

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

Field Summary

Modifier and TypeField and Description
private final Blend
private final InvertMask
private AbstractShadow

Constructor Summary

AccessConstructor and Description
public
InnerShadow()

Constructs a new InnerShadow 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
InnerShadow(Effect
the single input Effect
input
)

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

public
InnerShadow(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 InnerShadow 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 BaseBounds
getBounds(BaseTransform
the transform the effect will be viewed under
transform
,
Effect
the default input Effect to be used in all cases where a filter has a null input
defaultInput
)

Overrides com.sun.scenario.effect.DelegateEffect.getBounds.

Returns the bounding box that will be affected by this filter operation when viewed under the specified transform, given its list of input Effects and the specified defaultInput effect.

public float

Returns:

the choke of the shadow effect
getChoke
()

Gets the choke of the shadow effect.

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 void
setChoke(float
the choke of the shadow effect
choke
)

Sets the choke 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 to a specific Effect or to the default input if input is null.

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 to a specific Effect or to the default input if input is null.

public Point2D
transform(Point2D
the point in the coordinate space of the primary content input to be transformed
p
,
Effect
the default input Effect to be used in all cases where a filter has a null input
defaultInput
)

Overrides com.sun.scenario.effect.DelegateEffect.transform.

Transform the specified point p from the coordinate space of the primary content input to the coordinate space of the effect output.

public Point2D
untransform(Point2D
the point in the coordinate space of the result output to be transformed
p
,
Effect
the default input Effect to be used in all cases where a filter has a null input
defaultInput
)

Overrides com.sun.scenario.effect.DelegateEffect.untransform.

Transform the specified point p from the coordinate space of the output of the effect into the coordinate space of the primary content input.

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

Field Detail

blendback to summary
private final Blend blend
invertback to summary
private final InvertMask invert
shadowback to summary
private AbstractShadow shadow

Constructor Detail

InnerShadowback to summary
public InnerShadow()

Constructs a new InnerShadow 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 InnerShadow(DefaultInput, DefaultInput)
InnerShadowback to summary
public InnerShadow(Effect input)

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

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

the single input Effect

InnerShadowback to summary
public InnerShadow(Effect shadowSourceInput, Effect contentInput)

Constructs a new InnerShadow 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

getBoundsback to summary
public BaseBounds getBounds(BaseTransform transform, Effect defaultInput)

Overrides com.sun.scenario.effect.DelegateEffect.getBounds.

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

Returns the bounding box that will be affected by this filter operation when viewed under the specified transform, given its list of input Effects and the specified defaultInput effect. Note that the returned bounds can be smaller or larger than one or more of the inputs.

Parameters
transform:BaseTransform

the transform the effect will be viewed under

defaultInput:Effect

the default input Effect to be used in all cases where a filter has a null input

Returns:BaseBounds

the bounding box of this filter

Annotations
@Override
getChokeback to summary
public float getChoke()

Gets the choke of the shadow effect.

Returns:float

the choke of the shadow effect

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

setChokeback to summary
public void setChoke(float choke)

Sets the choke of the shadow effect. The choke 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 choke of 0.0 will result in a pure Gaussian distribution of the shadow. A choke of 1.0 will result in a solid growth inward of the shadow from the edges to the limit of the radius with a very sharp cutoff to transparency inside the radius.

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

the choke of the shadow effect

Exceptions
IllegalArgumentException:
if choke is outside the allowable range
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 to a specific Effect or to the default input if input is null.

Parameters
contentInput:Effect

the content input for this Effect

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 to a specific Effect or to the default input if input is null.

Parameters
shadowSourceInput:Effect

the shadow source input for this Effect

transformback to summary
public Point2D transform(Point2D p, Effect defaultInput)

Overrides com.sun.scenario.effect.DelegateEffect.transform.

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

Transform the specified point p from the coordinate space of the primary content input to the coordinate space of the effect output. In essence, this method asks the question "Which output coordinate is most affected by the data at the specified coordinate in the primary source input?"

The definition of which input represents the primary content input and how the coordinate space of that input compares to the coordinate space of the result varies from effect to effect. Note that some effects may have a reasonable definition of how to map source coordinates to destination coordinates, but not the reverse. In particular, effects which map source coordinates discontiguously into the result may have several output coordinates that are affected by a given input coordinate and may choose to return one of many equally valid answers, or an undefined result such as NaN, or some other anomalous value. Most effects perform simple transformations of the color of each pixel and so represent an identity transform and return the point unchanged.

Parameters
p:Point2D

the point in the coordinate space of the primary content input to be transformed

defaultInput:Effect

the default input Effect to be used in all cases where a filter has a null input

Returns:Point2D

the transformed point in the coordinate space of the result

Annotations
@Override
untransformback to summary
public Point2D untransform(Point2D p, Effect defaultInput)

Overrides com.sun.scenario.effect.DelegateEffect.untransform.

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

Transform the specified point p from the coordinate space of the output of the effect into the coordinate space of the primary content input. In essence, this method asks the question "Which source coordinate contributes most to the definition of the output at the specified coordinate?"

The definition of which input represents the primary content input and how the coordinate space of that input compares to the coordinate space of the result varies from effect to effect. Note that some effects may have a reasonable definition of how to map destination coordinates back to source coordinates, but not the reverse. In particular, effects which produce entirely synthetic results not based on any content input may not be able to give a meaningful result to this query and may return undefined coordinates such as 0, Infinity, or NaN. Most effects perform simple transformations of the color of each pixel and so represent an identity transform and return the point unchanged.

Parameters
p:Point2D

the point in the coordinate space of the result output to be transformed

defaultInput:Effect

the default input Effect to be used in all cases where a filter has a null input

Returns:Point2D

the untransformed point in the coordinate space of the primary content input

Annotations
@Override