public class Reflection extends Effect
Note that the reflection of a Node
with a Reflection
effect installed will not respond to mouse events or the containment
methods on the Node
.
Example:
Reflection reflection = new Reflection();
reflection.setFraction(0.7);
Text text = new Text();
text.setX(10.0);
text.setY(50.0);
text.setCache(true);
text.setText("Reflections on JavaFX...");
text.setFill(Color.web("0x3b596d"));
text.setFont(Font.font(null, FontWeight.BOLD, 40));
text.setEffect(reflection);
The code above produces the following:
Type | Property and Description |
---|---|
DoubleProperty |
bottomOpacity
The bottom opacity value, which is the opacity of the reflection
at its bottom extreme.
|
DoubleProperty |
fraction
The fraction of the input that is visible in the reflection.
|
<any> |
input
The input for this
Effect . |
DoubleProperty |
topOffset
The top offset adjustment, which is the distance between the
bottom of the input and the top of the reflection.
|
DoubleProperty |
topOpacity
The top opacity value, which is the opacity of the reflection
at its top extreme.
|
Effect.EffectInputChangeListener, Effect.EffectInputProperty
Modifier and Type | Field and Description |
---|---|
private DoubleProperty |
bottomOpacity
The bottom opacity value, which is the opacity of the reflection
at its bottom extreme.
|
private DoubleProperty |
fraction
The fraction of the input that is visible in the reflection.
|
private <any> |
input
The input for this
Effect . |
private DoubleProperty |
topOffset
The top offset adjustment, which is the distance between the
bottom of the input and the top of the reflection.
|
private DoubleProperty |
topOpacity
The top opacity value, which is the opacity of the reflection
at its top extreme.
|
Constructor and Description |
---|
Reflection()
Creates a new instance of Reflection with default parameters.
|
Reflection(double topOffset,
double fraction,
double topOpacity,
double bottomOpacity)
Creates a new instance of Reflection with the specified topOffset, fraction,
topOpacity and bottomOpacity.
|
Modifier and Type | Method and Description |
---|---|
DoubleProperty |
bottomOpacityProperty()
The bottom opacity value, which is the opacity of the reflection
at its bottom extreme.
|
(package private) boolean |
checkChainContains(Effect e) |
(package private) Effect |
copy() |
(package private) com.sun.scenario.effect.Reflection |
createPeer() |
DoubleProperty |
fractionProperty()
The fraction of the input that is visible in the reflection.
|
double |
getBottomOpacity()
Gets the value of the property bottomOpacity.
|
(package private) BaseBounds |
getBounds(BaseBounds bounds,
BaseTransform tx,
Node node,
BoundsAccessor boundsAccessor)
Returns bounds of given node with applied effect.
|
private float |
getClampedBottomOpacity() |
private float |
getClampedFraction() |
private float |
getClampedTopOpacity() |
double |
getFraction()
Gets the value of the property fraction.
|
Effect |
getInput()
Gets the value of the property input.
|
double |
getTopOffset()
Gets the value of the property topOffset.
|
double |
getTopOpacity()
Gets the value of the property topOpacity.
|
<any> |
inputProperty()
The input for this
Effect . |
void |
setBottomOpacity(double value)
Sets the value of the property bottomOpacity.
|
void |
setFraction(double value)
Sets the value of the property fraction.
|
void |
setInput(Effect value)
Sets the value of the property input.
|
void |
setTopOffset(double value)
Sets the value of the property topOffset.
|
void |
setTopOpacity(double value)
Sets the value of the property topOpacity.
|
DoubleProperty |
topOffsetProperty()
The top offset adjustment, which is the distance between the
bottom of the input and the top of the reflection.
|
DoubleProperty |
topOpacityProperty()
The top opacity value, which is the opacity of the reflection
at its top extreme.
|
(package private) void |
update() |
containsCycles, effectBoundsChanged, getInputBounds, getKernelSize, getPeer, getShadowBounds, markDirty, sync, transformBounds
public final <any> inputProperty
Effect
.
If set to null
, or left unspecified, a graphical image of
the Node
to which the Effect
is attached will be
used as the input.getInput()
,
setInput(Effect)
public final DoubleProperty topOffsetProperty
Min: n/a Max: n/a Default: 0.0 Identity: 0.0
getTopOffset()
,
setTopOffset(double)
public final DoubleProperty topOpacityProperty
Min: 0.0 Max: 1.0 Default: 0.5 Identity: 1.0
getTopOpacity()
,
setTopOpacity(double)
public final DoubleProperty bottomOpacityProperty
Min: 0.0 Max: 1.0 Default: 0.0 Identity: 1.0
getBottomOpacity()
,
setBottomOpacity(double)
public final DoubleProperty fractionProperty
Min: 0.0 Max: 1.0 Default: 0.75 Identity: 1.0
getFraction()
,
setFraction(double)
private <any> input
Effect
.
If set to null
, or left unspecified, a graphical image of
the Node
to which the Effect
is attached will be
used as the input.private DoubleProperty topOffset
Min: n/a Max: n/a Default: 0.0 Identity: 0.0
private DoubleProperty topOpacity
Min: 0.0 Max: 1.0 Default: 0.5 Identity: 1.0
private DoubleProperty bottomOpacity
Min: 0.0 Max: 1.0 Default: 0.0 Identity: 1.0
private DoubleProperty fraction
Min: 0.0 Max: 1.0 Default: 0.75 Identity: 1.0
public Reflection()
public Reflection(double topOffset, double fraction, double topOpacity, double bottomOpacity)
topOffset
- the distance between the bottom of the input and the top of the reflectionfraction
- the fraction of the input that is visible in the reflectiontopOpacity
- the opacity of the reflection at its top extremebottomOpacity
- the opacity of the reflection at its bottom extremecom.sun.scenario.effect.Reflection createPeer()
createPeer
in class Effect
public final void setInput(Effect value)
public final Effect getInput()
public final <any> inputProperty()
Effect
.
If set to null
, or left unspecified, a graphical image of
the Node
to which the Effect
is attached will be
used as the input.getInput()
,
setInput(Effect)
boolean checkChainContains(Effect e)
checkChainContains
in class Effect
public final void setTopOffset(double value)
public final double getTopOffset()
public final DoubleProperty topOffsetProperty()
Min: n/a Max: n/a Default: 0.0 Identity: 0.0
getTopOffset()
,
setTopOffset(double)
public final void setTopOpacity(double value)
public final double getTopOpacity()
public final DoubleProperty topOpacityProperty()
Min: 0.0 Max: 1.0 Default: 0.5 Identity: 1.0
getTopOpacity()
,
setTopOpacity(double)
public final void setBottomOpacity(double value)
public final double getBottomOpacity()
public final DoubleProperty bottomOpacityProperty()
Min: 0.0 Max: 1.0 Default: 0.0 Identity: 1.0
getBottomOpacity()
,
setBottomOpacity(double)
public final void setFraction(double value)
public final double getFraction()
public final DoubleProperty fractionProperty()
Min: 0.0 Max: 1.0 Default: 0.75 Identity: 1.0
getFraction()
,
setFraction(double)
private float getClampedFraction()
private float getClampedBottomOpacity()
private float getClampedTopOpacity()
BaseBounds getBounds(BaseBounds bounds, BaseTransform tx, Node node, BoundsAccessor boundsAccessor)
Effect