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

public Class Flood

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 rectangular region that is filled ("flooded") with the given paint. This is equivalent to rendering a filled rectangle into an image and using an Identity effect, except that it is more convenient and potentially much more efficient.

Field Summary

Modifier and TypeField and Description
private RectBounds
private Object

Constructor Summary

AccessConstructor and Description
public
Flood(Object
the platform-specific paint object used to flood the region
paint
)

Constructs a new Flood effect using the given platform-specific paint object with an empty bounds for the flood region.

public
Flood(Object
the platform-specific paint object used to flood the region
paint
,
RectBounds
the rectangular area to cover
bounds
)

Constructs a new Flood effect using the given platform-specific paint object to cover the indicated rectangular bounds.

Method Summary

Modifier and TypeMethod and Description
public BaseBounds
getBounds(BaseTransform transform, Effect 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 defaultInput, DirtyRegionPool regionPool)

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

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

public RectBounds
public Object

Returns:

the flood paint
getPaint
()

Returns the platform-specific paint object used to flood the region.

public RenderState
getRenderState(FilterContext fctx, BaseTransform transform, Rectangle outputClip, Object renderHelper, Effect 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 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
public void
setPaint(Object
the flood paint
paint
)

Sets the platform-specific paint object used to flood the region.

public Point2D

Returns:

the undefined point (NaN, NaN)
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

Returns:

the undefined point (NaN, NaN)
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

boundsback to summary
private RectBounds bounds
paintback to summary
private Object paint

Constructor Detail

Floodback to summary
public Flood(Object paint)

Constructs a new Flood effect using the given platform-specific paint object with an empty bounds for the flood region.

Parameters
paint:Object

the platform-specific paint object used to flood the region

Exceptions
IllegalArgumentException:
if paint is null
Floodback to summary
public Flood(Object paint, RectBounds bounds)

Constructs a new Flood effect using the given platform-specific paint object to cover the indicated rectangular bounds.

Parameters
paint:Object

the platform-specific paint object used to flood the region

bounds:RectBounds

the rectangular area to cover

Exceptions
IllegalArgumentException:
if either paint or bounds is null

Method Detail

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.

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.

Annotations
@Override
getFloodBoundsback to summary
public RectBounds getFloodBounds()
getPaintback to summary
public Object getPaint()

Returns the platform-specific paint object used to flood the region.

Returns:Object

the flood paint

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.

Annotations
@Override
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.

Annotations
@Override
setFloodBoundsback to summary
public void setFloodBounds(RectBounds bounds)
setPaintback to summary
public void setPaint(Object paint)

Sets the platform-specific paint object used to flood the region.

Parameters
paint:Object

the flood paint

Exceptions
IllegalArgumentException:
if paint is null
transformback to summary
public Point2D transform(Point2D p, Effect 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. 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?"

Since no source input is used, any output coordinate is equally affected, or unaffected, by any source coordinate so an undefined point (NaN, NaN) is returned.

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 undefined point (NaN, NaN)

Annotations
@Override
untransformback to summary
public Point2D untransform(Point2D p, Effect 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. In essence, this method asks the question "Which source coordinate contributes most to the definition of the output at the specified coordinate?"

Since the Flood effect does not use any source data it returns an undefined coordinate (NaN, NaN) for all requests.

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 undefined point (NaN, NaN)

Annotations
@Override