Spec-Zone .ru
спецификации, руководства, описания, API

JavaFX: Bringing Rich Experiences To All the Screens Of Your Life

Profile: desktop, common

Overview

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

the code:

import javafx.scene.*;
import javafx.scene.effect.*;
import javafx.scene.paint.*;
import javafx.scene.shape.*;
import javafx.scene.text.*;

Group {
    content: [
        Text {
            effect: DropShadow { offsetY: 3 color: Color.color(0.4, 0.4, 0.4) };
            cache: true
            x: 10 y: 70
            fill: Color.RED
            content: "JavaFX drop shadow..."
            font: Font.font(null, FontWeight.BOLD, 32);
        },
        Circle {
            effect: DropShadow { offsetY: 4 }
            centerX: 50 centerY: 125
            radius: 30
            fill: Color.ORANGE
            cache: true
        }
    ]
}

produces:

Profile: desktop

Variable Summary

accessnametypeCan ReadCan InitCan WriteDefault Valuedescription
publicblurTypeBlurTypeTHREE_PASS_BOX

The algorithm used to blur the shadow.

The algorithm used to blur the shadow.

       Min: n/a
       Max: n/a
   Default: BlurType.THREE_PASS_BOX
  Identity: n/a
 

THREE_PASS_BOX  
publiccolorColorBLACK

The shadow Color.

The shadow Color.

       Min: n/a
       Max: n/a
   Default: Color.BLACK
  Identity: n/a
 

BLACK  
publicheightNumber21.0

The vertical size of the shadow blur kernel.

The vertical size of the shadow blur kernel. This attribute controls the vetical size of the total area over which the shadow of a single pixel is distributed by the blur algorithm. Values less than 1.0 are not distributed beyond the original pixel and so have no blurring effect on the shadow.

       Min:   0.0
       Max: 255.0
   Default:  21.0
  Identity:  <1.0
 

21.0 &nbsp;
publicoffsetXNumber0.0

The shadow offset in the x direction, in pixels.

The shadow offset in the x direction, in pixels.

       Min: n/a
       Max: n/a
   Default: 0.0
  Identity: 0.0
 

0.0 &nbsp;
publicoffsetYNumber0.0

The shadow offset in the y direction, in pixels.

The shadow offset in the y direction, in pixels.

       Min: n/a
       Max: n/a
   Default: 0.0
  Identity: 0.0
 

0.0 &nbsp;
publicradiusNumber10.0

The radius of the shadow blur kernel.

The radius of the shadow blur kernel. This attribute controls the distance that the shadow is spread to each side of the source pixels. Setting the radius is equivalent to setting both the width and height attributes to a value of (2 * radius + 1).

       Min:   0.0
       Max: 127.0
   Default:  10.0
  Identity:   0.0
 

10.0 &nbsp;
publicspreadNumber0.0

The spread of the shadow.

The spread of the shadow. The spread 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 blur kernel. A spread of 0.0 will result in a distribution of the shadow determined entirely by the blur algorithm. A spread of 1.0 will result in a solid growth outward of the source material opacity to the limit of the radius with a very sharp cutoff to transparency at the radius.

       Min: 0.0
       Max: 1.0
   Default: 0.0
  Identity: 0.0
 

0.0 &nbsp;
publicwidthNumber21.0

The horizontal size of the shadow blur kernel.

The horizontal size of the shadow blur kernel. This attribute controls the horizontal size of the total area over which the shadow of a single pixel is distributed by the blur algorithm. Values less than 1.0 are not distributed beyond the original pixel and so have no blurring effect on the shadow.

       Min:   0.0
       Max: 255.0
   Default:  21.0
  Identity:  <1.0
 

21.0 &nbsp;

Inherited Variables

Function Summary

public impl_getImpl() : com.sun.scenario.effect.Effect
Returns
Effect
&nbsp;

Inherited Functions

javafx.scene.effect.Effect

public getAccelType(config: java.lang.Object) : java.lang.String

Returns a String representing the type of hardware acceleration, if any, that is used when applying this Effect on the given GraphicsConfiguration.

Returns a String representing the type of hardware acceleration, if any, that is used when applying this Effect on the given GraphicsConfiguration. This method is intended for informational or debugging purposes only.

Parameters
config
Returns
String
&nbsp;
public impl_add(node: Node) : Void
Parameters
node
&nbsp;
public abstract impl_getImpl() : com.sun.scenario.effect.Effect
Returns
Effect
&nbsp;
public impl_remove(node: Node) : Void
Parameters
node
&nbsp;