• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DropShadowBuilder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: start

import javafx.scene.effect.DropShadowBuilder; //导入依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
	Button button = new Button("BindableTransition");
	DropShadow shadow = DropShadowBuilder.create().build();
	button.setEffect(shadow);
	button.setStyle("-fx-font-size: 32px;");
	final Duration duration = Duration.millis(1200);
	BindableTransition transition = new BindableTransition(duration);
	transition.setCycleCount(1000);
	transition.setAutoReverse(true);
	shadow.offsetXProperty().bind(transition.fractionProperty().multiply(32));
	shadow.offsetYProperty().bind(transition.fractionProperty().multiply(32));
	button.translateXProperty().bind(transition.fractionProperty().multiply(-32));
	transition.play();

	StackPane pane = new StackPane();
	pane.getChildren().add(button);

	Scene myScene = new Scene(pane, 800, 600);
	primaryStage.setScene(myScene);
	primaryStage.show();
}
 
开发者ID:SaiPradeepDandem,项目名称:javafx-demos,代码行数:23,代码来源:BindableTransitionTrial.java


示例2: VUMeter

import javafx.scene.effect.DropShadowBuilder; //导入依赖的package包/类
public VUMeter() {
    for(int i=0; i<bars.length;i++) {
        bars[i] = new Rectangle(26, 2);
        bars[i].setFill(BAR_COLOR);
        bars[i].setX(-13);
        bars[i].setY(1-(i*4));
    }
    getChildren().addAll(bars);
    setEffect(DropShadowBuilder.create().blurType(BlurType.TWO_PASS_BOX).radius(10).spread(0.4).color(Color.web("#b10000")).build());
}
 
开发者ID:onebeartoe,项目名称:media-players,代码行数:11,代码来源:VUMeter.java


示例3: getDropShadow

import javafx.scene.effect.DropShadowBuilder; //导入依赖的package包/类
/**
 * Build the drop shadow.
 *
 * @return the drop shadow effect
 */
private Effect getDropShadow() {
    return DropShadowBuilder.create()
                            .offsetX(0)
                            .offsetY(5)
                            .color(MTColors.BEAN_SHADOW.get())
                            .blurType(BlurType.GAUSSIAN)
                            .radius(5)
                            .spread(0.1)
                            .build();
}
 
开发者ID:JRebirth,项目名称:MasteringTables,代码行数:16,代码来源:ResultView.java


示例4: RaceTrack

import javafx.scene.effect.DropShadowBuilder; //导入依赖的package包/类
public RaceTrack() {
    ImageView carImageView = new ImageView(new Image(
            DataAppPreloader.class.getResourceAsStream("images/car.png")));
    road = SVGPathBuilder.create()
            .content(trackPath).fill(null).stroke(Color.gray(0.4))
            .strokeWidth(50)
            .effect(DropShadowBuilder.create().radius(20).blurType(BlurType.ONE_PASS_BOX).build())
            .build();
    SVGPath trackLine = SVGPathBuilder.create()
            .content(trackPath).fill(null).stroke(Color.WHITE)
            .strokeDashArray(8d,6d).build();
    Line startLine = LineBuilder.create()
            .startX(610.312).startY(401.055).endX(610.312).endY(450.838)
            .stroke(Color.WHITE).strokeDashArray(2d,2d).build();
    Text startFinish = TextBuilder.create().text("START/FINISH").fill(Color.WHITE)
            .x(570).y(475).build();
    percentage = TextBuilder.create().text("0%")
            .x(390).y(170).font(Font.font("System", 60))
            .fill(Color.web("#ddf3ff"))
            .stroke(Color.web("#73c0f7"))
            .effect(DropShadowBuilder.create().radius(15).color(Color.web("#3382ba")).blurType(BlurType.ONE_PASS_BOX).build())
            .build();
    ImageView raceCarImg = new ImageView(new Image(
            DataAppPreloader.class.getResourceAsStream("images/Mini-red-and-white.png")));
    raceCarImg.setX(raceCarImg.getImage().getWidth()/2);
    raceCarImg.setY(raceCarImg.getImage().getHeight()/2);
    raceCarImg.setRotate(90);
    raceCar = new Group(raceCarImg);
    
    track = new Group(road, trackLine, startLine, startFinish);
    track.setCache(true);
    // add children
    getChildren().addAll(track, raceCar, percentage);
    
    // Create path animation that we will use to drive the car along the track
    race = new PathTransition(Duration.seconds(1), road, raceCar);
    race.setOrientation(PathTransition.OrientationType.ORTHOGONAL_TO_TANGENT);
    race.play();
    race.pause();
    
    // center our content and set our size
    setTranslateX(-road.getBoundsInLocal().getMinX());
    setTranslateY(-road.getBoundsInLocal().getMinY());
    setPrefSize(road.getBoundsInLocal().getWidth(), road.getBoundsInLocal().getHeight());
    setMaxSize(USE_PREF_SIZE, USE_PREF_SIZE);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:47,代码来源:RaceTrack.java


示例5: initView

import javafx.scene.effect.DropShadowBuilder; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void initView() {

    node().setAlignment(Pos.CENTER);

    node().setPrefSize(650, 200);
    node().setMaxSize(700, 200);

    this.leftOperand = getExpressionTextBuilder()
                                                 .wrappingWidth(180)
                                                 .build();

    this.operator = getExpressionTextBuilder()
                                              .wrappingWidth(60)
                                              .build();

    this.rightOperand = getExpressionTextBuilder()
                                                  .wrappingWidth(120)
                                                  .build();

    this.equality = getExpressionTextBuilder()
                                              .wrappingWidth(60)
                                              .text("=")
                                              .build();

    this.result = getExpressionTextBuilder()
                                            .wrappingWidth(180)
                                            .scaleX(1.0)
                                            .scaleY(1.0)
                                            .text("")
                                            .build();

    node().getChildren().addAll(this.leftOperand, this.operator, this.rightOperand, this.equality, this.result);

    // Manage Animation
    this.expressionResolved = buildExpressionResolved();
    this.expressionFailure = buildExpressionFailure();

    this.showExpression = SequentialTransitionBuilder.create()
                                                     .children(
                                                               buildTextPartAnimation(getLeftOperand()),
                                                               buildTextPartAnimation(getOperator()),
                                                               buildTextPartAnimation(getRightOperand()),
                                                               buildTextPartAnimation(getEquality()))
                                                     .build();

    // Add a nice drop shadow in all direction
    final DropShadow s = DropShadowBuilder.create()
                                          .height(10)
                                          .width(10)
                                          .color(Color.BLACK)
                                          .blurType(BlurType.THREE_PASS_BOX)
                                          .radius(10)
                                          .spread(0.1)
                                          .build();

    node().setEffect(s);
}
 
开发者ID:JRebirth,项目名称:MasteringTables,代码行数:62,代码来源:ExpressionView.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ParserException类代码示例发布时间:2022-05-23
下一篇:
Java JD类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap