BlendModes.
Example:
Blend blend = new Blend();
blend.setMode(BlendMode.COLOR_BURN);
ColorInput colorInput = new ColorInput();
colorInput.setPaint(Color.STEELBLUE);
colorInput.setX(10);
colorInput.setY(10);
colorInput.setWidth(100);
colorInput.setHeight(180);
blend.setTopInput(colorInput);
Rectangle rect = new Rectangle();
rect.setWidth(220);
rect.setHeight(100);
Stop[] stops = new Stop[]{new Stop(0, Color.LIGHTSTEELBLUE), new Stop(1, Color.PALEGREEN)};
LinearGradient lg = new LinearGradient(0, 0, 0.25, 0.25, true, CycleMethod.REFLECT, stops);
rect.setFill(lg);
Text text = new Text();
text.setX(15);
text.setY(65);
text.setFill(Color.PALEVIOLETRED);
text.setText("COLOR_BURN");
text.setFont(Font.font(null, FontWeight.BOLD, 30));
Group g = new Group();
g.setEffect(blend);
g.getChildren().addAll(rect, text);
The code above produces the following:
| Modifier and Type | Field and Description |
|---|---|
| private ObjectProperty | bottomInput
The bottom input for this |
| private ObjectProperty | mode
The |
| private DoubleProperty | opacity
The opacity value, which is modulated with the top input prior to blending. |
| private ObjectProperty | topInput
The top input for this |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final ObjectProperty | |
| pack-priv boolean | |
| pack-priv Effect | |
| pack-priv Blend | |
| public final Effect | |
| pack-priv BaseBounds | getBounds(BaseBounds bounds, BaseTransform tx, Node node, BoundsAccessor boundsAccessor)
Implements abstract javafx. Returns bounds of given node with applied effect. |
| public final BlendMode | |
| public final double | |
| pack-priv static Blend. | getToolkitMode(BlendMode mode)
Used by Group to convert the FX BlendMode enum value into a Decora value. |
| public final Effect | |
| public final ObjectProperty | |
| public final DoubleProperty | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| private static Blend. | |
| public final ObjectProperty | |
| pack-priv void |
| bottomInput | back to summary |
|---|---|
| private ObjectProperty<Effect> bottomInput The bottom input for this
| |
| mode | back to summary |
|---|---|
| private ObjectProperty<BlendMode> mode The
Min: n/a
Max: n/a
Default: BlendMode.SRC_OVER
Identity: n/a
| |
| opacity | back to summary |
|---|---|
| private DoubleProperty opacity The opacity value, which is modulated with the top input prior to blending.
Min: 0.0
Max: 1.0
Default: 1.0
Identity: 1.0
| |
| topInput | back to summary |
|---|---|
| private ObjectProperty<Effect> topInput The top input for this
| |
| Blend | back to summary |
|---|---|
| public Blend() Creates a new instance of Blend with default parameters. | |
| Blend | back to summary |
|---|---|
| public Blend(BlendMode mode) Creates a new instance of Blend with the specified mode.
| |
| Blend | back to summary |
|---|---|
| public Blend(BlendMode mode, Effect bottomInput, Effect topInput) Creates a new instance of Blend with the specified mode and bottom and top inputs. | |
| bottomInputProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| checkChainContains | back to summary |
|---|---|
| pack-priv boolean checkChainContains(Effect e) Implements abstract javafx.
| |
| copy | back to summary |
|---|---|
| pack-priv Effect copy() Implements abstract javafx.
| |
| createPeer | back to summary |
|---|---|
| pack-priv Blend createPeer() Implements abstract javafx.
| |
| getBottomInput | back to summary |
|---|---|
| public final Effect getBottomInput() | |
| getBounds | back to summary |
|---|---|
| pack-priv BaseBounds getBounds(BaseBounds bounds, BaseTransform tx, Node node, BoundsAccessor boundsAccessor) Implements abstract javafx. Doc from javafx. Returns bounds of given node with applied effect. We *never* pass null in as a bounds. This method will NOT take a null bounds object. The returned value may be the same bounds object passed in, or it may be a new object.
| |
| getMode | back to summary |
|---|---|
| public final BlendMode getMode() | |
| getOpacity | back to summary |
|---|---|
| public final double getOpacity() | |
| getToolkitMode | back to summary |
|---|---|
| pack-priv static Blend. Used by Group to convert the FX BlendMode enum value into a Decora value. | |
| getTopInput | back to summary |
|---|---|
| public final Effect getTopInput() | |
| modeProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| opacityProperty | back to summary |
|---|---|
| public final DoubleProperty opacityProperty() | |
| setBottomInput | back to summary |
|---|---|
| public final void setBottomInput(Effect value) | |
| setMode | back to summary |
|---|---|
| public final void setMode(BlendMode value) | |
| setOpacity | back to summary |
|---|---|
| public final void setOpacity(double value) | |
| setTopInput | back to summary |
|---|---|
| public final void setTopInput(Effect value) | |
| toPGMode | back to summary |
|---|---|
| private static Blend. | |
| topInputProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| update | back to summary |
|---|---|
| pack-priv void update() Implements abstract javafx.
| |