Package javafx.scene.shape

Examples of javafx.scene.shape.Rectangle


     * of the window in which the content will be displayed.
     * <p>This area should be inside the bounds of the matrixPanel and should not overlap with other areas.
     * <p>The very same area could be used to display two different contents, check <i>order(RotationOrder)</i>.
     */
    public final ContentBuilder area(final Rectangle AREA) {
        final Rectangle RECT=new Rectangle(AREA.getX(),AREA.getY(),AREA.getX()+AREA.getWidth(),AREA.getY()+AREA.getHeight());
        properties.put("area", new SimpleObjectProperty<>(RECT));
        return this;
    }
View Full Code Here


     * @param END_Y Insert the Y bottom coordinate of the window in which the content is displayed.
     * <p>This window should be inside the bounds of the matrixPanel and should not overlap with other areas.
     * <p>The very same area could be used to display two different contents, check <i>order(RotationOrder)</i>.
     */
    public final ContentBuilder area(final int ORIGIN_X, final int ORIGIN_Y, final int END_X, final int END_Y) {
        properties.put("area", new SimpleObjectProperty<>(new Rectangle(ORIGIN_X,ORIGIN_Y,END_X,END_Y)));
        return this;
    }
View Full Code Here

        } else if (Circle.class.equals(SHAPE.getClass())) {
            fxPath.append(convertCircle((Circle) SHAPE));
        } else if (Ellipse.class.equals(SHAPE.getClass())) {
            fxPath.append(convertEllipse((Ellipse) SHAPE));
        } else if (Text.class.equals(SHAPE.getClass())) {
            Path path = (Path)(Shape.subtract(SHAPE, new Rectangle(0, 0)));
            fxPath.append(convertPath(path));
        } else if (Path.class.equals(SHAPE.getClass())) {
            fxPath.append(convertPath((Path) SHAPE));
        } else if (Polygon.class.equals(SHAPE.getClass())) {
            fxPath.append(convertPolygon((Polygon) SHAPE));
View Full Code Here

    private ObjectProperty<MatrixFont>      matrixFont;
    private ObjectProperty<Gap>             fontGap;
    private ObjectProperty<Align>           txtAlign;
   
    public Content(){
        this(MatrixColor.RED, Type.TEXT, new Point2D(0,0), new Rectangle(0,0,20000,20000), "", MatrixFont.FF_5x7,
                Gap.SIMPLE, Align.LEFT, Effect.NONE, PostEffect.STOP, 0, 10, RotationOrder.SINGLE, false);
    }
View Full Code Here

    private final SimpleDoubleProperty transY = new SimpleDoubleProperty();

    public Viewer(DoubleProperty w, DoubleProperty h) {
      this.width.bind(w.multiply(2));
      this.height.bind(h.multiply(2));
      this.clip = new Rectangle();
      this.clip.widthProperty().bind(this.width);
      this.clip.heightProperty().bind(this.height);
      this.clip.translateXProperty().bind(transX);
      this.clip.translateYProperty().bind(transY);
    }
View Full Code Here

                                                                     new Stop(0.3472, Color.rgb(153, 153, 153)),
                                                                     new Stop(0.5000, Color.rgb(0, 0, 0)),
                                                                     new Stop(0.6805, Color.rgb(153, 153, 153)),
                                                                     new Stop(0.8750, Color.rgb(0, 0, 0)),
                                                                     new Stop(1.0000, Color.rgb(254, 254, 254)));
                        image = bmGradient.apply(new Rectangle(width,height)).getImage();
                        break;
                    case CHROME:
                        ConicalGradient cmGradient = new ConicalGradient(new Point2D(width/2d,height/2d),
                                                                     new Stop(0.00, Color.WHITE),
                                                                     new Stop(0.09, Color.WHITE),
                                                                     new Stop(0.12, Color.rgb(136, 136, 138)),
                                                                     new Stop(0.16, Color.rgb(164, 185, 190)),
                                                                     new Stop(0.25, Color.rgb(158, 179, 182)),
                                                                     new Stop(0.29, Color.rgb(112, 112, 112)),
                                                                     new Stop(0.33, Color.rgb(221, 227, 227)),
                                                                     new Stop(0.38, Color.rgb(155, 176, 179)),
                                                                     new Stop(0.48, Color.rgb(156, 176, 177)),
                                                                     new Stop(0.52, Color.rgb(254, 255, 255)),
                                                                     new Stop(0.63, Color.WHITE),
                                                                     new Stop(0.68, Color.rgb(156, 180, 180)),
                                                                     new Stop(0.80, Color.rgb(198, 209, 211)),
                                                                     new Stop(0.83, Color.rgb(246, 248, 247)),
                                                                     new Stop(0.87, Color.rgb(204, 216, 216)),
                                                                     new Stop(0.97, Color.rgb(164, 188, 190)),
                                                                     new Stop(1.00, Color.WHITE));
                        image = cmGradient.apply(new Rectangle(width,height)).getImage();
                        break;
                    case SHINY_METAL:
                        Color c=getSkinnable().getFrameBaseColor();
                        ConicalGradient smGradient = new ConicalGradient(new Point2D(width/2d,height/2d),
                                                                 new Stop(0.0000, Color.rgb(254, 254, 254)),
                                                                 new Stop(0.1250, Util.darker(c, 0.15)),
                                                                 new Stop(0.2500, c.darker()),
                                                                 new Stop(0.3472, c.brighter()),
                                                                 new Stop(0.5000, c.darker().darker()),
                                                                 new Stop(0.6527, c.brighter()),
                                                                 new Stop(0.7500, c.darker()),
                                                                 new Stop(0.8750, Util.darker(c, 0.15)),
                                                                 new Stop(1.0000, Color.rgb(254, 254, 254)));
                        image = smGradient.apply(new Rectangle(width,height)).getImage();
                        break;
                    case CUSTOM_DESIGN:
                        // load image
                        String pathJpg=getSkinnable().getFrameCustomPath();
                        // 1. from jar or url
