本文整理汇总了Java中javafx.scene.effect.Reflection.setFraction方法的典型用法代码示例。如果您正苦于以下问题:Java Reflection.setFraction方法的具体用法?Java Reflection.setFraction怎么用?Java Reflection.setFraction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.effect.Reflection
的用法示例。
在下文中一共展示了Reflection.setFraction方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createGridPane
import javafx.scene.effect.Reflection; //导入方法依赖的package包/类
private GridPane createGridPane(Label lblUserName, Label lblPassword, Label lblLanguage, Button btnLogin,
Button btnReset, Button btnRegister) {
GridPane gridPane = new GridPane();
gridPane.setPadding(new Insets(20,20,20,20));
gridPane.setHgap(5);
gridPane.setVgap(5);
gridPane.add(lblUserName, 0, 0);
gridPane.add(txtUserName, 1, 0);
gridPane.add(lblPassword, 0, 1);
gridPane.add(pf, 1, 1);
gridPane.add(btnLogin, 2, 0);
gridPane.add(btnReset, 2, 1);
gridPane.add(lblMessage, 1, 2);
gridPane.add(btnRegister, 2, 2);
gridPane.add(lblLanguage, 0, 3);
gridPane.add(createComboBox(), 1 , 3);
//Reflection for gridPane
Reflection r = new Reflection();
r.setFraction(0.7f);
gridPane.setEffect(r);
return gridPane;
}
示例2: createControls
import javafx.scene.effect.Reflection; //导入方法依赖的package包/类
private void createControls() {
artist = new Label();
artist.setId("artist");
album = new Label();
album.setId("album");
title = new Label();
title.setId("title");
year = new Label();
year.setId("year");
albumCover=new ImageView();
final Reflection reflection = new Reflection();
reflection.setFraction(0.2);
// final URL url = getClass().getResource("resources/defaultAlbum.png");
// final Image image = new Image(url.toString());
// albumCover = new ImageView(image);
// albumCover.setFitWidth(240);
// albumCover.setPreserveRatio(true);
// albumCover.setSmooth(true);
// albumCover.setEffect(reflection);
}
示例3: createIconContent
import javafx.scene.effect.Reflection; //导入方法依赖的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: Clavier
import javafx.scene.effect.Reflection; //导入方法依赖的package包/类
public Clavier(Instru instru) {
this.instru = instru;// l'objet de type Instru prend la valeur de l'objet passé en paramètre
Rectangle fond_clavier = new Rectangle();
fond_clavier.setWidth(400);
fond_clavier.setHeight(200);
fond_clavier.setArcWidth(30);
fond_clavier.setArcHeight(30);
fond_clavier.setFill( // on remplie notre rectangle avec un dégradé
new LinearGradient(0f, 0f, 0f, 1f, true, CycleMethod.NO_CYCLE,
new Stop[] { new Stop(0, Color.web("#333333")), new Stop(1, Color.web("#000000")) }));
Reflection r = new Reflection();// on applique un effet de réflection
r.setFraction(0.25);
r.setBottomOpacity(0);
r.setTopOpacity(0.5);
fond_clavier.setEffect(r);
touches = new Touche[] { new Touche("U", 50, 20, 60, instru), new Touche("I", 128, 20, 62, instru),
new Touche("O", 206, 20, 64, instru), new Touche("P", 284, 20, 65, instru),
new Touche("J", 75, 98, 67, instru), new Touche("K", 153, 98, 69, instru),
new Touche("L", 231, 98, 71, instru), new Touche("M", 309, 98, 72, instru) };
this.setTranslateX(50);
this.setTranslateY(250);
this.getChildren().add(fond_clavier);
for (Touche touche : touches) { // on insère chaque touche une par une.
this.getChildren().add(touche);
}
}
示例5: criaNoAlvo
import javafx.scene.effect.Reflection; //导入方法依赖的package包/类
private void criaNoAlvo() {
// configurar coisas do texto alvo...
alvo = new Text("** Transições **");
alvo.setFont(new Font(60));
// efeitinsss
Reflection efeito = new Reflection();
efeito.setFraction(0.7);
alvo.setEffect(efeito);
alvo.setFill(Color.RED);
raiz.setCenter(alvo);
}
示例6: generateLocationText
import javafx.scene.effect.Reflection; //导入方法依赖的package包/类
/**
* Location String with specified effect, font, and position.
*
* @return Location String with specified effect, font, and position.
*/
private Text generateLocationText()
{
final Reflection reflection = new Reflection();
reflection.setFraction(1.0);
return TextBuilder.create()
.text("Schiaparelli Point, Mars").x(20).y(20)
.font(Font.font(java.awt.Font.SANS_SERIF, 25))
.effect(reflection)
.build();
}
示例7: gaussianBlur
import javafx.scene.effect.Reflection; //导入方法依赖的package包/类
private Node gaussianBlur() {
Text t2 = new Text();
t2.setX(10.0f);
t2.setY(250.0f);
t2.setCache(true);
t2.setText("Gaussian Blur");
t2.setFill(Color.RED);
t2.setFont(Font.font("null", FontWeight.BOLD, 36));
DropShadow shadow = new DropShadow();
shadow.setOffsetY(3.0);
shadow.setOffsetX(3.0);
shadow.setColor(Color.GRAY);
shadow.setInput(new GaussianBlur());
Reflection rf = new Reflection();
rf.setFraction(1.5);
rf.setInput(shadow);
t2.setEffect(rf);
return t2;
}
示例8: initComponents
import javafx.scene.effect.Reflection; //导入方法依赖的package包/类
@Override
public void initComponents()
{
title = new Label(TITLE);
title.setId("title_3");
msg = new Label(MSG);
msg.setId("msg-inicial");
go = new Button("Go!");
go.setId("dark-blue");
vBox = new VBox();
vBox.setAlignment(Pos.CENTER);
vBox.setSpacing(40);
rightPane = new BorderPane();
rightPane.setPrefSize(PrimaryStage.WIDTH, PrimaryStage.HEIGHT);
rightPane.setMinSize(0, 0);
rightPane.setScaleX(1);
rightPane.setId("fundo-padrao");
leftPane = new BorderPane();
leftPane.setPrefSize(PrimaryStage.WIDTH, PrimaryStage.HEIGHT);
leftPane.setMinSize(0, 0);
leftPane.setScaleX(1);
leftPane.setId("fundo-padrao");
topPane = new BorderPane();
topPane.setPrefSize(PrimaryStage.WIDTH, PrimaryStage.HEIGHT);
topPane.setMinSize(0, 0);
topPane.setScaleX(1);
topPane.setId("fundo-padrao");
downPane = new BorderPane();
downPane.setPrefSize(PrimaryStage.WIDTH, PrimaryStage.HEIGHT);
downPane.setMinSize(0, 0);
downPane.setScaleX(1);
downPane.setId("fundo-padrao");
centerPane = new BorderPane();
centerPane.setPrefSize(PrimaryStage.WIDTH, PrimaryStage.HEIGHT);
centerPane.setMinSize(0, 0);
centerPane.setScaleX(1);
centerPane.setId("fundo-padrao");
centerPane.setCenter(vBox);
final DropShadow drop = new DropShadow
(BlurType.GAUSSIAN, Color.WHITE, 5, 1 , 1, 1);
final Reflection r = new Reflection();
r.setFraction(0.5f);
r.setBottomOpacity(0.5);
drop.setInput(r);
title.setEffect(drop);
vBox.getChildren().addAll(title, msg, go);
getChildren().addAll(downPane, leftPane, topPane, rightPane, centerPane);
}
示例9: onPostConstructComponent
import javafx.scene.effect.Reflection; //导入方法依赖的package包/类
@PostConstruct
/**
* The @PostConstruct annotation labels methods executed when the component switch from inactive to active state
* @param arg0
* @param resourceBundle
*/
public void onPostConstructComponent(final FXComponentLayout arg0,
final ResourceBundle resourceBundle) {
String family = "Helvetica";
TextFlow textFlow = new TextFlow();
textFlow.setLayoutX(40);
textFlow.setLayoutY(40);
DropShadow ds = new DropShadow();
ds.setOffsetY(6.0f);
ds.setColor(Color.color(0.4f, 0.4f, 0.4f));
Text text1 = new Text();
text1.setX(5.0f);
text1.setY(140.0f);
text1.setCache(true);
text1.setText("Welcome ");
text1.setFill(Color.GREEN);
text1.setFont(Font.font(null, FontWeight.BOLD, 36));
text1.setEffect(ds);
text1.setTranslateY(10);
Text text2 = new Text();
text2.setEffect(new GaussianBlur());
text2.setCache(true);
text2.setX(10.0f);
text2.setY(270.0f);
text2.setFill(Color.GREEN);
text2.setText("to the ");
text2.setFont(Font.font(null, FontWeight.BOLD, 22));
text2.setTranslateY(50);
Text text3 = new Text();
text3.setX(10.0f);
text3.setY(50.0f);
text3.setCache(true);
text3.setText("Trivadis");
text3.setFill(Color.RED);
text3.setFont(Font.font(null, FontWeight.BOLD, 50));
Reflection r = new Reflection();
r.setFraction(0.7f);
text3.setEffect(r);
text3.setTranslateY(80);
Text text4 = new Text(" TechEvent!");
text4.setFill(Color.RED);
text4.setCache(true);
text4.setFont(Font.font(family, FontWeight.BOLD, 60));
text4.setEffect(new Glow());
text4.setTranslateY(120);
textFlow.getChildren().addAll(text1, text2, text3, text4);
Group group = new Group(textFlow);
tab.getChildren().add(group);
this.log.info("run on start of Demo1Component ");
}