public class DropShadow extends Effect
Example:
DropShadow dropShadow = new DropShadow();
dropShadow.setRadius(5.0);
dropShadow.setOffsetX(3.0);
dropShadow.setOffsetY(3.0);
dropShadow.setColor(Color.color(0.4, 0.5, 0.5)); *
Text text = new Text();
text.setEffect(dropShadow);
text.setCache(true);
text.setX(10.0);
text.setY(70.0);
text.setFill(Color.web("0x3b596d"));
text.setText("JavaFX drop shadow...");
text.setFont(Font.font(null, FontWeight.BOLD, 40));
DropShadow dropShadow2 = new DropShadow();
dropShadow2.setOffsetX(6.0);
dropShadow2.setOffsetY(4.0);
Circle circle = new Circle();
circle.setEffect(dropShadow2);
circle.setCenterX(50.0);
circle.setCenterY(125.0);
circle.setRadius(30.0);
circle.setFill(Color.STEELBLUE);
circle.setCache(true);
The code above produces the following:
Constructor and Description |
---|
DropShadow()
Creates a new instance of DropShadow with default parameters.
|
DropShadow(BlurType blurType,
Color color,
double radius,
double spread,
double offsetX,
double offsetY)
Creates a new instance of DropShadow with the specified blurType, color,
radius, spread, offsetX and offsetY.
|
DropShadow(double radius,
Color color)
Creates a new instance of DropShadow with specified radius and color.
|
DropShadow(double radius,
double offsetX,
double offsetY,
Color color)
Creates a new instance of DropShadow with the specified radius, offsetX,
offsetY and color.
|
impl_effectDirtyProperty, impl_getImpl, impl_isEffectDirty, impl_sync
public DropShadow()
public DropShadow(double radius, Color color)
radius
- the radius of the shadow blur kernelcolor
- the shadow Color
public DropShadow(double radius, double offsetX, double offsetY, Color color)
radius
- the radius of the shadow blur kerneloffsetX
- the shadow offset in the x directionoffsetY
- the shadow offset in the y directioncolor
- the shadow Color
public DropShadow(BlurType blurType, Color color, double radius, double spread, double offsetX, double offsetY)
blurType
- the algorithm used to blur the shadowcolor
- the shadow Color
radius
- the radius of the shadow blur kernelspread
- the portion of the radius where the contribution of
the source material will be 100%offsetX
- the shadow offset in the x directionoffsetY
- the shadow offset in the y directionpublic final void setInput(Effect value)
public final Effect getInput()
public final ObjectProperty<Effect> inputProperty()
public final void setRadius(double value)
public final double getRadius()
public final DoubleProperty radiusProperty()
public final void setWidth(double value)
public final double getWidth()
public final DoubleProperty widthProperty()
public final void setHeight(double value)
public final double getHeight()
public final DoubleProperty heightProperty()
public final void setBlurType(BlurType value)
public final BlurType getBlurType()
public final ObjectProperty<BlurType> blurTypeProperty()
public final void setSpread(double value)
public final double getSpread()
public final DoubleProperty spreadProperty()
public final void setColor(Color value)
public final Color getColor()
public final ObjectProperty<Color> colorProperty()
public final void setOffsetX(double value)
public final double getOffsetX()
public final DoubleProperty offsetXProperty()
public final void setOffsetY(double value)
public final double getOffsetY()
public final DoubleProperty offsetYProperty()
@Deprecated public BaseBounds impl_getBounds(BaseBounds bounds, BaseTransform tx, Node node, BoundsAccessor boundsAccessor)
Effect
impl_getBounds
in class Effect
@Deprecated public Effect impl_copy()
Copyright © 2020. All rights reserved.