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

public Class Reflection

extends CoreEffect<RenderState>
Class Inheritance
Imports
com.sun.javafx.geom.Point2D, .BaseBounds, .DirtyRegionContainer, .DirtyRegionPool, .RectBounds, .Rectangle, com.sun.javafx.geom.transform.BaseTransform, com.sun.scenario.effect.impl.state.RenderState

An effect that renders a reflected version of the input below the actual input content.

Field Summary

Modifier and TypeField and Description
private float
private float
private float
private float

Constructor Summary

AccessConstructor and Description
public
Reflection()

Constructs a new Reflection effect with default values, using the default input for source data.

public
Reflection(Effect
the single input Effect
input
)

Constructs a new Reflection effect with default values.

Method Summary

Modifier and TypeMethod and Description
public float

Returns:

the bottom opacity value
getBottomOpacity
()

Returns the bottom opacity value, which is the opacity of the reflection at its bottom extreme.

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.FilterEffect.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 DirtyRegionContainer
getDirtyRegions(Effect
the default input Effect to be used in all cases where a filter has a null input
defaultInput
,
DirtyRegionPool
the pool of dirty regions
regionPool
)

Overrides com.sun.scenario.effect.Effect.getDirtyRegions.

Returns the dirty region container containing dirty regions affected by this filter operation.

public float

Returns:

the fraction value
getFraction
()

Returns the fraction of the input that is visible in the reflection.

public final Effect

Returns:

the input for this Effect
getInput
()

Returns the input for this Effect.

public RenderState
getRenderState(FilterContext
the context object that would be used by the Renderer if this call is preparing for a render operation, or null
fctx
,
BaseTransform
the transform for the output of this operation
transform
,
Rectangle
the clip rectangle that may restrict this operation, or null
outputClip
,
Object
the rendering helper object that can be used to shortcut this operation under certain conditions, or null
renderHelper
,
Effect
the Effect to be used in place of any null inputs
defaultInput
)

Implements abstract com.sun.scenario.effect.FilterEffect.getRenderState.

Returns the object representing the rendering strategy and state for the filter operation characterized by the specified arguments.

public float

Returns:

the top offset adjustment
getTopOffset
()

Returns the top offset adjustment, which is the distance between the bottom of the input and the top of the reflection.

public float

Returns:

the top opacity value
getTopOpacity
()

Returns the top opacity value, which is the opacity of the reflection at its top extreme.

public boolean
reducesOpaquePixels()

Implements abstract com.sun.scenario.effect.Effect.reducesOpaquePixels.

Whether an opacity for any pixel is different (lower) than the corresponding pixel in the default input.

public void
setBottomOpacity(float
the bottom opacity value
bottomOpacity
)

Sets the bottom opacity value, which is the opacity of the reflection at its bottom extreme.

public void
setFraction(float
the fraction of the input that is visible in the reflection
fraction
)

Sets the fraction of the input that is visible in the reflection.

public void
setInput(Effect
the input for this Effect
input
)

Sets the input for this Effect to a specific Effect or to the default input if input is null.

public void
setTopOffset(float
the top offset adjustment
topOffset
)

Sets the top offset adjustment, which is the distance between the bottom of the input and the top of the reflection.

public void
setTopOpacity(float
the top opacity value
topOpacity
)

Sets the top opacity value, which is the opacity of the reflection at its top extreme.

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.FilterEffect.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.FilterEffect.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.CoreEffect:
filterImageDatasgetAccelTypegetPeerupdatePeerKeyupdatePeerKey

Field Detail

bottomOpacityback to summary
private float bottomOpacity
fractionback to summary
private float fraction
topOffsetback to summary
private float topOffset
topOpacityback to summary
private float topOpacity

Constructor Detail

Reflectionback to summary
public Reflection()

Constructs a new Reflection effect with default values, using the default input for source data. This is a shorthand equivalent to:

    new Reflection(DefaultInput)
Reflectionback to summary
public Reflection(Effect input)

Constructs a new Reflection effect with default values.

Parameters
input:Effect

the single input Effect

Method Detail

getBottomOpacityback to summary
public float getBottomOpacity()

Returns the bottom opacity value, which is the opacity of the reflection at its bottom extreme.

Returns:float

the bottom opacity value

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

