Package javafx.scene.shape

Examples of javafx.scene.shape.SVGPath


        }
        return fxPath.toString();
    }

    public static SVGPath shapeToSvgPath(final Shape SHAPE) {
        SVGPath svgPath = new SVGPath();
        svgPath.setContent(shapeToSvgString(SHAPE));
        return svgPath;
    }
View Full Code Here


    public BreadcrumbItemSkin(BreadcrumbItem c) {
        super(c, new BehaviorBase<BreadcrumbItem>(c,new ArrayList<KeyBinding>()));

        HBox box = new HBox();
       
        final SVGPath leftSide = new SVGPath();
        if(!c.isFirst()) {
            leftSide.setContent("M0 0 L15 0 l0 30 L0 30 l10 -15 Z");
        } else {
            leftSide.setContent("M0 0 L15 0 l0 30 L0 30 Z");
        }
        leftSide.getStyleClass().add("breadcrumbitem-ui");
       
        final SVGPath rightSide = new SVGPath();
        rightSide.setContent("M0,0 L5,0 15,15 5,30 0,30 Z");
        rightSide.getStyleClass().add("breadcrumbitem-ui");
        rightSide.setLayoutY(10);
        final StackPane stackPane = new StackPane();
        stackPane.getStyleClass().add("breadcrumbitem-ui");
        stackPane.setAlignment(Pos.CENTER);
       
        final HBox stackContent = new HBox(10);
        stackContent.setAlignment(Pos.CENTER);
       
        stackPane.getChildren().add(stackContent);
       
        box.getChildren().add(leftSide);
        box.getChildren().add(stackPane);

        final Label textLabel = new Label();
        if (c != null) {
            if (c.getIcon() != null) {
                ImageView iv = new ImageView(c.getIcon());
                iv.setPreserveRatio(true);
                iv.setFitHeight(20);
                stackContent.getChildren().add(iv);
            }
           
            if(c.getSvgIcon() != null) {
                stackContent.getChildren().add(c.getSvgIcon());
            }
           
            if (c.getText() != null) {
                textLabel.setText(c.getText());
                textLabel.getStyleClass().add("breadcrumbitem-text");
                stackContent.getChildren().add(textLabel);
            }
        }
        box.getChildren().add(rightSide);
       
        leftSide.addEventHandler(MouseEvent.ANY, new BreadcrumbItemMouseHandler(){
            {
                getNodes().add(rightSide);
                getNodes().add(stackPane);
                if(!textLabel.getText().isEmpty()) {
                    getNodes().add(textLabel);
                }
            }
        });
       
        rightSide.addEventHandler(MouseEvent.ANY, new BreadcrumbItemMouseHandler(){
            {
                getNodes().add(leftSide);
                getNodes().add(stackPane);
                if(!textLabel.getText().isEmpty()) {
                    getNodes().add(textLabel);
View Full Code Here

                .height(0.5319148936 * HEIGHT)
                .arcWidth(0.079787234 * HEIGHT)
                .arcHeight(0.079787234 * HEIGHT)
                .build();

        SVGPath glareRect = SVGPathBuilder.create()
                .fill(LinearGradientBuilder.create()
                        .proportional(true)
                        .startX(0)
                        .startY(0)
                        .endX(0)
                        .endY(1)
                        .stops(new Stop(0, Color.web("f0f0f0", 1)),
                                new Stop(1, Color.web("f0f0f0", 0))
                        )
                        .build()
                )
                .opacity(.274)
                .transforms(SCALE)
                .content("m 0,0 0,94 32,0 0,-27.218747 C 30.998808,55.222973 37.761737,45.9354 46.156457,45.93665 l 431.687503,0.06427 c 8.39472,0.0013 15.15487,9.290837 15.15315,20.814756 l -0.004,27.218754 30.28125,0 0,-94.0000031 L 0,0 z")
                .id("glare-frame")
                .build();
        glareRect.visibleProperty().bind(CONTROL.backgroundVisibleProperty());

        text.setText(CONTROL.getText());
        text.setId("slide-text");
        text.getTransforms().clear();
        text.getTransforms().add(SCALE);
View Full Code Here

                .id("button-gradient-rect")
                .build();
        button.getChildren().add(gradientRect);

        // build arrowBlurShadow
        SVGPath arrowBlurShadow = SVGPathBuilder.create()
                .fill(Color.BLACK)
                .effect(new GaussianBlur(5))
                .transforms(scale)
                .content("m 17.40912,2.47162 c -8.27303,0 -14.9375,7.04253 -14.9375,15.78125 l 0,59.9375 c 0,8.73872 6.66447,15.75 14.9375,15.75 l 84.625,0 c 8.27303,0 14.9375,-7.01128 14.9375,-15.75 l 0,-59.9375 c 0,-8.73872 -6.66447,-15.78125 -14.9375,-15.78125 l -84.625,0 z m 45.0625,18.15625 27.5625,27.59375 -27.5625,27.5625 0,-15.5625 -33.0625,0 0,-24 33.0625,0 0,-15.59375 z")
                .id("#button-arrow-blur-shadow")
                .build();
        button.getChildren().add(arrowBlurShadow);

        // build arrowStencilCrisp
        SVGPath arrowStencilCrisp = SVGPathBuilder.create()
                .content("m 17.40912,0.47162 c -8.27303,0 -14.9375,7.04253 -14.9375,15.78125 l 0,59.9375 c 0,8.73872 6.66447,15.75 14.9375,15.75 l 84.625,0 c 8.27303,0 14.9375,-7.01128 14.9375,-15.75 l 0,-59.9375 c 0,-8.73872 -6.66447,-15.78125 -14.9375,-15.78125 l -84.625,0 z m 45.0625,18.15625 27.5625,27.59375 -27.5625,27.5625 0,-15.5625 -33.0625,0 0,-24 33.0625,0 0,-15.59375 z")
                .fill(CONTROL.getButtonColor())
                .id("#button-arrow-stencil-crisp")
                .transforms(scale)
                .build();
        button.getChildren().add(arrowStencilCrisp);

        // build glareRect
        SVGPath glareRect = SVGPathBuilder.create()
                .content("m 17.83252,1.67757 c -8.27303,0 -14.9375,7.21042 -14.9375,16.15746 l 0,28.31557 114.5,0 0,-28.31557 c 0,-8.94704 -6.66447,-16.15746 -14.9375,-16.15746 l -84.625,0 z")
                .fill(LinearGradientBuilder.create()
                        .proportional(true)
                        .startX(0)
                        .startY(1)
                        .endX(0)
                        .endY(0)
                        .stops(new Stop(0, Color.web("f4f4f4", 0.60)),
                                new Stop(1, Color.web("ffffff", 0.2063063)))
                        .build()
                )
                .id("#button-arrow-glare-rect")
                .transforms(scale)
                .build();
        glareRect.visibleProperty().bind(CONTROL.buttonGlareVisibleProperty()); // red button
        button.getChildren().add(glareRect);
        button.setCache(true);
    }
View Full Code Here

                    public void handle(ActionEvent event) {
                        AnchorPane content2 = new AnchorPane();
                        content2.setStyle("-fx-background-color: green");
                        content2.setPrefSize(300, 300);

                        SVGPath icon = new SVGPath();
                        icon.setContent("M0,0 L10,0 L10,10 L0,10 Z");
                        icon.setStyle("-fx-fill: green;");
                        bar.addItem("Item 2", icon, content2);
                        bp.setCenter(content2);
                    }
                });

                AnchorPane content1 = new AnchorPane();
                content1.setStyle("-fx-background-color: blue");
                content1.setPrefSize(300, 300);
                content1.getChildren().add(btn2);

                SVGPath icon = new SVGPath();
                icon.setContent("M0,0 L10,0 L10,10 L0,10 Z");
                icon.setStyle("-fx-fill: blue;");
                bar.addItem("Item 1", icon, content1);               
                bp.setCenter(content1);
            }
        });
View Full Code Here

TOP

Related Classes of javafx.scene.shape.SVGPath

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.