public class Blend extends Effect
BlendMode
s.
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:
Constructor and Description |
---|
Blend()
Creates a new instance of Blend with default parameters.
|
Blend(BlendMode mode)
Creates a new instance of Blend with the specified mode.
|
Blend(BlendMode mode,
Effect bottomInput,
Effect topInput)
Creates a new instance of Blend with the specified mode and bottom
and top inputs.
|
Modifier and Type | Method and Description |
---|---|
ObjectProperty<Effect> |
bottomInputProperty() |
Effect |
getBottomInput() |
BlendMode |
getMode() |
double |
getOpacity() |
Effect |
getTopInput() |
Effect |
impl_copy()
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
BaseBounds |
impl_getBounds(BaseBounds bounds,
BaseTransform tx,
Node node,
BoundsAccessor boundsAccessor)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
static Blend.Mode |
impl_getToolkitMode(BlendMode mode)
Deprecated.
This is an internal API that is not intended for use and will be removed in the next version
|
ObjectProperty<BlendMode> |
modeProperty() |
DoubleProperty |
opacityProperty() |
void |
setBottomInput(Effect value) |
void |
setMode(BlendMode value) |
void |
setOpacity(double value) |
void |
setTopInput(Effect value) |
ObjectProperty<Effect> |
topInputProperty() |
impl_effectDirtyProperty, impl_getImpl, impl_isEffectDirty, impl_sync
public Blend()
public Blend(BlendMode mode)
mode
- the BlendMode
used to blend the two inputs togetherpublic Blend(BlendMode mode, Effect bottomInput, Effect topInput)
mode
- the BlendMode
used to blend the two inputs togetherbottomInput
- the bottom input for this Blend
operationtopInput
- the top input for this Blend
operation@Deprecated public static Blend.Mode impl_getToolkitMode(BlendMode mode)
public final void setMode(BlendMode value)
public final BlendMode getMode()
public final ObjectProperty<BlendMode> modeProperty()
public final void setOpacity(double value)
public final double getOpacity()
public final DoubleProperty opacityProperty()
public final void setBottomInput(Effect value)
public final Effect getBottomInput()
public final ObjectProperty<Effect> bottomInputProperty()
public final void setTopInput(Effect value)
public final Effect getTopInput()
public final ObjectProperty<Effect> topInputProperty()
@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.