本文整理汇总了Java中javafx.scene.text.Text.setEffect方法的典型用法代码示例。如果您正苦于以下问题:Java Text.setEffect方法的具体用法?Java Text.setEffect怎么用?Java Text.setEffect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.text.Text
的用法示例。
在下文中一共展示了Text.setEffect方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: InnerShadowSample
import javafx.scene.text.Text; //导入方法依赖的package包/类
public InnerShadowSample() {
Text sample = new Text(0,100,"Shadow");
sample.setFont(Font.font("Arial Black",80));
sample.setFill(Color.web("#BBBBBB"));
final InnerShadow innerShadow = new InnerShadow();
innerShadow.setRadius(5d);
innerShadow.setOffsetX(2);
innerShadow.setOffsetY(2);
sample.setEffect(innerShadow);
getChildren().add(sample);
// REMOVE ME
setControls(
new SimplePropertySheet.PropDesc("Text Fill", sample.fillProperty()),
new SimplePropertySheet.PropDesc("Inner Shadow Radius", innerShadow.radiusProperty(), 0d,60d),
new SimplePropertySheet.PropDesc("Inner Shadow Offset X", innerShadow.offsetXProperty(), -10d, 10d),
new SimplePropertySheet.PropDesc("Inner Shadow Offset Y", innerShadow.offsetYProperty(), -10d, 10d),
new SimplePropertySheet.PropDesc("Inner Shadow Color", innerShadow.colorProperty())
);
// END REMOVE ME
}
示例2: LettersPane
import javafx.scene.text.Text; //导入方法依赖的package包/类
public LettersPane() {
setId("LettersPane");
setPrefSize(480,480);
setFocusTraversable(true);
setOnMousePressed(new EventHandler<MouseEvent>() {
@Override public void handle(MouseEvent me) {
requestFocus();
me.consume();
}
});
setOnKeyPressed(new EventHandler<KeyEvent>() {
@Override public void handle(KeyEvent ke) {
createLetter(ke.getText());
ke.consume();
}
});
// create press keys text
pressText = new Text("Press Keys");
pressText.setTextOrigin(VPos.TOP);
pressText.setFont(new Font(Font.getDefault().getFamily(), 40));
pressText.setLayoutY(5);
pressText.setFill(Color.rgb(80, 80, 80));
DropShadow effect = new DropShadow();
effect.setRadius(0);
effect.setOffsetY(1);
effect.setColor(Color.WHITE);
pressText.setEffect(effect);
getChildren().add(pressText);
}
示例3: createIconContent
import javafx.scene.text.Text; //导入方法依赖的package包/类
public static Node createIconContent() {
Text sample = new Text("FX");
sample.setFont(Font.font(Font.getDefault().getFamily(), FontWeight.BOLD,60));
sample.setStyle("-fx-font-size: 80px;");
sample.setFill(Color.web("#333333"));
final Reflection reflection = new Reflection();
reflection.setTopOffset(-28d);
reflection.setFraction(0.5);
sample.setEffect(reflection);
return sample;
}
示例4: createIconContent
import javafx.scene.text.Text; //导入方法依赖的package包/类
public static Node createIconContent() {
Text sample = new Text("FX");
sample.setFont(Font.font(Font.getDefault().getFamily(), FontWeight.BOLD,80));
sample.setStyle("-fx-font-size: 80px;");
sample.setFill(Color.web("#aaaaaa"));
final InnerShadow innerShadow = new InnerShadow();
innerShadow.setRadius(4);
innerShadow.setOffsetX(1);
innerShadow.setOffsetY(1);
innerShadow.setColor(Color.web("#333333"));
sample.setEffect(innerShadow);
return sample;
}
示例5: createIconContent
import javafx.scene.text.Text; //导入方法依赖的package包/类
public static Node createIconContent() {
Text sample = new Text("FX");
sample.setFont(Font.font(Font.getDefault().getFamily(), FontWeight.BOLD,80));
sample.setStyle("-fx-font-size: 80px;");
sample.setFill(Color.web("#333333"));
final GaussianBlur GaussianBlur = new GaussianBlur();
GaussianBlur.setRadius(15);
sample.setEffect(GaussianBlur);
return sample;
}
示例6: DropShadowSample
import javafx.scene.text.Text; //导入方法依赖的package包/类
public DropShadowSample() {
Text sample = new Text(0,40,"DropShadow Effect");
sample.setFont(Font.font(Font.getDefault().getFamily(), FontWeight.BOLD,36));
final DropShadow dropShadow = new DropShadow();
sample.setEffect(dropShadow);
getChildren().add(sample);
// REMOVE ME
setControls(
new SimplePropertySheet.PropDesc("Radius", dropShadow.radiusProperty(), 0d, 20d),
new SimplePropertySheet.PropDesc("Offset X", dropShadow.offsetXProperty(), -10d, 10d),
new SimplePropertySheet.PropDesc("Offset Y", dropShadow.offsetYProperty(), -10d, 10d),
new SimplePropertySheet.PropDesc("Spread", dropShadow.spreadProperty(), 0d, 1d),
new SimplePropertySheet.PropDesc("Color", dropShadow.colorProperty())
);
// END REMOVE ME
}
示例7: createIconContent
import javafx.scene.text.Text; //导入方法依赖的package包/类
public static Node createIconContent() {
Text sample = new Text("FX");
sample.setFont(Font.font(Font.getDefault().getFamily(), FontWeight.BOLD,80));
sample.setStyle("-fx-font-size: 80px;");
sample.setFill(Color.web("#333333"));
final DropShadow dropShadow = new DropShadow();
dropShadow.setOffsetX(4);
dropShadow.setOffsetY(6);
dropShadow.setColor(Color.rgb(0,0,0,0.7));
sample.setEffect(dropShadow);
return sample;
}
示例8: init
import javafx.scene.text.Text; //导入方法依赖的package包/类
@Override
protected void init() {
String tooltip = "999";
Text icon = new Text(tooltip);
icon.setFill(Color.BISQUE);
DropShadow ds = new DropShadow();
ds.setOffsetY(3.0F);
ds.setColor(Color.GOLDENROD);
icon.setEffect(ds);
initializeButton(tooltip, icon);
}
示例9: init
import javafx.scene.text.Text; //导入方法依赖的package包/类
@Override
protected void init() {
String tooltip = "Dense";
Text icon = new Text(tooltip);
icon.setFill(Color.BISQUE);
DropShadow ds = new DropShadow();
ds.setOffsetY(3.0F);
ds.setColor(Color.GOLDENROD);
icon.setEffect(ds);
initializeButton(tooltip, icon);
}
示例10: createText
import javafx.scene.text.Text; //导入方法依赖的package包/类
private Text createText(String name) {
//DropShadow effect
DropShadow dropShadow = new DropShadow();
dropShadow.setOffsetX(5);
dropShadow.setOffsetY(5);
//Adding text and DropShadow effect to it
Text text = new Text(name);
text.setFont(Font.font("Courier New", FontWeight.BOLD, 28));
text.setEffect(dropShadow);
return text;
}