Package javafx.scene.layout

Examples of javafx.scene.layout.Region


        }
    }

    private void initGraphics() {

        background = new Region();
        background.getStyleClass().setAll("background");


        backgroundInnerShadow = new InnerShadow();
        backgroundInnerShadow.setOffsetY(-1.0);
        backgroundInnerShadow.setRadius(1.0 / 434.0 * PREFERRED_WIDTH);
        backgroundInnerShadow.setColor(Color.rgb(0, 0, 0, 0.65));
        backgroundInnerShadow.setBlurType(BlurType.TWO_PASS_BOX);

        backgroundInnerHighlight = new InnerShadow();
        backgroundInnerHighlight.setOffsetY(1.0);
        backgroundInnerHighlight.setRadius(1.0 / 434.0 * PREFERRED_WIDTH);
        backgroundInnerHighlight.setColor(Color.rgb(200, 200, 200, 0.65));
        backgroundInnerHighlight.setBlurType(BlurType.TWO_PASS_BOX);
        backgroundInnerHighlight.setInput(backgroundInnerShadow);

        background.setEffect(backgroundInnerHighlight);

        dotInnerShadow = new InnerShadow();
        dotInnerShadow.setRadius(0.018 * PREFERRED_WIDTH);
        dotInnerShadow.setColor(Color.rgb(0, 0, 0, 0.65));
        dotInnerShadow.setBlurType(BlurType.TWO_PASS_BOX);

        glow = new DropShadow();
        glow.setInput(dotInnerShadow);
        glow.setRadius(0.023 * PREFERRED_WIDTH);
        glow.setColor(getSkinnable().getColor());
        glow.setBlurType(BlurType.TWO_PASS_BOX);

        // dot definitions
        d67 = new Region();
        d67.getStyleClass().add("dot-off");
        d67.setEffect(dotInnerShadow);
        dotMap.put(Dot.D67, d67);

        d57 = new Region();
        d57.getStyleClass().add("dot-off");
        d57.setEffect(dotInnerShadow);
        dotMap.put(Dot.D57, d57);

        d47 = new Region();
        d47.getStyleClass().add("dot-off");
        d47.setEffect(dotInnerShadow);
        dotMap.put(Dot.D47, d47);

        d37 = new Region();
        d37.getStyleClass().add("dot-off");
        d37.setEffect(dotInnerShadow);
        dotMap.put(Dot.D37, d37);

        d27 = new Region();
        d27.getStyleClass().add("dot-off");
        d27.setEffect(dotInnerShadow);
        dotMap.put(Dot.D27, d27);

        d17 = new Region();
        d17.getStyleClass().add("dot-off");
        d17.setEffect(dotInnerShadow);
        dotMap.put(Dot.D17, d17);

        d07 = new Region();
        d07.getStyleClass().add("dot-off");
        d07.setEffect(dotInnerShadow);
        dotMap.put(Dot.D07, d07);

        d66 = new Region();
        d66.getStyleClass().add("dot-off");
        d66.setEffect(dotInnerShadow);
        dotMap.put(Dot.D66, d66);

        d56 = new Region();
        d56.getStyleClass().add("dot-off");
        d56.setEffect(dotInnerShadow);
        dotMap.put(Dot.D56, d56);

        d46 = new Region();
        d46.getStyleClass().add("dot-off");
        d46.setEffect(dotInnerShadow);
        dotMap.put(Dot.D46, d46);

        d36 = new Region();
        d36.getStyleClass().add("dot-off");
        d36.setEffect(dotInnerShadow);
        dotMap.put(Dot.D36, d36);

        d26 = new Region();
        d26.getStyleClass().add("dot-off");
        d26.setEffect(dotInnerShadow);
        dotMap.put(Dot.D26, d26);

        d16 = new Region();
        d16.getStyleClass().add("dot-off");
        d16.setEffect(dotInnerShadow);
        dotMap.put(Dot.D16, d16);

        d06 = new Region();
        d06.getStyleClass().add("dot-off");
        d06.setEffect(dotInnerShadow);
        dotMap.put(Dot.D06, d06);

        d65 = new Region();
        d65.getStyleClass().add("dot-off");
        d65.setEffect(dotInnerShadow);
        dotMap.put(Dot.D65, d65);

        d55 = new Region();
        d55.getStyleClass().add("dot-off");
        d55.setEffect(dotInnerShadow);
        dotMap.put(Dot.D55, d55);

        d45 = new Region();
        d45.getStyleClass().add("dot-off");
        d45.setEffect(dotInnerShadow);
        dotMap.put(Dot.D45, d45);

        d35 = new Region();
        d35.getStyleClass().add("dot-off");
        d35.setEffect(dotInnerShadow);
        dotMap.put(Dot.D35, d35);

        d25 = new Region();
        d25.getStyleClass().add("dot-off");
        d25.setEffect(dotInnerShadow);
        dotMap.put(Dot.D25, d25);

        d15 = new Region();
        d15.getStyleClass().add("dot-off");
        d15.setEffect(dotInnerShadow);
        dotMap.put(Dot.D15, d15);

        d05 = new Region();
        d05.getStyleClass().add("dot-off");
        d05.setEffect(dotInnerShadow);
        dotMap.put(Dot.D05, d05);

        d64 = new Region();
        d64.getStyleClass().add("dot-off");
        d64.setEffect(dotInnerShadow);
        dotMap.put(Dot.D64, d64);

        d54 = new Region();
        d54.getStyleClass().add("dot-off");
        d54.setEffect(dotInnerShadow);
        dotMap.put(Dot.D54, d54);

        d44 = new Region();
        d44.getStyleClass().add("dot-off");
        d44.setEffect(dotInnerShadow);
        dotMap.put(Dot.D44, d44);

        d34 = new Region();
        d34.getStyleClass().add("dot-off");
        d34.setEffect(dotInnerShadow);
        dotMap.put(Dot.D34, d34);

        d24 = new Region();
        d24.getStyleClass().add("dot-off");
        d24.setEffect(dotInnerShadow);
        dotMap.put(Dot.D24, d24);

        d14 = new Region();
        d14.getStyleClass().add("dot-off");
        d14.setEffect(dotInnerShadow);
        dotMap.put(Dot.D14, d14);

        d04 = new Region();
        d04.getStyleClass().add("dot-off");
        d04.setEffect(dotInnerShadow);
        dotMap.put(Dot.D04, d04);

        d63 = new Region();
        d63.getStyleClass().add("dot-off");
        d63.setEffect(dotInnerShadow);
        dotMap.put(Dot.D63, d63);

        d53 = new Region();
        d53.getStyleClass().add("dot-off");
        d53.setEffect(dotInnerShadow);
        dotMap.put(Dot.D53, d53);

        d43 = new Region();
        d43.getStyleClass().add("dot-off");
        d43.setEffect(dotInnerShadow);
        dotMap.put(Dot.D43, d43);

        d33 = new Region();
        d33.getStyleClass().add("dot-off");
        d33.setEffect(dotInnerShadow);
        dotMap.put(Dot.D33, d33);

        d23 = new Region();
        d23.getStyleClass().add("dot-off");
        d23.setEffect(dotInnerShadow);
        dotMap.put(Dot.D23, d23);

        d13 = new Region();
        d13.getStyleClass().add("dot-off");
        d13.setEffect(dotInnerShadow);
        dotMap.put(Dot.D13, d13);

        d03 = new Region();
        d03.getStyleClass().add("dot-off");
        d03.setEffect(dotInnerShadow);
        dotMap.put(Dot.D03, d03);

        d62 = new Region();
        d62.getStyleClass().add("dot-off");
        d62.setEffect(dotInnerShadow);
        dotMap.put(Dot.D62, d62);

        d52 = new Region();
        d52.getStyleClass().add("dot-off");
        d52.setEffect(dotInnerShadow);
        dotMap.put(Dot.D52, d52);

        d42 = new Region();
        d42.getStyleClass().add("dot-off");
        d42.setEffect(dotInnerShadow);
        dotMap.put(Dot.D42, d42);

        d32 = new Region();
        d32.getStyleClass().add("dot-off");
        d32.setEffect(dotInnerShadow);
        dotMap.put(Dot.D32, d32);

        d22 = new Region();
        d22.getStyleClass().add("dot-off");
        d22.setEffect(dotInnerShadow);
        dotMap.put(Dot.D22, d22);

        d12 = new Region();
        d12.getStyleClass().add("dot-off");
        d12.setEffect(dotInnerShadow);
        dotMap.put(Dot.D12, d12);

        d02 = new Region();
        d02.getStyleClass().add("dot-off");
        d02.setEffect(dotInnerShadow);
        dotMap.put(Dot.D02, d02);

        d61 = new Region();
        d61.getStyleClass().add("dot-off");
        d61.setEffect(dotInnerShadow);
        dotMap.put(Dot.D61, d61);

        d51 = new Region();
        d51.getStyleClass().add("dot-off");
        d51.setEffect(dotInnerShadow);
        dotMap.put(Dot.D51, d51);

        d41 = new Region();
        d41.getStyleClass().add("dot-off");
        d41.setEffect(dotInnerShadow);
        dotMap.put(Dot.D41, d41);

        d31 = new Region();
        d31.getStyleClass().add("dot-off");
        d31.setEffect(dotInnerShadow);
        dotMap.put(Dot.D31, d31);

        d21 = new Region();
        d21.getStyleClass().add("dot-off");
        d21.setEffect(dotInnerShadow);
        dotMap.put(Dot.D21, d21);

        d11 = new Region();
        d11.getStyleClass().add("dot-off");
        d11.setEffect(dotInnerShadow);
        dotMap.put(Dot.D11, d11);

        d01 = new Region();
        d01.getStyleClass().add("dot-off");
        d01.setEffect(dotInnerShadow);
        dotMap.put(Dot.D01, d01);

        // define highlights
        d67h = new Region();
        d67h.getStyleClass().add("dot-highlight");
        highlights.add(d67h);

        d57h = new Region();
        d57h.getStyleClass().add("dot-highlight");
        highlights.add(d57h);

        d47h = new Region();
        d47h.getStyleClass().add("dot-highlight");
        highlights.add(d47h);

        d37h = new Region();
        d37h.getStyleClass().add("dot-highlight");
        highlights.add(d37h);

        d27h = new Region();
        d27h.getStyleClass().add("dot-highlight");
        highlights.add(d27h);

        d17h = new Region();
        d17h.getStyleClass().add("dot-highlight");
        highlights.add(d17h);

        d07h = new Region();
        d07h.getStyleClass().add("dot-highlight");
        highlights.add(d07h);

        d66h = new Region();
        d66h.getStyleClass().add("dot-highlight");
        highlights.add(d66h);

        d56h = new Region();
        d56h.getStyleClass().add("dot-highlight");
        highlights.add(d56h);

        d46h = new Region();
        d46h.getStyleClass().add("dot-highlight");
        highlights.add(d46h);

        d36h = new Region();
        d36h.getStyleClass().add("dot-highlight");
        highlights.add(d36h);

        d26h = new Region();
        d26h.getStyleClass().add("dot-highlight");
        highlights.add(d26h);

        d16h = new Region();
        d16h.getStyleClass().add("dot-highlight");
        highlights.add(d16h);

        d06h = new Region();
        d06h.getStyleClass().add("dot-highlight");
        highlights.add(d06h);

        d65h = new Region();
        d65h.getStyleClass().add("dot-highlight");
        highlights.add(d65h);

        d55h = new Region();
        d55h.getStyleClass().add("dot-highlight");
        highlights.add(d55h);

        d45h = new Region();
        d45h.getStyleClass().add("dot-highlight");
        highlights.add(d45h);

        d35h = new Region();
        d35h.getStyleClass().add("dot-highlight");
        highlights.add(d35h);

        d25h = new Region();
        d25h.getStyleClass().add("dot-highlight");
        highlights.add(d25h);

        d15h = new Region();
        d15h.getStyleClass().add("dot-highlight");
        highlights.add(d15h);

        d05h = new Region();
        d05h.getStyleClass().add("dot-highlight");
        highlights.add(d05h);

        d64h = new Region();
        d64h.getStyleClass().add("dot-highlight");
        highlights.add(d64h);

        d54h = new Region();
        d54h.getStyleClass().add("dot-highlight");
        highlights.add(d54h);

        d44h = new Region();
        d44h.getStyleClass().add("dot-highlight");
        highlights.add(d44h);

        d34h = new Region();
        d34h.getStyleClass().add("dot-highlight");
        highlights.add(d34h);

        d24h = new Region();
        d24h.getStyleClass().add("dot-highlight");
        highlights.add(d24h);

        d14h = new Region();
        d14h.getStyleClass().add("dot-highlight");
        highlights.add(d14h);

        d04h = new Region();
        d04h.getStyleClass().add("dot-highlight");
        highlights.add(d04h);

        d63h = new Region();
        d63h.getStyleClass().add("dot-highlight");
        highlights.add(d63h);

        d53h = new Region();
        d53h.getStyleClass().add("dot-highlight");
        highlights.add(d53h);

        d43h = new Region();
        d43h.getStyleClass().add("dot-highlight");
        highlights.add(d43h);

        d33h = new Region();
        d33h.getStyleClass().add("dot-highlight");
        highlights.add(d33h);

        d23h = new Region();
        d23h.getStyleClass().add("dot-highlight");
        highlights.add(d23h);

        d13h = new Region();
        d13h.getStyleClass().add("dot-highlight");
        highlights.add(d13h);

        d03h = new Region();
        d03h.getStyleClass().add("dot-highlight");
        highlights.add(d03h);

        d62h = new Region();
        d62h.getStyleClass().add("dot-highlight");
        highlights.add(d62h);

        d52h = new Region();
        d52h.getStyleClass().add("dot-highlight");
        highlights.add(d52h);

        d42h = new Region();
        d42h.getStyleClass().add("dot-highlight");
        highlights.add(d42h);

        d32h = new Region();
        d32h.getStyleClass().add("dot-highlight");
        highlights.add(d32h);

        d22h = new Region();
        d22h.getStyleClass().add("dot-highlight");
        highlights.add(d22h);

        d12h = new Region();
        d12h.getStyleClass().add("dot-highlight");
        highlights.add(d12h);

        d02h = new Region();
        d02h.getStyleClass().add("dot-highlight");
        highlights.add(d02h);

        d61h = new Region();
        d61h.getStyleClass().add("dot-highlight");
        highlights.add(d61h);

        d51h = new Region();
        d51h.getStyleClass().add("dot-highlight");
        highlights.add(d51h);

        d41h = new Region();
        d41h.getStyleClass().add("dot-highlight");
        highlights.add(d41h);

        d31h = new Region();
        d31h.getStyleClass().add("dot-highlight");
        highlights.add(d31h);

        d21h = new Region();
        d21h.getStyleClass().add("dot-highlight");
        highlights.add(d21h);

        d11h = new Region();
        d11h.getStyleClass().add("dot-highlight");
        highlights.add(d11h);

        d01h = new Region();
        d01h.getStyleClass().add("dot-highlight");
        highlights.add(d01h);

        pane.getChildren().setAll(background,
                                  d67, d57, d47, d37, d27, d17, d07,
View Full Code Here


        selectedSet.addAll(getSkinnable().getSelectedSet());
    }

    private void initGraphics() {
        fixtureRight = new Region();
        fixtureRight.getStyleClass().setAll(getSkinnable().isDarkFixture() ? "fixture-dark" : "fixture");
        fixtureRight.setOpacity(getSkinnable().isWithFixture() ? 1 : 0);

        fixtureLeft = new Region();
        fixtureLeft.getStyleClass().setAll(getSkinnable().isDarkFixture() ? "fixture-dark" : "fixture");
        fixtureLeft.setOpacity(getSkinnable().isWithFixture() ? 1 : 0);

        innerShadow = new InnerShadow();
        innerShadow.setOffsetY(-0.01 * flapHeight);
        innerShadow.setRadius(0.01 * flapHeight);
        innerShadow.setColor(Color.rgb(0, 0, 0, 0.65));
        innerShadow.setBlurType(BlurType.TWO_PASS_BOX);

        innerHighlight = new InnerShadow();
        innerHighlight.setOffsetY(0.01 * flapHeight);
        innerHighlight.setRadius(0.01 * flapHeight);
        innerHighlight.setColor(Color.rgb(255, 255, 255, 0.65));
        innerHighlight.setBlurType(BlurType.TWO_PASS_BOX);
        innerHighlight.setInput(innerShadow);

        reversedInnerShadow = new InnerShadow();
        reversedInnerShadow.setOffsetY(-0.01 * 0.4920634921 * height);
        reversedInnerShadow.setRadius(0.01 * 0.4920634921 * height);
        reversedInnerShadow.setColor(Color.rgb(0, 0, 0, 0.65));
        reversedInnerShadow.setBlurType(BlurType.TWO_PASS_BOX);

        reversedInnerHighlight = new InnerShadow();
        reversedInnerHighlight.setOffsetY(0.01 * 0.4920634921 * height);
        reversedInnerHighlight.setRadius(0.01 * 0.4920634921 * height);
        reversedInnerHighlight.setColor(Color.rgb(255, 255, 255, 0.65));
        reversedInnerHighlight.setBlurType(BlurType.TWO_PASS_BOX);
        reversedInnerHighlight.setInput(innerShadow);

        getSkinnable().setStyle("-flap-base: " + Util.colorToCss(getSkinnable().getFlapColor()) + ";");

        upperBackground = new Region();
        upperBackground.setEffect(innerHighlight);


        //font = Font.font("Bebas Neue", PREFERRED_HEIGHT);
        //font = Font.loadFont(getClass().getResourceAsStream("/eu/hansolo/enzo/fonts/bebasneue.otf"), PREFERRED_HEIGHT);
        font = Font.loadFont(getClass().getResourceAsStream("/eu/hansolo/enzo/fonts/droidsansmono.ttf"), PREFERRED_HEIGHT);

        upperTextFill = new LinearGradient(0, 0,
                                           0, flapHeight,
                                           false, CycleMethod.NO_CYCLE,
                                           new Stop(0.0, getSkinnable().getTextColor()),
                                           new Stop(1.0, getSkinnable().getTextColor().darker()));
        upperBackgroundText    = new Canvas();
        ctxUpperBackgroundText = upperBackgroundText.getGraphicsContext2D();
        ctxUpperBackgroundText.setTextBaseline(VPos.CENTER);
        ctxUpperBackgroundText.setTextAlign(TextAlignment.CENTER);

        lowerBackground = new Region();
        lowerBackground.setEffect(innerHighlight);

        lowerTextFill = new LinearGradient(0, 0.5079365079365079 * PREFERRED_HEIGHT,
                                           0, 0.5079365079365079 * PREFERRED_HEIGHT + flapHeight,
                                           false, CycleMethod.NO_CYCLE,
                                           new Stop(0.0, getSkinnable().getTextColor().darker()),
                                           new Stop(1.0, getSkinnable().getTextColor()));
        lowerBackgroundText    = new Canvas();
        ctxLowerBackgroundText = lowerBackgroundText.getGraphicsContext2D();
        ctxLowerBackgroundText.setTextBaseline(VPos.CENTER);
        ctxLowerBackgroundText.setTextAlign(TextAlignment.CENTER);

        flap = new Region();
        flap.setEffect(innerHighlight);
        flap.getTransforms().add(rotateFlap);

        flapTextFront = new Canvas();
        flapTextFront.getTransforms().add(rotateFlap);
View Full Code Here

        }
    }

    private void initGraphics() {

        background = new Region();
        background.getStyleClass().setAll("background");

        backgroundInnerShadow = new InnerShadow();
        backgroundInnerShadow.setOffsetY(-1.0);
        backgroundInnerShadow.setRadius(1.0 / 310.0 * PREFERRED_WIDTH);
        backgroundInnerShadow.setColor(Color.rgb(0, 0, 0, 0.65));
        backgroundInnerShadow.setBlurType(BlurType.TWO_PASS_BOX);

        backgroundInnerHighlight = new InnerShadow();
        backgroundInnerHighlight.setOffsetY(1.0);
        backgroundInnerHighlight.setRadius(1.0 / 310.0 * PREFERRED_WIDTH);
        backgroundInnerHighlight.setColor(Color.rgb(200, 200, 200, 0.65));
        backgroundInnerHighlight.setBlurType(BlurType.TWO_PASS_BOX);
        backgroundInnerHighlight.setInput(backgroundInnerShadow);

        background.setEffect(backgroundInnerHighlight);

        dotInnerShadow = new InnerShadow();
        dotInnerShadow.setRadius(0.025 * PREFERRED_WIDTH);
        dotInnerShadow.setColor(Color.rgb(0, 0, 0, 0.65));
        dotInnerShadow.setBlurType(BlurType.TWO_PASS_BOX);

        glow = new DropShadow();
        glow.setInput(dotInnerShadow);
        glow.setRadius(0.032 * PREFERRED_WIDTH);
        glow.setColor(getSkinnable().getColor());
        glow.setBlurType(BlurType.TWO_PASS_BOX);

        // dot definitions
        d57 = new Region();
        d57.getStyleClass().add("dot-off");
        d57.setEffect(dotInnerShadow);
        dotMap.put(Dot.D57, d57);

        d47 = new Region();
        d47.getStyleClass().add("dot-off");
        d47.setEffect(dotInnerShadow);
        dotMap.put(Dot.D47, d47);

        d37 = new Region();
        d37.getStyleClass().add("dot-off");
        d37.setEffect(dotInnerShadow);
        dotMap.put(Dot.D37, d37);

        d27 = new Region();
        d27.getStyleClass().add("dot-off");
        d27.setEffect(dotInnerShadow);
        dotMap.put(Dot.D27, d27);

        d17 = new Region();
        d17.getStyleClass().add("dot-off");
        d17.setEffect(dotInnerShadow);
        dotMap.put(Dot.D17, d17);

        d56 = new Region();
        d56.getStyleClass().add("dot-off");
        d56.setEffect(dotInnerShadow);
        dotMap.put(Dot.D56, d56);

        d46 = new Region();
        d46.getStyleClass().add("dot-off");
        d46.setEffect(dotInnerShadow);
        dotMap.put(Dot.D46, d46);

        d36 = new Region();
        d36.getStyleClass().add("dot-off");
        d36.setEffect(dotInnerShadow);
        dotMap.put(Dot.D36, d36);

        d26 = new Region();
        d26.getStyleClass().add("dot-off");
        d26.setEffect(dotInnerShadow);
        dotMap.put(Dot.D26, d26);

        d16 = new Region();
        d16.getStyleClass().add("dot-off");
        d16.setEffect(dotInnerShadow);
        dotMap.put(Dot.D16, d16);

        d55 = new Region();
        d55.getStyleClass().add("dot-off");
        d55.setEffect(dotInnerShadow);
        dotMap.put(Dot.D55, d55);

        d45 = new Region();
        d45.getStyleClass().add("dot-off");
        d45.setEffect(dotInnerShadow);
        dotMap.put(Dot.D45, d45);

        d35 = new Region();
        d35.getStyleClass().add("dot-off");
        d35.setEffect(dotInnerShadow);
        dotMap.put(Dot.D35, d35);

        d25 = new Region();
        d25.getStyleClass().add("dot-off");
        d25.setEffect(dotInnerShadow);
        dotMap.put(Dot.D25, d25);

        d15 = new Region();
        d15.getStyleClass().add("dot-off");
        d15.setEffect(dotInnerShadow);
        dotMap.put(Dot.D15, d15);

        d54 = new Region();
        d54.getStyleClass().add("dot-off");
        d54.setEffect(dotInnerShadow);
        dotMap.put(Dot.D54, d54);

        d44 = new Region();
        d44.getStyleClass().add("dot-off");
        d44.setEffect(dotInnerShadow);
        dotMap.put(Dot.D44, d44);

        d34 = new Region();
        d34.getStyleClass().add("dot-off");
        d34.setEffect(dotInnerShadow);
        dotMap.put(Dot.D34, d34);

        d24 = new Region();
        d24.getStyleClass().add("dot-off");
        d24.setEffect(dotInnerShadow);
        dotMap.put(Dot.D24, d24);

        d14 = new Region();
        d14.getStyleClass().add("dot-off");
        d14.setEffect(dotInnerShadow);
        dotMap.put(Dot.D14, d14);

        d53 = new Region();
        d53.getStyleClass().add("dot-off");
        d53.setEffect(dotInnerShadow);
        dotMap.put(Dot.D53, d53);

        d43 = new Region();
        d43.getStyleClass().add("dot-off");
        d43.setEffect(dotInnerShadow);
        dotMap.put(Dot.D43, d43);

        d33 = new Region();
        d33.getStyleClass().add("dot-off");
        d33.setEffect(dotInnerShadow);
        dotMap.put(Dot.D33, d33);

        d23 = new Region();
        d23.getStyleClass().add("dot-off");
        d23.setEffect(dotInnerShadow);
        dotMap.put(Dot.D23, d23);

        d13 = new Region();
        d13.getStyleClass().add("dot-off");
        d13.setEffect(dotInnerShadow);
        dotMap.put(Dot.D13, d13);

        d52 = new Region();
        d52.getStyleClass().add("dot-off");
        d52.setEffect(dotInnerShadow);
        dotMap.put(Dot.D52, d52);

        d42 = new Region();
        d42.getStyleClass().add("dot-off");
        d42.setEffect(dotInnerShadow);
        dotMap.put(Dot.D42, d42);

        d32 = new Region();
        d32.getStyleClass().add("dot-off");
        d32.setEffect(dotInnerShadow);
        dotMap.put(Dot.D32, d32);

        d22 = new Region();
        d22.getStyleClass().add("dot-off");
        d22.setEffect(dotInnerShadow);
        dotMap.put(Dot.D22, d22);

        d12 = new Region();
        d12.getStyleClass().add("dot-off");
        d12.setEffect(dotInnerShadow);
        dotMap.put(Dot.D12, d12);

        d51 = new Region();
        d51.getStyleClass().add("dot-off");
        d51.setEffect(dotInnerShadow);
        dotMap.put(Dot.D51, d51);

        d41 = new Region();
        d41.getStyleClass().add("dot-off");
        d41.setEffect(dotInnerShadow);
        dotMap.put(Dot.D41, d41);

        d31 = new Region();
        d31.getStyleClass().add("dot-off");
        d31.setEffect(dotInnerShadow);
        dotMap.put(Dot.D31, d31);

        d21 = new Region();
        d21.getStyleClass().add("dot-off");
        d21.setEffect(dotInnerShadow);
        dotMap.put(Dot.D21, d21);

        d11 = new Region();
        d11.getStyleClass().add("dot-off");
        d11.setEffect(dotInnerShadow);
        dotMap.put(Dot.D11, d11);

        // highlight definitions
        d57h = new Region();
        d57h.getStyleClass().add("dot-highlight");
        highlights.add(d57h);

        d47h = new Region();
        d47h.getStyleClass().add("dot-highlight");
        highlights.add(d47h);

        d37h = new Region();
        d37h.getStyleClass().add("dot-highlight");
        highlights.add(d37h);

        d27h = new Region();
        d27h.getStyleClass().add("dot-highlight");
        highlights.add(d27h);

        d17h = new Region();
        d17h.getStyleClass().add("dot-highlight");
        highlights.add(d17h);

        d56h = new Region();
        d56h.getStyleClass().add("dot-highlight");
        highlights.add(d56h);

        d46h = new Region();
        d46h.getStyleClass().add("dot-highlight");
        highlights.add(d46h);

        d36h = new Region();
        d36h.getStyleClass().add("dot-highlight");
        highlights.add(d36h);

        d26h = new Region();
        d26h.getStyleClass().add("dot-highlight");
        highlights.add(d26h);

        d16h = new Region();
        d16h.getStyleClass().add("dot-highlight");
        highlights.add(d16h);

        d55h = new Region();
        d55h.getStyleClass().add("dot-highlight");
        highlights.add(d55h);

        d45h = new Region();
        d45h.getStyleClass().add("dot-highlight");
        highlights.add(d45h);

        d35h = new Region();
        d35h.getStyleClass().add("dot-highlight");
        highlights.add(d35h);

        d25h = new Region();
        d25h.getStyleClass().add("dot-highlight");
        highlights.add(d25h);

        d15h = new Region();
        d15h.getStyleClass().add("dot-highlight");
        highlights.add(d15h);

        d54h = new Region();
        d54h.getStyleClass().add("dot-highlight");
        highlights.add(d54h);

        d44h = new Region();
        d44h.getStyleClass().add("dot-highlight");
        highlights.add(d44h);

        d34h = new Region();
        d34h.getStyleClass().add("dot-highlight");
        highlights.add(d34h);

        d24h = new Region();
        d24h.getStyleClass().add("dot-highlight");
        highlights.add(d24h);

        d14h = new Region();
        d14h.getStyleClass().add("dot-highlight");
        highlights.add(d14h);

        d53h = new Region();
        d53h.getStyleClass().add("dot-highlight");
        highlights.add(d53h);

        d43h = new Region();
        d43h.getStyleClass().add("dot-highlight");
        highlights.add(d43h);

        d33h = new Region();
        d33h.getStyleClass().add("dot-highlight");
        highlights.add(d33h);

        d23h = new Region();
        d23h.getStyleClass().add("dot-highlight");
        highlights.add(d23h);

        d13h = new Region();
        d13h.getStyleClass().add("dot-highlight");
        highlights.add(d13h);

        d52h = new Region();
        d52h.getStyleClass().add("dot-highlight");
        highlights.add(d52h);

        d42h = new Region();
        d42h.getStyleClass().add("dot-highlight");
        highlights.add(d42h);

        d32h = new Region();
        d32h.getStyleClass().add("dot-highlight");
        highlights.add(d32h);

        d22h = new Region();
        d22h.getStyleClass().add("dot-highlight");
        highlights.add(d22h);

        d12h = new Region();
        d12h.getStyleClass().add("dot-highlight");
        highlights.add(d12h);

        d51h = new Region();
        d51h.getStyleClass().add("dot-highlight");
        highlights.add(d51h);

        d41h = new Region();
        d41h.getStyleClass().add("dot-highlight");
        highlights.add(d41h);

        d31h = new Region();
        d31h.getStyleClass().add("dot-highlight");
        highlights.add(d31h);

        d21h = new Region();
        d21h.getStyleClass().add("dot-highlight");
        highlights.add(d21h);

        d11h = new Region();
        d11h.getStyleClass().add("dot-highlight");
        highlights.add(d11h);

        pane.getChildren().setAll(background,
                                  d57, d47, d37, d27, d17,
View Full Code Here

    private void initGraphics() {
        Font.loadFont(getClass().getResourceAsStream("/eu/hansolo/enzo/fonts/opensans-semibold.ttf"), (0.5 * PREFERRED_HEIGHT)); // "OpenSans"
        font = Font.font("Open Sans", 0.5 * PREFERRED_HEIGHT);

        background = new Region();
        background.getStyleClass().setAll("background");
        background.setStyle("-switch-color: " + Util.colorToCss((Color) getSkinnable().getSwitchColor()) + ";");

        selectedText  = new Text("1");
        selectedText.setFont(font);
        selectedText.getStyleClass().setAll("selected-text");
        selectedText.setStyle("-text-color-on: " + Util.colorToCss((Color) getSkinnable().getTextColorOn()) + ";");

        deselectedText = new Text("0");
        deselectedText.setFont(font);
        deselectedText.getStyleClass().setAll("deselected-text");
        deselectedText.setStyle("-text-color-off: " + Util.colorToCss((Color) getSkinnable().getTextColorOff()) + ";");

        thumb = new Region();
        thumb.getStyleClass().setAll("thumb");
        thumb.setMouseTransparent(true);
        thumb.setStyle("-thumb-color: " + Util.colorToCss((Color) getSkinnable().getThumbColor()) + ";");

        pane = new Pane(background, selectedText, deselectedText, thumb);
View Full Code Here

    private void initGraphics() {
        Font.loadFont(getClass().getResourceAsStream("/eu/hansolo/enzo/fonts/opensans-semibold.ttf"), (0.5 * PREFERRED_HEIGHT)); // "OpenSans"
        font = Font.font("Open Sans", 0.5 * PREFERRED_HEIGHT);

        background = new Region();
        background.getStyleClass().setAll("background");
        background.setStyle("-switch-color: " + Util.colorToCss((Color) getSkinnable().getSwitchColor()) + ";");

        symbol = getSkinnable().getSymbol();
        symbol.setMouseTransparent(true);

        text = new Label(getSkinnable().getText());
        text.setTextAlignment(TextAlignment.CENTER);
        text.setAlignment(Pos.CENTER);
        text.setTextFill(getSkinnable().getSymbolColor());
        text.setFont(font);

        thumb = new Region();
        thumb.getStyleClass().setAll("thumb");
        thumb.setStyle("-thumb-color: " + Util.colorToCss((Color) getSkinnable().getThumbColor()) + ";");
        thumb.setMouseTransparent(true);

        pane = new Pane(background, symbol, text, thumb);
View Full Code Here

        }
    }

    private void initGraphics() {

        segmentA = new Region();
        segmentA.getStyleClass().setAll("a");
        segmentMap.put(SevenSegment.Segment.A, segmentA);

        segmentB = new Region();
        segmentB.getStyleClass().setAll("b");
        segmentMap.put(SevenSegment.Segment.B, segmentB);

        segmentC = new Region();
        segmentC.getStyleClass().setAll("c");
        segmentMap.put(SevenSegment.Segment.C, segmentC);

        segmentD = new Region();
        segmentD.getStyleClass().setAll("d");
        segmentMap.put(SevenSegment.Segment.D, segmentD);

        segmentE = new Region();
        segmentE.getStyleClass().setAll("e");
        segmentMap.put(SevenSegment.Segment.E, segmentE);

        segmentF = new Region();
        segmentF.getStyleClass().setAll("f");
        segmentMap.put(SevenSegment.Segment.F, segmentF);

        segmentG = new Region();
        segmentG.getStyleClass().setAll("g");
        segmentMap.put(SevenSegment.Segment.G, segmentG);

        segmentDot = new Region();
        segmentDot.getStyleClass().setAll("dot");
        segmentMap.put(SevenSegment.Segment.DOT, segmentDot);

        pane.getChildren().setAll(segmentA,
                                  segmentB,
View Full Code Here

            aspectRatio = getSkinnable().getPrefHeight() / getSkinnable().getPrefWidth();
        }
    }

    private void initGraphics() {
        frame = new Region();
        frame.getStyleClass().setAll("frame");

        frameInnerShadow0 = new InnerShadow();
        frameInnerShadow0.setOffsetX(0);
        frameInnerShadow0.setOffsetY(1);
        frameInnerShadow0.setRadius(0);
        frameInnerShadow0.setColor(Color.web("0x333333a6"));
        frameInnerShadow0.setBlurType(BlurType.TWO_PASS_BOX);
        frameInnerShadow1 = new InnerShadow();
        frameInnerShadow1.setOffsetX(0);
        frameInnerShadow1.setOffsetY(-1);
        frameInnerShadow1.setRadius(0);
        frameInnerShadow1.setColor(Color.web("0xeeeeeea6"));
        frameInnerShadow1.setBlurType(BlurType.TWO_PASS_BOX);
        frameInnerShadow1.setInput(frameInnerShadow0);
        frame.setEffect(frameInnerShadow1);

        deselected = new Region();
        deselected.getStyleClass().setAll("deselected");

        deselectedInnerShadow0 = new InnerShadow();
        deselectedInnerShadow0.setOffsetX(0);
        deselectedInnerShadow0.setOffsetY(-1);
        deselectedInnerShadow0.setRadius(0);
        deselectedInnerShadow0.setColor(Color.web("0x4b4e52a6"));
        deselectedInnerShadow0.setBlurType(BlurType.TWO_PASS_BOX);
        deselectedInnerShadow1 = new InnerShadow();
        deselectedInnerShadow1.setOffsetX(0);
        deselectedInnerShadow1.setOffsetY(1);
        deselectedInnerShadow1.setRadius(0);
        deselectedInnerShadow1.setColor(Color.web("0xeeeeeea6"));
        deselectedInnerShadow1.setBlurType(BlurType.TWO_PASS_BOX);
        deselectedInnerShadow1.setInput(deselectedInnerShadow0);
        deselectedDropShadow = new DropShadow();
        deselectedDropShadow.setOffsetX(0);
        deselectedDropShadow.setOffsetY(3);
        deselectedDropShadow.setRadius(3.0 / 128.0 * PREFERRED_WIDTH);
        deselectedDropShadow.setColor(Color.web("0x000000a6"));
        deselectedDropShadow.setBlurType(BlurType.TWO_PASS_BOX);
        deselectedDropShadow.setInput(deselectedInnerShadow1);
        deselected.setEffect(deselectedDropShadow);

        selected = new Region();
        selected.getStyleClass().setAll("selected");

        selectedInnerShadow0 = new InnerShadow();
        selectedInnerShadow0.setOffsetX(0);
        selectedInnerShadow0.setOffsetY(-1);
        selectedInnerShadow0.setRadius(0);
        selectedInnerShadow0.setColor(Color.web("0x4b4e52a6"));
        selectedInnerShadow0.setBlurType(BlurType.TWO_PASS_BOX);
        selectedInnerShadow1 = new InnerShadow();
        selectedInnerShadow1.setOffsetX(0);
        selectedInnerShadow1.setOffsetY(1);
        selectedInnerShadow1.setRadius(0);
        selectedInnerShadow1.setColor(Color.web("0xeeeeeea6"));
        selectedInnerShadow1.setBlurType(BlurType.TWO_PASS_BOX);
        selectedInnerShadow1.setInput(selectedInnerShadow0);
        selectedDropShadow = new DropShadow();
        selectedDropShadow.setOffsetX(0);
        selectedDropShadow.setOffsetY(0);
        selectedDropShadow.setRadius(2.0 / 128.0 * PREFERRED_WIDTH);
        selectedDropShadow.setColor(Color.web("0x000000a6"));
        selectedDropShadow.setBlurType(BlurType.TWO_PASS_BOX);
        selectedDropShadow.setInput(selectedInnerShadow1);
        selected.setEffect(selectedDropShadow);

        icon = new Region();
        icon.getStyleClass().setAll("icon");
        pane.getChildren().setAll(frame,
                                  deselected,
                                  selected,
                                  icon);
View Full Code Here

        Label ambulanceLabel = AwesomeDude.createIconLabel(AwesomeIcon.PLUS_SQUARE_ALT, "60.0");
        Button starButton = AwesomeDude.createIconButton(AwesomeIcon.STAR, "Nice!", "48.0", "20.0", ContentDisplay.TOP);
        Button cloudButton = AwesomeDude.createIconButton(AwesomeIcon.CLOUD, "Download");
        ToggleButton toggleButton = AwesomeDude.createIconToggleButton(AwesomeIcon.LOCK, "Lock", "60.0", ContentDisplay.TOP);

        Region stackedIcon1 = AwesomeIconsStack.create().add(Icon.create());

        Region stackedIcon2 = AwesomeIconsStack.create()
                .add(Icon.create()
                        .icon(AwesomeIcon.SQUARE)
                        .size("3em")
                        .styleClass("stack-base"))
                .add(Icon.create()
                        .icon(AwesomeIcon.STAR)
                        .size("2em")
                        .styleClass("stack-top")
                );

        Region stackedIcon3 = AwesomeIconsStack.create()
                .add(Icon.create()
                        .icon(AwesomeIcon.SQUARE)
                        .style("-fx-font-size: 4em; -fx-text-fill: yellowgreen;"))
                .add(Icon.create()
                        .icon(AwesomeIcon.APPLE)
                        .style("-fx-font-size: 3em; -fx-text-fill: white;")
                );

        Region stackedIcon4 = AwesomeIconsStack.create()
                .add(Icon.create()
                        .icon(AwesomeIcon.SQUARE)
                        .style("-fx-font-size: 4em; -fx-text-fill: yellowgreen;"))
                .add(Icon.create()
                        .icon(AwesomeIcon.APPLE)
                        .style("-fx-font-size: 3em; -fx-text-fill: black;")
                );

        Region stackedIcon5 = AwesomeIconsStack.create()
                .add(Icon.create()
                        .icon(AwesomeIcon.BUG)
                        .style("-fx-font-size: 2em; -fx-text-fill: black;"))
                .add(Icon.create()
                        .icon(AwesomeIcon.BAN)
                        .style("-fx-font-size: 4em; -fx-text-fill: red; -fx-opacity: 0.5;")
                );

        Region stackedIcon6 = AwesomeIconsStack.create()
                .add(Icon.create()
                        .icon(AwesomeIcon.CIRCLE)
                        .style("-fx-font-size: 8em; -fx-text-fill: linear-gradient(#70b4e5 0%, #247cbc 70%, #2c85c1 85%);"))
                .add(Icon.create()
                        .icon(AwesomeIcon.TWITTER)
                        .style("-fx-font-size: 4em; -fx-text-fill: white;")
                );

        Region stackedIcon7 = AwesomeIconsStack.create()
                .add(Icon.create()
                        .icon(AwesomeIcon.CIRCLE)
                        .style("-fx-font-size: 12em; -fx-text-fill: linear-gradient(#70b4e5 0%, #247cbc 70%, #2c85c1 85%);"))
                .add(Icon.create()
                        .icon(AwesomeIcon.BITBUCKET)
                        .style("-fx-font-size: 6em; "
                                + "-fx-text-fill: linear-gradient(#ffffff, #d2d2d2); "
                                + "-fx-effect: dropshadow( one-pass-box , rgba(0,0,0,0.8) , 4 , 0.0 , 1 , 1 );")
                );

        HBox stackIconBox = new HBox();
        stackIconBox.setSpacing(5.0);
        stackIconBox.setPadding(new Insets(10.0));
        stackIconBox.getChildren().addAll(stackedIcon1, stackedIcon2, stackedIcon3, stackedIcon4, stackedIcon5, stackedIcon6, stackedIcon7);

        Region iconStack1 = AwesomeIconsStack.create()
                .add(Icon.create()
                        .icon(AwesomeIcon.CIRCLE)
                        .style("-fx-font-size: 12em; -fx-text-fill: linear-gradient(#70b4e5 0%, #247cbc 70%, #2c85c1 85%);"))
                .add(Icon.create()
                        .icon(AwesomeIcon.BITBUCKET)
View Full Code Here

            getSkinnable().setMaxSize(MAXIMUM_SIZE, MAXIMUM_SIZE);
        }
    }

    private void initGraphics() {
        indicator = new Region();
        getChildren().setAll(indicator);
        resize();
    }
View Full Code Here

            getSkinnable().setMaxSize(MAXIMUM_SIZE, MAXIMUM_SIZE);
        }
    }

    private void initGraphics() {
        indicator = new Region();
        getChildren().setAll(indicator);
        resize();
    }
View Full Code Here

TOP

Related Classes of javafx.scene.layout.Region

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.