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

Profile: desktop, common

Overview

An effect that provides non-affine transformation of the input content. Most typically PerspectiveTransform is used to provide a "faux" three-dimensional effect for otherwise two-dimensional content.

A perspective transformation is capable of mapping an arbitrary quadrilateral into another arbitrary quadrilateral, while preserving the straightness of lines. Unlike an affine transformation, the parallelism of lines in the source is not necessarily preserved in the output.

Note that this effect does not adjust the coordinates of input events or any methods that measure containment on a Node. The results of mouse picking and the containment methods are undefined when a Node has a PerspectiveTransform effect in place.

the code:

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

Group {
    effect: PerspectiveTransform {
        ulx:  10 uly: 10
        urx: 310 ury: 40
        lrx: 310 lry: 60
        llx:  10 lly: 90
    }
    cache: true
    content: [
        Rectangle {
            x: 10 y: 10
            width: 280
            height: 80
            fill: Color.BLUE
        },
        Text {
            x: 20 y: 65
            content: "Perspective"
            fill: Color.YELLOW
            font: Font.font(null, FontWeight.BOLD, 36);
        },
    ]
}

produces:

Profile: desktop

Variable Summary

accessnametypeCan ReadCan InitCan WriteDefault Valuedescription
publicinputEffectnull

The input for this Effect.

The input for this 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.

null  
publicllxNumber0.0

The x coordinate of the output location onto which the lower left corner of the source is mapped.

publicllyNumber0.0

The y coordinate of the output location onto which the lower left corner of the source is mapped.

publiclrxNumber0.0

The x coordinate of the output location onto which the lower right corner of the source is mapped.

publiclryNumber0.0

The y coordinate of the output location onto which the lower right corner of the source is mapped.

publiculxNumber0.0

The x coordinate of the output location onto which the upper left corner of the source is mapped.

publiculyNumber0.0

The y coordinate of the output location onto which the upper left corner of the source is mapped.

publicurxNumber0.0

The x coordinate of the output location onto which the upper right corner of the source is mapped.

publicuryNumber0.0

The y coordinate of the output location onto which the upper right corner of the source is mapped.

Inherited Variables

Function Summary

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

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
 
public impl_add(node: Node) : Void
Parameters
node
 
public abstract impl_getImpl() : com.sun.scenario.effect.Effect
Returns
Effect
 
public impl_remove(node: Node) : Void
Parameters
node
 



Spec-Zone.ru - all specs in one place