当前位置: 首页>>代码示例>>Java>>正文


Java Reflection类代码示例

本文整理汇总了Java中javafx.scene.effect.Reflection的典型用法代码示例。如果您正苦于以下问题:Java Reflection类的具体用法?Java Reflection怎么用?Java Reflection使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Reflection类属于javafx.scene.effect包,在下文中一共展示了Reflection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ReflectionSample

import javafx.scene.effect.Reflection; //导入依赖的package包/类
public ReflectionSample() {
    super(100,200);
    ImageView sample = new ImageView(BOAT);
    sample.setPreserveRatio(true);
    sample.setFitHeight(100);
    final Reflection reflection = new Reflection();
    sample.setEffect(reflection);
    getChildren().add(sample);
    // REMOVE ME
    setControls(
            new SimplePropertySheet.PropDesc("Reflection Bottom Opacity", reflection.bottomOpacityProperty(), 0d, 1d),
            new SimplePropertySheet.PropDesc("Reflection Top Opacity", reflection.topOpacityProperty(), 0d, 1d),
            new SimplePropertySheet.PropDesc("Reflection Fraction", reflection.fractionProperty(), 0d, 1d),
            new SimplePropertySheet.PropDesc("Reflection Top Offset", reflection.topOffsetProperty(), -10d, 10d)
    );
    // END REMOVE ME
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:18,代码来源:ReflectionSample.java

示例2: wrap

import javafx.scene.effect.Reflection; //导入依赖的package包/类
@Override
protected Node wrap(Node node) {
    HBox box = new HBox();
    box.setMaxWidth(Double.MAX_VALUE);
    box.setAlignment(Pos.CENTER);
    box.setFillHeight(false);

    StackPane stackPane = new StackPane();
    stackPane.setStyle("-fx-background-color: white; -fx-border-color: gray; -fx-border-width: .25px; -fx-padding: 20px;");
    box.getChildren().add(stackPane);

    stackPane.getChildren().add(node);
    stackPane.setEffect(new Reflection());

    return box;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:17,代码来源:HelloWeekDayHeaderView.java

示例3: wrap

import javafx.scene.effect.Reflection; //导入依赖的package包/类
@Override
public Node wrap(Node node) {

    HBox box = new HBox();
    box.setStyle("-fx-padding: 100px;");
    box.setAlignment(Pos.CENTER);
    box.setFillHeight(false);

    StackPane stackPane = new StackPane();
    stackPane.setStyle(
            "-fx-background-color: white; -fx-border-color: gray; -fx-border-width: .25px; -fx-padding: 0 20 0 20;");
    box.getChildren().add(stackPane);

    stackPane.getChildren().add(node);
    stackPane.setEffect(new Reflection());

    return box;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:19,代码来源:HelloTimeScaleView.java

示例4: wrap

import javafx.scene.effect.Reflection; //导入依赖的package包/类
@Override
protected Node wrap(Node node) {
    HBox box = new HBox();
    box.setStyle("-fx-padding: 100px;");
    box.setAlignment(Pos.CENTER);
    box.setFillHeight(false);

    StackPane stackPane = new StackPane();
    stackPane.setStyle(
            "-fx-background-color: white; -fx-border-color: gray; -fx-border-width: .25px; -fx-padding: 0 20 0 20;");
    box.getChildren().add(stackPane);

    stackPane.getChildren().add(node);
    stackPane.setEffect(new Reflection());

    return box;
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:18,代码来源:HelloWeekTimeScaleView.java

示例5: 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;
}
 
开发者ID:LtubSalad,项目名称:voogasalad-ltub,代码行数:23,代码来源:PasswordManager.java

示例6: start

import javafx.scene.effect.Reflection; //导入依赖的package包/类
@Override
public void start(Stage palco) throws Exception {
	final Effect r = new Reflection();
	final VBox raiz = new VBox(30);
	final HBox hbTopo = new HBox(5);
	final TextField txtNome = new TextField();
	final Button btnAcao = new Button("Enviar");
	final Label lblMensagem = new Label();
	raiz.setTranslateX(10);
	raiz.setTranslateY(10);
	lblMensagem.setText("Digite seu nome e clique no botão");
	hbTopo.getChildren().addAll(txtNome, btnAcao);
	raiz.getChildren().addAll(hbTopo, lblMensagem);
	lblMensagem.setEffect(r);
	Scene cena = new Scene(raiz, 250, 100);
	palco.setTitle("Aplicação usando código Java");
	palco.setScene(cena);
	palco.show();

	btnAcao.setOnAction(e -> lblMensagem.setText("Olá, " + txtNome.getText() + ", bem vindo!"));
}
 
开发者ID:jesuino,项目名称:livro-javafx-pratico,代码行数:22,代码来源:DigaOlaComJavaFX.java

示例7: FXInSwing

import javafx.scene.effect.Reflection; //导入依赖的package包/类
public FXInSwing(){
    panel = new JFXPanel();
    Platform.runLater(new Runnable(){
        @Override
        public void run() {
            stack = new StackPane();
            scene = new Scene(stack,300,300);
            hello = new Text("Hello");

            scene.setFill(Color.BLACK);
            hello.setFill(Color.WHEAT);
            hello.setEffect(new Reflection());

            panel.setScene(scene);
            stack.getChildren().add(hello);

            wait = false;
        }
    });
    this.getContentPane().add(panel);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    this.setSize(300, 300);
    this.setVisible(true);
}
 
开发者ID:mars-sim,项目名称:mars-sim,代码行数:25,代码来源:FXInSwing.java

示例8: 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);
  }
 
开发者ID:jixuan1989,项目名称:jmusic,代码行数:23,代码来源:GetArtist.java

示例9: 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;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:12,代码来源:ReflectionSample.java

示例10: 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);
        }

    }
 
开发者ID:schwabdidier,项目名称:GazePlay,代码行数:33,代码来源:Clavier.java

示例11: getNamedEffectList

import javafx.scene.effect.Reflection; //导入依赖的package包/类
List<NamedEffect> getNamedEffectList() {
    List<NamedEffect> nes = new ArrayList<NamedEffect>();
    nes.add(new NamedEffect("default", new Reflection() ));
    nes.add(new NamedEffect("bottom opacity 0.7", new Reflection() {{setBottomOpacity(.7f);}}));
    nes.add(new NamedEffect("fraction: 0.5", new Reflection() {{setFraction(0.5f);}}));
    nes.add(new NamedEffect("top offset: 15", new Reflection() {{setTopOffset(15);}}));
    nes.add(new NamedEffect("top opacity: 0.9", new Reflection() {{setTopOpacity(.9f);}}));

    return nes;
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:11,代码来源:CanvasEffects2App.java

示例12: 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);

}
 
开发者ID:jesuino,项目名称:livro-javafx-pratico,代码行数:13,代码来源:AprendendoTransicoes.java

示例13: 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();
}
 
开发者ID:mars-sim,项目名称:mars-sim,代码行数:16,代码来源:SlideDemo.java

示例14: MyButton

import javafx.scene.effect.Reflection; //导入依赖的package包/类
public MyButton(String text, Cursor cursor){
	setText(text);
	setFont(new Font("Tahoma", 18));
	setEffect(new Reflection());
    setCursor(cursor);
    setPrefWidth(150);
}
 
开发者ID:SaiPradeepDandem,项目名称:javafx-demos,代码行数:8,代码来源:CursorsDemo.java

示例15: 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;
}
 
开发者ID:SaiPradeepDandem,项目名称:javafx-demos,代码行数:23,代码来源:BlurEffectDemo.java


注:本文中的javafx.scene.effect.Reflection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。