當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。