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


Java Rectangle.setArcWidth方法代码示例

本文整理汇总了Java中javafx.scene.shape.Rectangle.setArcWidth方法的典型用法代码示例。如果您正苦于以下问题:Java Rectangle.setArcWidth方法的具体用法?Java Rectangle.setArcWidth怎么用?Java Rectangle.setArcWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.shape.Rectangle的用法示例。


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

示例1: ScaleTransitionSample

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public ScaleTransitionSample() {
    super(150,150);
    Rectangle rect = new Rectangle(50, 50, 50, 50);
    rect.setArcHeight(15);
    rect.setArcWidth(15);
    rect.setFill(Color.ORANGE);
    getChildren().add(rect);
    scaleTransition = ScaleTransitionBuilder.create()
            .node(rect)
            .duration(Duration.seconds(4))
            .toX(3)
            .toY(3)
            .cycleCount(Timeline.INDEFINITE)
            .autoReverse(true)
            .build();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:17,代码来源:ScaleTransitionSample.java

示例2: StrokeTransitionSample

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public StrokeTransitionSample() {
    super(150,150);
    Rectangle rect = new Rectangle(0, 0, 150, 150);
    rect.setArcHeight(20);
    rect.setArcWidth(20);
    rect.setFill(null);
    rect.setStroke(Color.DODGERBLUE);
    rect.setStrokeWidth(10);
    getChildren().add(rect);
    
    strokeTransition = StrokeTransitionBuilder.create()
        .duration(Duration.seconds(3))
        .shape(rect)
        .fromValue(Color.RED)
        .toValue(Color.DODGERBLUE)
        .cycleCount(Timeline.INDEFINITE)
        .autoReverse(true)
        .build();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:20,代码来源:StrokeTransitionSample.java

示例3: FadeTransitionSample

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public FadeTransitionSample() {
    super(100,100);
    Rectangle rect = new Rectangle(0, 0, 100, 100);
    rect.setArcHeight(20);
    rect.setArcWidth(20);
    rect.setFill(Color.DODGERBLUE);
    getChildren().add(rect);
    
    fadeTransition = FadeTransitionBuilder.create()
        .duration(Duration.seconds(4))
        .node(rect)
        .fromValue(1)
        .toValue(0.2)
        .cycleCount(Timeline.INDEFINITE)
        .autoReverse(true)
        .build();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:18,代码来源:FadeTransitionSample.java

示例4: createIconContent

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public static Node createIconContent() {
    final Rectangle r1 = new Rectangle (50, 50, 14, 14);
    r1.setArcHeight(4);
    r1.setArcWidth(4);
    r1.setFill(Color.web("#ed4b00"));

    Polygon polygon = createArrow();
    polygon.setLayoutX(68);
    polygon.setLayoutY(25);
    polygon.setRotate(45);

    Rectangle r3 = new Rectangle (25, 25, 64, 64);
    r3.setArcHeight(15);
    r3.setArcWidth(15);
    r3.setFill(Color.web("#f49b00"));
    javafx.scene.Group g = new javafx.scene.Group(r3,r1, polygon);
    return new javafx.scene.Group(g);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:19,代码来源:ScaleSample.java

示例5: RotateTransitionSample

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public RotateTransitionSample() {
    super(140,140);

    Rectangle rect = new Rectangle(20, 20, 100, 100);
    rect.setArcHeight(20);
    rect.setArcWidth(20);
    rect.setFill(Color.ORANGE);
    getChildren().add(rect);
   
    rotateTransition = RotateTransitionBuilder.create()
            .node(rect)
            .duration(Duration.seconds(4))
            .fromAngle(0)
            .toAngle(720)
            .cycleCount(Timeline.INDEFINITE)
            .autoReverse(true)
            .build();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:19,代码来源:RotateTransitionSample.java

示例6: createRectangle

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public static Rectangle createRectangle(double width, double height, double arcWidth, double arcHeight)
{
	Rectangle rectangle = new Rectangle(width, height);
	rectangle.setArcWidth(arcWidth);
	rectangle.setArcHeight(arcHeight);
	return rectangle;
}
 
开发者ID:PolyphasicDevTeam,项目名称:NoMoreOversleeps,代码行数:8,代码来源:JavaFxHelper.java

示例7: RotateSample

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public RotateSample() {
    super(220, 270);

    //create 2 rectangles
    Rectangle rect1 = new Rectangle(90, 90, Color.web("#ed4b00", 0.75));
    Rectangle rect2 = new Rectangle(90, 90, Color.web("#ed4b00", 0.5));

    //rotate the second one
    rect2.getTransforms().add(new Rotate(135, 90, 90)); // parameters are angle, pivotX and pivotY

    // rectangle with adjustable rotate
    Rectangle rect3 = new Rectangle(40, 180, 60, 60);
    rect3.setFill(Color.DODGERBLUE);
    rect3.setArcWidth(10);
    rect3.setArcHeight(10);
    rect3.setRotate(45);

    //show the rectangles
    getChildren().addAll(rect2, rect1, rect3);

    // REMOVE ME
    setControls(
            new SimplePropertySheet.PropDesc("Rotate", rect3.rotateProperty(), 0d, 360d)
    );
    // END REMOVE ME
    
    //create arrow
    Polygon polygon = createArrow();
    polygon.setLayoutX(110);
    polygon.setLayoutY(15);
    polygon.setRotate(135);

    getChildren().addAll(polygon);

}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:36,代码来源:RotateSample.java

示例8: PauseTransitionSample

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public PauseTransitionSample() {
    super(400,150);
    // create rectangle
    Rectangle rect = new Rectangle(-25,-25,50, 50);
    rect.setArcHeight(15);
    rect.setArcWidth(15);
    rect.setFill(Color.CRIMSON);
    rect.setTranslateX(50);
    rect.setTranslateY(75);
    getChildren().add(rect);
    
    animation = SequentialTransitionBuilder.create()
        .node(rect)
        .children(
            TranslateTransitionBuilder.create()
                .duration(Duration.seconds(2))
                .fromX(50)
                .toX(200)
                .build(),
            PauseTransitionBuilder.create()
                .duration(Duration.seconds(2))
                .build(),
            TranslateTransitionBuilder.create()
                .duration(Duration.seconds(2))
                .fromX(200)
                .toX(350)
                .build()
        )
        .cycleCount(Timeline.INDEFINITE)
        .autoReverse(true)
        .build();                
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:33,代码来源:PauseTransitionSample.java

示例9: Clavier

import javafx.scene.shape.Rectangle; //导入方法依赖的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

示例10: createIconContent

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public static Node createIconContent() {
    final Rectangle r1 = new Rectangle (22, 0, 64, 64);
    r1.setArcHeight(4);
    r1.setArcWidth(4);
    r1.setFill(Color.web("#ed4b00",0.5));
    r1.getTransforms().add(new Shear(-0.35, 0));

    Polygon polygon = createArrow();
    polygon.setLayoutX(-5);
    polygon.setLayoutY(-2);
    polygon.setRotate(90);
    

    Rectangle r2 = new Rectangle (0, 0, 64, 64);
    r2.setArcHeight(4);
    r2.setArcWidth(4);
    r2.setFill(Color.web("#ed4b00", 0.25));
    javafx.scene.Group g = new javafx.scene.Group(r2,r1, polygon);
    return new javafx.scene.Group(g);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:21,代码来源:ShearSample.java

示例11: createCell

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
private Rectangle createCell(int i, int j){
    final double arcSize = CELL_SIZE / 6d;
    Rectangle cell = new Rectangle(i * CELL_SIZE, j * CELL_SIZE, CELL_SIZE, CELL_SIZE);
    // provide default style in case css are not loaded
    cell.setFill(Color.WHITE);
    cell.setStroke(Color.GREY);
    cell.setArcHeight(arcSize);
    cell.setArcWidth(arcSize);
    cell.getStyleClass().add("game-grid-cell");
    return cell;
}
 
开发者ID:juebanlin,项目名称:util4j,代码行数:12,代码来源:Board.java

示例12: createIconContent

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public static Node createIconContent() {
    Rectangle rect = new Rectangle(80,80,new RadialGradient(0, 0, 0.5, 0.5, 1, true, CycleMethod.NO_CYCLE, new Stop[] {
        new Stop(0, Color.rgb(156,216,255)),
        new Stop(0.5, Color.DODGERBLUE),
        new Stop(1, Color.rgb(0,70,140))
    }));
    rect.setArcWidth(20);
    rect.setArcHeight(20);
    return rect;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:11,代码来源:RadialGradientSample.java

示例13: createIconContent

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public static Node createIconContent() {
    Rectangle rect = new Rectangle(80,80,new LinearGradient(0, 0, 1, 0, true, CycleMethod.NO_CYCLE, new Stop[] {
        new Stop(0, Color.rgb(156,216,255)),
        new Stop(0.5, Color.DODGERBLUE),
        new Stop(1, Color.rgb(0,70,140))
    }));
    rect.setArcWidth(20);
    rect.setArcHeight(20);
    return rect;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:11,代码来源:LinearGradientSample.java

示例14: SequentialTransitionSample

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public SequentialTransitionSample() {
    super(400,100);
    // create rectangle
    Rectangle rect = new Rectangle(-25,-25,50, 50);
    rect.setArcHeight(15);
    rect.setArcWidth(15);
    rect.setFill(Color.CRIMSON);
    rect.setTranslateX(50);
    rect.setTranslateY(50);
    getChildren().add(rect);
    // create 4 transitions
    FadeTransition fadeTransition =
            FadeTransitionBuilder.create()
            .duration(Duration.seconds(1))
            .fromValue(1)
            .toValue(0.3)
            .cycleCount(2)
            .autoReverse(true)
            .build();
    TranslateTransition translateTransition =
            TranslateTransitionBuilder.create()
            .duration(Duration.seconds(2))
            .fromX(50)
            .toX(375)
            .cycleCount(2)
            .autoReverse(true)
            .build();       
    RotateTransition rotateTransition = 
            RotateTransitionBuilder.create()
            .duration(Duration.seconds(2))
            .byAngle(180)
            .cycleCount(4)
            .autoReverse(true)
            .build();
    ScaleTransition scaleTransition =
            ScaleTransitionBuilder.create()
            .duration(Duration.seconds(2))
            .toX(2)
            .toY(2)
            .cycleCount(2)
            .autoReverse(true)
            .build();
    // create sequential transition to do 4 transitions one after another       
    sequentialTransition = SequentialTransitionBuilder.create()
            .node(rect)
            .children(fadeTransition, translateTransition, rotateTransition,
                       scaleTransition)
            .cycleCount(Timeline.INDEFINITE)
            .autoReverse(true)
            .build();
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:52,代码来源:SequentialTransitionSample.java

示例15: ParallelTransitionSample

import javafx.scene.shape.Rectangle; //导入方法依赖的package包/类
public ParallelTransitionSample() {
    super(400,150);
    // create rectangle
    Rectangle rect = new Rectangle(-25,-25,50, 50);
    rect.setArcHeight(15);
    rect.setArcWidth(15);
    rect.setFill(Color.CRIMSON);
    rect.setTranslateX(50);
    rect.setTranslateY(75);
    getChildren().add(rect); 
    // create parallel transition to do all 4 transitions at the same time        
    parallelTransition = ParallelTransitionBuilder.create()
        .node(rect)
        .children(
            FadeTransitionBuilder.create()
                .duration(Duration.seconds(3))
                .node(rect)
                .fromValue(1)
                .toValue(0.3)
                .autoReverse(true)
                .build(),
            TranslateTransitionBuilder.create()
                .duration(Duration.seconds(2))
                .fromX(50)
                .toX(350)
                .cycleCount(2)
                .autoReverse(true)
                .build(),
            RotateTransitionBuilder.create()
                .duration(Duration.seconds(3))
                .byAngle(180)
                .cycleCount(4)
                .autoReverse(true)
                .build(),
            ScaleTransitionBuilder.create()
                .duration(Duration.seconds(2))
                .toX(2)
                .toY(2)
                .cycleCount(2)
                .autoReverse(true)
                .build()
        )
        .cycleCount(Timeline.INDEFINITE)
        .autoReverse(true)
        .build();
    
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:48,代码来源:ParallelTransitionSample.java


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