Overrides com.sun.scenario.effect.FilterEffect.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
getDirtyRegionsback to summary
public DirtyRegionContainer getDirtyRegions(Effect defaultInput, DirtyRegionPool regionPool)

Overrides com.sun.scenario.effect.Effect.getDirtyRegions.

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

Returns the dirty region container containing dirty regions affected by this filter operation.

Parameters
defaultInput:Effect

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

regionPool:DirtyRegionPool

the pool of dirty regions

Returns:DirtyRegionContainer

the dirty region container

Annotations
@Override
getFractionback to summary
public float getFraction()

Returns the fraction of the input that is visible in the reflection.

Returns:float

the fraction value

getInputback to summary
public final Effect getInput()

Returns the input for this Effect.

Returns:Effect

the input for this Effect

getRenderStateback to summary
public RenderState getRenderState(FilterContext fctx, BaseTransform transform, Rectangle outputClip, Object renderHelper, Effect defaultInput)

Implements abstract com.sun.scenario.effect.FilterEffect.getRenderState.

Doc from com.sun.scenario.effect.FilterEffect.getRenderState.

Returns the object representing the rendering strategy and state for the filter operation characterized by the specified arguments. This call can also be used to get a state object for non-rendering cases like querying the bounds of an operation in which case the FilterContext object may be null. outputClip and renderHelper may always be null just as they may be null for a given filter operation.

Parameters
fctx:FilterContext

the context object that would be used by the Renderer if this call is preparing for a render operation, or null

transform:BaseTransform

the transform for the output of this operation

outputClip:Rectangle

the clip rectangle that may restrict this operation, or null

renderHelper:Object

the rendering helper object that can be used to shortcut this operation under certain conditions, or null

defaultInput:Effect

the Effect to be used in place of any null inputs

Annotations
@Override
getTopOffsetback to summary
public float getTopOffset()

Returns the top offset adjustment, which is the distance between the bottom of the input and the top of the reflection.

Returns:float

the top offset adjustment

getTopOpacityback to summary
public float getTopOpacity()

Returns the top opacity value, which is the opacity of the reflection at its top extreme.

Returns:float

the top opacity value

reducesOpaquePixelsback to summary
public boolean reducesOpaquePixels()

Implements abstract com.sun.scenario.effect.Effect.reducesOpaquePixels.

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

Whether an opacity for any pixel is different (lower) than the corresponding pixel in the default input. It is always safe to return true from this method, though the consequences may be that the caller chooses to not utilize a planned optimization.

Returns:boolean

true if this effect may reduce opacity of some pixels of one of it's input (and thus the default input) or it's relevant input(s) might have reduced opaque pixels of the default input already.

Annotations
@Override
setBottomOpacityback to summary
public void setBottomOpacity(float bottomOpacity)

Sets the bottom opacity value, which is the opacity of the reflection at its bottom extreme.

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

the bottom opacity value

Exceptions
IllegalArgumentException:
if bottomOpacity is outside the allowable range
setFractionback to summary
public void setFraction(float fraction)

Sets the fraction of the input that is visible in the reflection. For example, a value of 0.5 means that only the bottom half of the input will be visible in the reflection.

      Min: 0.0
      Max: 1.0
  Default: 0.75
 Identity: 1.0
Parameters
fraction:float

the fraction of the input that is visible in the reflection

Exceptions
IllegalArgumentException:
if fraction is outside the allowable range
setInputback to summary
public void setInput(Effect input)

Sets the input for this Effect to a specific Effect or to the default input if input is null.

Parameters
input:Effect

the input for this Effect

setTopOffsetback to summary
public void setTopOffset(float topOffset)

Sets the top offset adjustment, which is the distance between the bottom of the input and the top of the reflection.

      Min: n/a
      Max: n/a
  Default: 0.0
 Identity: 0.0
Parameters
topOffset:float

the top offset adjustment

setTopOpacityback to summary
public void setTopOpacity(float topOpacity)

Sets the top opacity value, which is the opacity of the reflection at its top extreme.

      Min: 0.0
      Max: 1.0
  Default: 0.5
 Identity: 1.0
Parameters
topOpacity:float

the top opacity value

Exceptions
IllegalArgumentException:
if topOpacity is outside the allowable range
transformback to summary
public Point2D transform(Point2D p, Effect defaultInput)

Overrides com.sun.scenario.effect.FilterEffect.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.FilterEffect.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