- java.lang.Object
-
- javafx.scene.effect.Effect
-
- javafx.scene.effect.Blend
-
public class Blend extends Effect
使用预定义的BlendMode之一将两个输入组合在一起的效果。例:
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);以上代码产生以下内容:

- 从以下版本开始:
- JavaFX 2.0
-
-
Property Summary
Properties Type Property 描述 ObjectProperty<Effect>bottomInput这个Blend操作的底部输入。ObjectProperty<BlendMode>modeBlendMode用于将两个输入混合在一起。DoublePropertyopacity不透明度值,它在混合前用顶部输入进行调制。ObjectProperty<Effect>topInput这是Blend操作的顶部输入。
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 ObjectProperty<Effect>bottomInputProperty()这个Blend操作的底部输入。EffectgetBottomInput()获取属性bottomInput的值。BlendModegetMode()获取属性模式的值。doublegetOpacity()获取属性不透明度的值。EffectgetTopInput()获取属性topInput的值。ObjectProperty<BlendMode>modeProperty()BlendMode用于将两个输入混合在一起。DoublePropertyopacityProperty()不透明度值,它在混合前用顶部输入进行调制。voidsetBottomInput(Effect value)设置属性bottomInput的值。voidsetMode(BlendMode value)设置属性模式的值。voidsetOpacity(double value)设置属性不透明度的值。voidsetTopInput(Effect value)设置属性topInput的值。ObjectProperty<Effect>topInputProperty()这个Blend操作的最大输入。
-
-
-
Property Detail
-
mode
public final ObjectProperty<BlendMode> modeProperty
BlendMode用于将两个输入混合在一起。Min: n/a Max: n/a Default: BlendMode.SRC_OVER Identity: n/a- Default value:
- SRC_OVER
- 另请参见:
-
getMode(),setMode(BlendMode)
-
opacity
public final DoubleProperty opacityProperty
不透明度值,它在混合前用顶部输入进行调制。Min: 0.0 Max: 1.0 Default: 1.0 Identity: 1.0- Default value:
- 1.0
- 另请参见:
-
getOpacity(),setOpacity(double)
-
bottomInput
public final ObjectProperty<Effect> bottomInputProperty
这个Blend操作的底部输入。 如果设置为null或未指定,则将使用连接Effect的Node的图形图像作为输入。- Default value:
- 空值
- 另请参见:
-
getBottomInput(),setBottomInput(Effect)
-
topInput
public final ObjectProperty<Effect> topInputProperty
这是Blend操作的顶部输入。 如果设置为null或未指定,则将使用连接Effect的Node的图形图像作为输入。- Default value:
- 空值
- 另请参见:
-
getTopInput(),setTopInput(Effect)
-
-
构造方法详细信息
-
Blend
public Blend()
使用默认参数创建Blend的新实例。
-
Blend
public Blend(BlendMode mode)
使用指定的模式创建Blend的新实例。- 参数
-
mode-BlendMode用于将两个输入混合在一起 - 从以下版本开始:
- JavaFX 2.1
-
-
方法详细信息
-
setMode
public final void setMode(BlendMode value)
设置属性模式的值。- Property description:
-
BlendMode用于将两个输入混合在一起。Min: n/a Max: n/a Default: BlendMode.SRC_OVER Identity: n/a - Default value:
- SRC_OVER
-
getMode
public final BlendMode getMode()
获取属性模式的值。- Property description:
-
BlendMode用于将两个输入混合在一起。Min: n/a Max: n/a Default: BlendMode.SRC_OVER Identity: n/a - Default value:
- SRC_OVER
-
modeProperty
public final ObjectProperty<BlendMode> modeProperty()
BlendMode用于将两个输入混合在一起。Min: n/a Max: n/a Default: BlendMode.SRC_OVER Identity: n/a- Default value:
- SRC_OVER
- 另请参见:
-
getMode(),setMode(BlendMode)
-
setOpacity
public final void setOpacity(double value)
设置属性不透明度的值。- Property description:
-
不透明度值,它在混合前用顶部输入进行调制。
Min: 0.0 Max: 1.0 Default: 1.0 Identity: 1.0 - Default value:
- 1.0
-
getOpacity
public final double getOpacity()
获取属性不透明度的值。- Property description:
-
不透明度值,它在混合前用顶部输入进行调制。
Min: 0.0 Max: 1.0 Default: 1.0 Identity: 1.0 - Default value:
- 1.0
-
opacityProperty
public final DoubleProperty opacityProperty()
不透明度值,它在混合前用顶部输入进行调制。Min: 0.0 Max: 1.0 Default: 1.0 Identity: 1.0- Default value:
- 1.0
- 另请参见:
-
getOpacity(),setOpacity(double)
-
setBottomInput
public final void setBottomInput(Effect value)
设置属性bottomInput的值。- Property description:
-
这个
Blend操作的底部输入。 如果设置为null或未指定,则将使用连接Effect的Node的图形图像作为输入。 - Default value:
- 空值
-
getBottomInput
public final Effect getBottomInput()
获取属性bottomInput的值。- Property description:
-
这个
Blend操作的底部输入。 如果设置为null或未指定,则将使用连接Effect的Node的图形图像作为输入。 - Default value:
- 空值
-
bottomInputProperty
public final ObjectProperty<Effect> bottomInputProperty()
这个Blend操作的底部输入。 如果设置为null或未指定,则连接Effect的Node的图形图像将用作输入。- Default value:
- 空值
- 另请参见:
-
getBottomInput(),setBottomInput(Effect)
-
setTopInput
public final void setTopInput(Effect value)
设置属性topInput的值。- Property description:
-
这个
Blend操作的顶部输入。 如果设置为null或未指定,则将使用连接Effect的Node的图形图像作为输入。 - Default value:
- 空值
-
getTopInput
public final Effect getTopInput()
获取属性topInput的值。- Property description:
-
这是
Blend操作的顶部输入。 如果设置为null或未指定,则将使用连接Effect的Node的图形图像作为输入。 - Default value:
- 空值
-
topInputProperty
public final ObjectProperty<Effect> topInputProperty()
这是Blend操作的顶部输入。 如果设置为null,或未指定,则将使用Effect附加的Node的图形图像作为输入。- Default value:
- 空值
- 另请参见:
-
getTopInput(),setTopInput(Effect)
-
-