Spec-Zone .ru
спецификации, руководства, описания, API
|
public class PerspectiveTransform extends Effect
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.
import javafx.scene.*; import javafx.scene.shape.*; import javafx.scene.text.*; import javafx.scene.paint.*; import javafx.scene.effect.*; Group g = new Group(); PerspectiveTransform pt = new PerspectiveTransform(); pt.setUlx(10.0); pt.setUly(10.0); pt.setUrx(310.0); pt.setUry(40.0); pt.setLrx(310.0); pt.setLry(60.0); pt.setLlx(10.0); pt.setLly(90.0); g.setEffect(pt); g.setCache(true); Rectangle r = new Rectangle(); r.setX(10.0); r.setY(10.0); r.setWidth(280.0); r.setHeight(80.0); r.setFill(Color.BLUE); Text t = new Text(); t.setX(20.0); t.setY(65.0); t.setText("Perspective"); t.setFill(Color.YELLOW); t.setFont(Font.font(null, FontWeight.BOLD, 36)); g.getChildren().add(r); g.getChildren().add(t);
Type | Property and Description |
---|---|
ObjectProperty<Effect> |
input
The input for this
Effect . |
DoubleProperty |
llx
The x coordinate of the output location onto which the lower left
corner of the source is mapped.
|
DoubleProperty |
lly
The y coordinate of the output location onto which the lower left
corner of the source is mapped.
|
DoubleProperty |
lrx
The x coordinate of the output location onto which the lower right
corner of the source is mapped.
|
DoubleProperty |
lry
The y coordinate of the output location onto which the lower right
corner of the source is mapped.
|
DoubleProperty |
ulx
The x coordinate of the output location onto which the upper left
corner of the source is mapped.
|
DoubleProperty |
uly
The y coordinate of the output location onto which the upper left
corner of the source is mapped.
|
DoubleProperty |
urx
The x coordinate of the output location onto which the upper right
corner of the source is mapped.
|
DoubleProperty |
ury
The y coordinate of the output location onto which the upper right
corner of the source is mapped.
|
Constructor and Description |
---|
PerspectiveTransform() |
Modifier and Type | Method and Description |
---|---|
Effect |
getInput()
The input for this
Effect . |
double |
getLlx()
The x coordinate of the output location onto which the lower left
corner of the source is mapped.
|
double |
getLly()
The y coordinate of the output location onto which the lower left
corner of the source is mapped.
|
double |
getLrx()
The x coordinate of the output location onto which the lower right
corner of the source is mapped.
|
double |
getLry()
The y coordinate of the output location onto which the lower right
corner of the source is mapped.
|
double |
getUlx()
The x coordinate of the output location onto which the upper left
corner of the source is mapped.
|
double |
getUly()
The y coordinate of the output location onto which the upper left
corner of the source is mapped.
|
double |
getUrx()
The x coordinate of the output location onto which the upper right
corner of the source is mapped.
|
double |
getUry()
The y coordinate of the output location onto which the upper right
corner of the source is mapped.
|
ObjectProperty<Effect> |
inputProperty()
The input for this
Effect . |
DoubleProperty |
llxProperty()
The x coordinate of the output location onto which the lower left
corner of the source is mapped.
|
DoubleProperty |
llyProperty()
The y coordinate of the output location onto which the lower left
corner of the source is mapped.
|
DoubleProperty |
lrxProperty()
The x coordinate of the output location onto which the lower right
corner of the source is mapped.
|
DoubleProperty |
lryProperty()
The y coordinate of the output location onto which the lower right
corner of the source is mapped.
|
void |
setInput(Effect value)
The input for this
Effect . |
void |
setLlx(double value)
The x coordinate of the output location onto which the lower left
corner of the source is mapped.
|
void |
setLly(double value)
The y coordinate of the output location onto which the lower left
corner of the source is mapped.
|
void |
setLrx(double value)
The x coordinate of the output location onto which the lower right
corner of the source is mapped.
|
void |
setLry(double value)
The y coordinate of the output location onto which the lower right
corner of the source is mapped.
|
void |
setUlx(double value)
The x coordinate of the output location onto which the upper left
corner of the source is mapped.
|
void |
setUly(double value)
The y coordinate of the output location onto which the upper left
corner of the source is mapped.
|
void |
setUrx(double value)
The x coordinate of the output location onto which the upper right
corner of the source is mapped.
|
void |
setUry(double value)
The y coordinate of the output location onto which the upper right
corner of the source is mapped.
|
DoubleProperty |
ulxProperty()
The x coordinate of the output location onto which the upper left
corner of the source is mapped.
|
DoubleProperty |
ulyProperty()
The y coordinate of the output location onto which the upper left
corner of the source is mapped.
|
DoubleProperty |
urxProperty()
The x coordinate of the output location onto which the upper right
corner of the source is mapped.
|
DoubleProperty |
uryProperty()
The y coordinate of the output location onto which the upper right
corner of the source is mapped.
|
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)
getUlx()
,
setUlx(double)
getUly()
,
setUly(double)
getUrx()
,
setUrx(double)
getUry()
,
setUry(double)
getLrx()
,
setLrx(double)
getLry()
,
setLry(double)
getLlx()
,
setLlx(double)
getLly()
,
setLly(double)
public final void setInput(Effect value)
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.public final Effect getInput()
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.public final ObjectProperty<Effect> 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 void setUlx(double value)
public final double getUlx()
public final DoubleProperty ulxProperty()
getUlx()
,
setUlx(double)
public final void setUly(double value)
public final double getUly()
public final DoubleProperty ulyProperty()
getUly()
,
setUly(double)
public final void setUrx(double value)
public final double getUrx()
public final DoubleProperty urxProperty()
getUrx()
,
setUrx(double)
public final void setUry(double value)
public final double getUry()
public final DoubleProperty uryProperty()
getUry()
,
setUry(double)
public final void setLrx(double value)
public final double getLrx()
public final DoubleProperty lrxProperty()
getLrx()
,
setLrx(double)
public final void setLry(double value)
public final double getLry()
public final DoubleProperty lryProperty()
getLry()
,
setLry(double)
public final void setLlx(double value)
public final double getLlx()
public final DoubleProperty llxProperty()
getLlx()
,
setLlx(double)
public final void setLly(double value)
public final double getLly()
public final DoubleProperty llyProperty()
getLly()
,
setLly(double)
Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. Use is subject to