本文整理匯總了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;
}