View Full Code Here

                        break;
                    case BLACK_METAL:
                    case CHROME:
                    case SHINY_METAL:
                    case CUSTOM_DESIGN:
                        Rectangle rectFrame=new Rectangle(width,height);
                        rectFrame.setArcHeight(0.08*size); rectFrame.setArcWidth(0.08*size);
                        if(fillFrame!=null){
                            Platform.runLater(()-> mainFrame.setBackground(fillFrame) );
                        }
                        mainFrame.setShape(rectFrame);
                        mainFrameIn.setStyle("-fx-background-radius: "+(0.06*size/2d+1d)+", "+(0.05*size/2d)+";"+
                                           "-fx-background-insets: "+(0.0841121495 *size-2d)+", "+(0.0841121495 *size)+";");
                        break;
                    default:
                        Rectangle rect=new Rectangle(width,height);
                        rect.setArcHeight(0.08*size); rect.setArcWidth(0.08*size);
                        mainFrame.setShape(rect);
                        mainFrame.setStyle("-fx-background-image: url(\""+jpgFrame+"\");\n" +
                                           "-fx-background-position: center center;\n" +
                                           "-fx-background-repeat: no-repeat;\n" +
                                           "-fx-background-size: cover");
View Full Code Here

       
        int x0 = (int) content.getOrigin().getX() + (int) content.getArea().getX();
        int y0 = (int) content.getOrigin().getY() + (int) content.getArea().getY();
        int maxX = Math.min((int) content.getArea().getWidth(), getSkinnable().ledWidthProperty().intValue());
        int maxY = Math.min((int) content.getArea().getHeight(), getSkinnable().ledHeightProperty().intValue());
        visibleArea[iContent] = new Rectangle(Math.max(x0, 0), Math.max(y0, 0), maxX, maxY);

        if (content.getType().equals(Content.Type.IMAGE)) {
            byte[] sBytes=null;
            if(iContent<fullAreas.size() && byteAreas!=null && byteAreas.get(iContent)!=null){
                sBytes=byteAreas.get(iContent);
View Full Code Here

                .y(HEIGHT / PREFERRED_HEIGHT)
                .pivotX(0)
                .pivotY(0)
                .build();

        Rectangle backgroundRect = RectangleBuilder.create()
                .id("slide-background")
                .width(WIDTH)
                .height(HEIGHT)
                .build();
        backgroundRect.visibleProperty().bind(CONTROL.backgroundVisibleProperty());

        Rectangle slideArea = RectangleBuilder.create()
                .id("slide-area")
                .x(0.0612476117 * WIDTH)
                .y(0.2463297872 * HEIGHT)
                .width(0.8829200973 * WIDTH)
                .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);

        drawSlideButton();
        button.translateXProperty().bind(CONTROL.endXProperty().multiply(SCALE_FACTOR_X));
        button.setTranslateY(SlideLock.BUTTON_YCOORD * SCALE_FACTOR_Y);

        text.setTranslateX(SlideLock.START_XCOORD + button.getBoundsInParent().getWidth() + 0.1063829787 * HEIGHT);
        text.setTranslateY(0.5744680851 * HEIGHT);
        text.opacityProperty().bind(CONTROL.textOpacityProperty());

        Rectangle topGlareRect = RectangleBuilder.create()
                .id("slide-top-glare")
                .fill(Color.WHITE)
                .width(WIDTH)
                .height(0.5 * HEIGHT)
                .opacity(0.0627451)
                .build();
        topGlareRect.visibleProperty().bind(CONTROL.backgroundVisibleProperty());
        getChildren().clear();
        getChildren().addAll(backgroundRect, slideArea, glareRect, text, button, topGlareRect);
    }
View Full Code Here

        scale.setPivotY(0);

        button.getChildren().clear();

        // build gradientRect
        Rectangle gradientRect = RectangleBuilder.create()
                .x(0.0358943492 * WIDTH)
                .y(0.0649521277 * HEIGHT)
                .width(0.156464544 * WIDTH)
                .height(0.3616446809 * HEIGHT)
                .arcWidth(0.0929042553 * HEIGHT)
 
View Full Code Here

TOP

Related Classes of javafx.scene.shape.Rectangle

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.