Package javafx.scene.layout

Examples of javafx.scene.layout.Region


   * A place holder in inserted into the GridPane to hold the value node, so the spinner can alternate between editable or readonly mode, without having to recreate the GridPane. 
   */
  private void createNodes()
  {
    // left arrow
    decrementArrow = new Region();
    decrementArrow.getStyleClass().add("idle");

    // place holder for showing the value
    valueHolderNode = new BorderPane();
    valueHolderNode.getStyleClass().add("valuePane");
    //valueHolderNode.setStyle("-fx-border-color: white;");
   
    // right arrow
    incrementArrow = new Region();
    incrementArrow.getStyleClass().add("idle");

    // construct a placeholder node
    skinNode = new BorderPane();
    skinNode.setCenter(valueHolderNode);
View Full Code Here


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

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

        innerFrame = new Region();
        innerFrame.getStyleClass().setAll("inner-frame");

        mainBack = new Region();
        mainBack.getStyleClass().setAll("main-back");

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

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

        pane.getChildren().setAll(outerFrame, innerFrame, mainBack, main, highlight);

        getChildren().setAll(pane);
View Full Code Here

        valueBlend = new Blend();
        valueBlend.setMode(BlendMode.MULTIPLY);
        valueBlend.setBottomInput(valueBlendBottomShadow);
        valueBlend.setTopInput(valueBlendTopShadow);

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

        ticksAndSectionsCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        ticksAndSections = ticksAndSectionsCanvas.getGraphicsContext2D();

        histogram = new Path();
        histogram.setFillRule(FillRule.NON_ZERO);
        histogram.getStyleClass().add("histogram-fill");

        minMeasuredValue = new Region();
        minMeasuredValue.getStyleClass().setAll("min-measured-value");
        minMeasuredValueRotate = new Rotate(180 - getSkinnable().getStartAngle() - getSkinnable().getMinValue() * angleStep);
        minMeasuredValue.getTransforms().setAll(minMeasuredValueRotate);
        minMeasuredValue.setOpacity(getSkinnable().isMinMeasuredValueVisible() ? 1 : 0);
        minMeasuredValue.setManaged(getSkinnable().isMinMeasuredValueVisible());

        maxMeasuredValue = new Region();
        maxMeasuredValue.getStyleClass().setAll("max-measured-value");
        maxMeasuredValueRotate = new Rotate(180 - getSkinnable().getStartAngle() - getSkinnable().getMinValue() * angleStep);
        maxMeasuredValue.getTransforms().setAll(maxMeasuredValueRotate);
        maxMeasuredValue.setOpacity(getSkinnable().isMaxMeasuredValueVisible() ? 1 : 0);
        maxMeasuredValue.setManaged(getSkinnable().isMaxMeasuredValueVisible());

        threshold = new Region();
        threshold.getStyleClass().setAll("threshold");
        thresholdRotate = new Rotate(180 - getSkinnable().getStartAngle() - getSkinnable().getMinValue() * angleStep);
        threshold.getTransforms().setAll(thresholdRotate);
        threshold.setOpacity(getSkinnable().isThresholdVisible() ? 1 : 0);
        threshold.setManaged(getSkinnable().isThresholdVisible());
        thresholdExceeded = false;

        needle = new Region();
        needle.getStyleClass().setAll(Gauge.STYLE_CLASS_NEEDLE_STANDARD);
        needleRotate = new Rotate(180 - getSkinnable().getStartAngle());
        needleRotate.setAngle(needleRotate.getAngle() + (getSkinnable().getValue() - getSkinnable().getOldValue() - getSkinnable().getMinValue()) * angleStep);
        needle.getTransforms().setAll(needleRotate);

        needleHighlight = new Region();
        needleHighlight.setMouseTransparent(true);
        needleHighlight.getStyleClass().setAll("needle-highlight");
        needleHighlight.getTransforms().setAll(needleRotate);

        knob = new Region();
        knob.setPickOnBounds(false);
        knob.getStyleClass().setAll("knob");

        dropShadow = new DropShadow();
        dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
View Full Code Here

        Font.loadFont(getClass().getResourceAsStream("/eu/hansolo/enzo/fonts/digitalreadout.ttf"), (0.5833333333 * PREFERRED_HEIGHT))// "Digital Readout Upright"
        Font.loadFont(getClass().getResourceAsStream("/eu/hansolo/enzo/fonts/digitalreadoutb.ttf"), (0.5833333333 * PREFERRED_HEIGHT)); // "Digital Readout Thick Upright"
        Font.loadFont(getClass().getResourceAsStream("/eu/hansolo/enzo/fonts/elektra.ttf"), (0.58333333 * PREFERRED_HEIGHT));           // "Elektra"
        Font.loadFont(getClass().getResourceAsStream("/eu/hansolo/enzo/fonts/opensans-semibold.ttf"), (0.58333333 * PREFERRED_HEIGHT)); // "OpenSans"

        main = new Region();
        main.getStyleClass().setAll("main");
        main.setOpacity(getSkinnable().isBackgroundVisible() ? 1 : 0);

        mainInnerShadow0 = new InnerShadow();
        mainInnerShadow0.setOffsetX(0.0);
        mainInnerShadow0.setOffsetY(0.0);
        mainInnerShadow0.setRadius(3.0 / 132.0 * PREFERRED_WIDTH);
        mainInnerShadow0.setColor(Color.web("0xffffff80"));
        mainInnerShadow0.setBlurType(BlurType.TWO_PASS_BOX);

        mainInnerShadow1 = new InnerShadow();
        mainInnerShadow1.setOffsetX(0.0);
        mainInnerShadow1.setOffsetY(1.0);
        mainInnerShadow1.setRadius(2.0 / 132.0 * PREFERRED_WIDTH);
        mainInnerShadow1.setColor(Color.web("0x000000a6"));
        mainInnerShadow1.setBlurType(BlurType.TWO_PASS_BOX);
        mainInnerShadow1.setInput(mainInnerShadow0);

        main.setEffect(getSkinnable().isMainInnerShadowVisible() ? mainInnerShadow1 : null);

        crystalClip = new Rectangle(0, 0, PREFERRED_WIDTH, PREFERRED_HEIGHT);
        crystalClip.setArcWidth(5);
        crystalClip.setArcHeight(5);

        crystalImage = createNoiseImage(PREFERRED_WIDTH, PREFERRED_HEIGHT, DARK_NOISE_COLOR, BRIGHT_NOISE_COLOR, 8);
        crystalOverlay = new ImageView(crystalImage);
        crystalOverlay.setClip(this.crystalClip);
        crystalOverlay.setOpacity(getSkinnable().isCrystalOverlayVisible() ? 1 : 0);

        alarm = new Region();
        alarm.getStyleClass().setAll("alarm");
        alarm.setOpacity(getSkinnable().getAlarms().isEmpty() || allAlarmsInactive() ? 0 : 1);

        backgroundTimeText = new Text("");
        backgroundTimeText.getStyleClass().setAll("fg-trsp");
View Full Code Here

        Font.loadFont(getClass().getResourceAsStream("/eu/hansolo/enzo/fonts/digitalreadout.ttf"), (0.5833333333 * PREFERRED_HEIGHT))// "Digital Readout Upright"
        Font.loadFont(getClass().getResourceAsStream("/eu/hansolo/enzo/fonts/digitalreadoutb.ttf"), (0.5833333333 * PREFERRED_HEIGHT)); // "Digital Readout Thick Upright"
        Font.loadFont(getClass().getResourceAsStream("/eu/hansolo/enzo/fonts/elektra.ttf"), (0.58333333 * PREFERRED_HEIGHT));           // "Elektra"
        Font.loadFont(getClass().getResourceAsStream("/eu/hansolo/enzo/fonts/opensans-semibold.ttf"), (0.58333333 * PREFERRED_HEIGHT)); // "OpenSans"

        main = new Region();
        main.getStyleClass().setAll("main");
        main.setOpacity(getSkinnable().isBackgroundVisible() ? 1 : 0);

        mainInnerShadow0 = new InnerShadow();
        mainInnerShadow0.setOffsetX(0.0);
        mainInnerShadow0.setOffsetY(0.0);
        mainInnerShadow0.setRadius(3.0 / 132.0 * PREFERRED_WIDTH);
        mainInnerShadow0.setColor(Color.web("0xffffff80"));
        mainInnerShadow0.setBlurType(BlurType.TWO_PASS_BOX);

        mainInnerShadow1 = new InnerShadow();
        mainInnerShadow1.setOffsetX(0.0);
        mainInnerShadow1.setOffsetY(1.0);
        mainInnerShadow1.setRadius(2.0 / 132.0 * PREFERRED_WIDTH);
        mainInnerShadow1.setColor(Color.web("0x000000a6"));
        mainInnerShadow1.setBlurType(BlurType.TWO_PASS_BOX);
        mainInnerShadow1.setInput(mainInnerShadow0);

        main.setEffect(getSkinnable().isMainInnerShadowVisible() ? mainInnerShadow1 : null);

        crystalClip = new Rectangle(0, 0, width, height);
        crystalClip.setArcWidth(5);
        crystalClip.setArcHeight(5);

        crystalImage = createNoiseImage(PREFERRED_WIDTH, PREFERRED_HEIGHT, DARK_NOISE_COLOR, BRIGHT_NOISE_COLOR, 8);
        crystalOverlay = new ImageView(crystalImage);
        crystalOverlay.setClip(crystalClip);
        crystalOverlay.setOpacity(getSkinnable().isCrystalOverlayVisible() ? 1 : 0);

        threshold = new Region();
        threshold.getStyleClass().setAll("threshold");
        threshold.setOpacity(0);

        trendDown = new Region();
        trendDown.getStyleClass().setAll("trend-down");
        trendDown.setOpacity((getSkinnable().isTrendVisible() && Lcd.Trend.DOWN == getSkinnable().getTrend()) ? 1 : 0);

        trendFalling = new Region();
        trendFalling.getStyleClass().setAll("trend-falling");
        trendFalling.setOpacity((getSkinnable().isTrendVisible() && Lcd.Trend.FALLING == getSkinnable().getTrend()) ? 1 : 0);

        trendSteady = new Region();
        trendSteady.getStyleClass().setAll("trend-steady");
        trendSteady.setOpacity((getSkinnable().isTrendVisible() && Lcd.Trend.STEADY == getSkinnable().getTrend()) ? 1 : 0);

        trendRising = new Region();
        trendRising.getStyleClass().setAll("trend-rising");
        trendRising.setOpacity((getSkinnable().isTrendVisible() && Lcd.Trend.RISING == getSkinnable().getTrend()) ? 1 : 0);

        trendUp = new Region();
        trendUp.getStyleClass().setAll("trend-up");
        trendUp.setOpacity((getSkinnable().isTrendVisible() && Lcd.Trend.UP == getSkinnable().getTrend()) ? 1 : 0);

        battery = new Region();
        battery.getStyleClass().setAll("battery-empty");
        battery.setOpacity(getSkinnable().isBatteryVisible() ? 1 : 0);

        signal = new Region();
        signal.getStyleClass().setAll("signal");
        signal.setOpacity(getSkinnable().isSignalVisible() ? 1 : 0);

        alarm = new Region();
        alarm.getStyleClass().setAll("alarm");
        alarm.setOpacity(getSkinnable().isAlarmVisible() ? 1 : 0);

        backgroundText = new Text(getSkinnable().isTextMode() ? getSkinnable().getText() : Double.toString(getSkinnable().getValue()));
        backgroundText.getStyleClass().setAll("fg-trsp");
View Full Code Here

        startX     = PREFERRED_WIDTH * 0.114;
        startY     = PREFERRED_WIDTH * 0.112;
        stepX      = PREFERRED_WIDTH * 0.072;
        stepY      = PREFERRED_WIDTH * 0.08;
        font       = Font.loadFont(getClass().getResourceAsStream("/eu/hansolo/enzo/fonts/din.otf"), PREFERRED_WIDTH * 0.048);
        background = new Region();
        background.getStyleClass().addAll("background", getSkinnable().getColor().STYLE_CLASS);

        stainlessBackground.setImage(texture.getImage(PREFERRED_WIDTH, PREFERRED_HEIGHT));
        stainlessBackground.setOpacity(getSkinnable().getColor() == QlockTwo.QlockColor.STAINLESS_STEEL ? 1 : 0);

        p1 = new Region();
        p1.getStyleClass().add("dot-off");
        p2 = new Region();
        p2.getStyleClass().add("dot-off");
        p3 = new Region();
        p3.getStyleClass().add("dot-off");
        p4 = new Region();
        p4.getStyleClass().add("dot-off");

        highlight = new Region();
        highlight.getStyleClass().add("highlight");

        matrix = new Label[11][10];
        for (int y = 0 ; y < 10 ; y++) {
            for (int x = 0 ; x < 11 ; x++) {
View Full Code Here

        }
    }

    private void initGraphics() {

        segmentA1 = new Region();
        segmentA1.getStyleClass().setAll("a1");
        segmentMap.put(SixteenSegment.Segment.A1, segmentA1);

        segmentA2 = new Region();
        segmentA2.getStyleClass().setAll("a2");
        segmentMap.put(SixteenSegment.Segment.A2, segmentA2);

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

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

        segmentD2 = new Region();
        segmentD2.getStyleClass().setAll("d2");
        segmentMap.put(SixteenSegment.Segment.D2, segmentD2);

        segmentD1 = new Region();
        segmentD1.getStyleClass().setAll("d1");
        segmentMap.put(SixteenSegment.Segment.D1, segmentD1);

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

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

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

        segmentH = new Region();
        segmentH.getStyleClass().setAll("h");
        segmentMap.put(SixteenSegment.Segment.H, segmentH);

        segmentI = new Region();
        segmentI.getStyleClass().setAll("i");
        segmentMap.put(SixteenSegment.Segment.I, segmentI);

        segmentL = new Region();
        segmentL.getStyleClass().setAll("l");
        segmentMap.put(SixteenSegment.Segment.L, segmentL);

        segmentM = new Region();
        segmentM.getStyleClass().setAll("m");
        segmentMap.put(SixteenSegment.Segment.M, segmentM);

        segmentN = new Region();
        segmentN.getStyleClass().setAll("n");
        segmentMap.put(SixteenSegment.Segment.N, segmentN);

        segmentP = new Region();
        segmentP.getStyleClass().setAll("p");
        segmentMap.put(SixteenSegment.Segment.P, segmentP);

        segmentK = new Region();
        segmentK.getStyleClass().setAll("k");
        segmentMap.put(SixteenSegment.Segment.K, segmentK);

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

        pane.getChildren().setAll(segmentA1,
                                  segmentA2,
View Full Code Here

    }

    private void initGraphics() {
        pane    = new Pane();

        background = new Region();
        if (Clock.Design.IOS6 == getSkinnable().getDesign()) {
            background.getStyleClass().setAll("background-ios6");
        } else if (Clock.Design.DB == getSkinnable().getDesign()) {
            background.getStyleClass().setAll("background-db");
        } else if (Clock.Design.BRAUN == getSkinnable().getDesign()) {
            background.getStyleClass().setAll("background-braun");
        } else if (Clock.Design.BOSCH == getSkinnable().getDesign()) {
            background.getStyleClass().setAll("background-bosch");
        }

        logoLayer = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        ctx       = logoLayer.getGraphicsContext2D();

        String majorTickStyleClass;
        String minorTickStyleClass;
        if (Clock.Design.IOS6 == getSkinnable().getDesign()) {
            majorTickStyleClass = "major-tick-ios6";
            minorTickStyleClass = "minor-tick-ios6";
        } else if (Clock.Design.DB == getSkinnable().getDesign()) {
            majorTickStyleClass = "major-tick-db";
            minorTickStyleClass = "minor-tick-db";
        } else if (Clock.Design.BOSCH == getSkinnable().getDesign()) {
            majorTickStyleClass = "major-tick-bosch";
            minorTickStyleClass = "minor-tick-bosch";
        } else {
            majorTickStyleClass = "major-tick-braun";
            minorTickStyleClass = "minor-tick-braun";
        }

        int tickLabelCounter = 1;
        for (double angle = 0 ; angle < 360 ; angle += 6) {
            Region tick = new Region();
            if (angle % 30 == 0) {
                tick.getStyleClass().setAll(majorTickStyleClass);
                Text tickLabel = new Text(Integer.toString(tickLabelCounter));
                tickLabel.getStyleClass().setAll("tick-label-braun");
                tickLabels.add(tickLabel);
                tickLabelCounter++;
            } else {
                tick.getStyleClass().setAll(minorTickStyleClass);
            }
            ticks.add(tick);
        }

        DropShadow dropShadow = new DropShadow();
        dropShadow.setColor(Color.rgb(0, 0, 0, 0.65));
        dropShadow.setRadius(1.5);
        dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
        dropShadow.setOffsetY(1);

        tickMarkGroup = new Group();
        tickMarkGroup.setEffect(dropShadow);
        tickMarkGroup.getChildren().setAll(ticks);

        tickLabelGroup = new Group();
        tickLabelGroup.setEffect(dropShadow);
        tickLabelGroup.getChildren().setAll(tickLabels);
        tickLabelGroup.setOpacity(Clock.Design.BRAUN == getSkinnable().getDesign() ? 1 : 0);

        hourPointer = new Region();
        if (Clock.Design.IOS6 == getSkinnable().getDesign()) {
            hourPointer.getStyleClass().setAll("hour-pointer-ios6");
        } else if (Clock.Design.DB == getSkinnable().getDesign()) {
            hourPointer.getStyleClass().setAll("hour-pointer-db");
        } else if (Clock.Design.BRAUN == getSkinnable().getDesign()) {
            hourPointer.getStyleClass().setAll("hour-pointer-braun");
        } else if (Clock.Design.BOSCH == getSkinnable().getDesign()) {
            hourPointer.getStyleClass().setAll("hour-pointer-bosch");
        }
        hourPointer.getTransforms().setAll(hourAngle);

        hourPointerFlour = new Region();
        hourPointerFlour.getStyleClass().setAll("hour-pointer-braun-flour");
        if (Clock.Design.BRAUN == getSkinnable().getDesign()) {
            hourPointerFlour.setOpacity(1);
        } else {
            hourPointerFlour.setOpacity(0);
        }
        hourPointerFlour.getTransforms().setAll(hourAngle);

        minutePointer = new Region();
        if (Clock.Design.IOS6 == getSkinnable().getDesign()) {
            minutePointer.getStyleClass().setAll("minute-pointer-ios6");
        } else if (Clock.Design.DB == getSkinnable().getDesign()) {
            minutePointer.getStyleClass().setAll("minute-pointer-db");
        } else if (Clock.Design.BRAUN == getSkinnable().getDesign()) {
            minutePointer.getStyleClass().setAll("minute-pointer-braun");
        } else if (Clock.Design.BOSCH == getSkinnable().getDesign()) {
            minutePointer.getStyleClass().setAll("minute-pointer-bosch");
        }
        minutePointer.getTransforms().setAll(minuteAngle);

        minutePointerFlour = new Region();
        minutePointerFlour.getStyleClass().setAll("minute-pointer-braun-flour");
        if (Clock.Design.BRAUN == getSkinnable().getDesign()) {
            minutePointerFlour.setOpacity(1);
        } else {
            minutePointerFlour.setOpacity(0);
        }
        minutePointerFlour.getTransforms().setAll(minuteAngle);

        DropShadow pointerShadow = new DropShadow();
        pointerShadow.setColor(Color.rgb(0, 0, 0, 0.45));
        pointerShadow.setRadius(12);
        pointerShadow.setBlurType(BlurType.TWO_PASS_BOX);
        pointerShadow.setOffsetY(6);

        pointerGroup = new Group();
        pointerGroup.setEffect(pointerShadow);
        pointerGroup.getChildren().setAll(minutePointerFlour, minutePointer, hourPointerFlour, hourPointer);

        secondPointer = new Region();
        secondPointer.setOpacity(1);
        if (Clock.Design.IOS6 == getSkinnable().getDesign()) {
            secondPointer.getStyleClass().setAll("second-pointer-ios6");
        } else if (Clock.Design.DB == getSkinnable().getDesign()) {
            secondPointer.getStyleClass().setAll("second-pointer-db");
        } else if (Clock.Design.BRAUN == getSkinnable().getDesign()) {
            secondPointer.getStyleClass().setAll("second-pointer-braun");
        } else if (Clock.Design.BOSCH == getSkinnable().getDesign()) {
            secondPointer.setOpacity(0);
        }
        secondPointer.getTransforms().setAll(secondAngle);

        InnerShadow secondPointerInnerShadow = new InnerShadow();
        secondPointerInnerShadow.setColor(Color.rgb(0, 0, 0, 0.3));
        secondPointerInnerShadow.setRadius(1);
        secondPointerInnerShadow.setBlurType(BlurType.TWO_PASS_BOX);
        secondPointerInnerShadow.setOffsetY(-1);

        InnerShadow secondPointerInnerHighlight = new InnerShadow();
        secondPointerInnerHighlight.setColor(Color.rgb(255, 255, 255, 0.3));
        secondPointerInnerHighlight.setRadius(1);
        secondPointerInnerHighlight.setBlurType(BlurType.TWO_PASS_BOX);
        secondPointerInnerHighlight.setOffsetY(1);
        secondPointerInnerHighlight.setInput(secondPointerInnerShadow);

        DropShadow secondPointerShadow = new DropShadow();
        secondPointerShadow.setColor(Color.rgb(0, 0, 0, 0.45));
        secondPointerShadow.setRadius(12);
        secondPointerShadow.setBlurType(BlurType.TWO_PASS_BOX);
        secondPointerShadow.setOffsetY(6);
        secondPointerShadow.setInput(secondPointerInnerHighlight);

        secondPointerGroup = new Group();
        secondPointerGroup.setEffect(secondPointerShadow);
        secondPointerGroup.getChildren().setAll(secondPointer);
        secondPointerGroup.setOpacity(getSkinnable().isSecondPointerVisible() ? 1 : 0);

        centerKnob = new Region();
        if (Clock.Design.IOS6 == getSkinnable().getDesign()) {
            centerKnob.getStyleClass().setAll("center-knob-ios6");
        } else if (Clock.Design.DB == getSkinnable().getDesign()) {
            centerKnob.getStyleClass().setAll("center-knob-db");
        } else if (Clock.Design.BRAUN == getSkinnable().getDesign()) {
            centerKnob.getStyleClass().setAll("center-knob-braun");
        } else if (Clock.Design.BOSCH == getSkinnable().getDesign()) {
            centerKnob.getStyleClass().setAll("center-knob-bosch");
        }

        foreground = new Region();
        if (Clock.Design.IOS6 == getSkinnable().getDesign()) {
            foreground.getStyleClass().setAll("foreground-ios6");
        } else if (Clock.Design.DB == getSkinnable().getDesign()) {
            foreground.getStyleClass().setAll("foreground-db");
        } else if (Clock.Design.BRAUN == getSkinnable().getDesign()) {
View Full Code Here

        // Set Styles for each component
        if (Clock.Design.IOS6 == getSkinnable().getDesign()) {
            background.getStyleClass().setAll(nightDayStyleClass, "background-ios6");
            int index = 0;
            for (double angle = 0 ; angle < 360 ; angle += 6) {
                Region tick = ticks.get(index);
                if (angle % 30 == 0) {
                    tick.getStyleClass().setAll(nightDayStyleClass, "major-tick-ios6");
                } else {
                    tick.getStyleClass().setAll(nightDayStyleClass, "minor-tick-ios6");
                }
                ticks.add(tick);
                index++;
            }
            hourPointer.getStyleClass().setAll(nightDayStyleClass, "hour-pointer-ios6");
            minutePointer.getStyleClass().setAll(nightDayStyleClass, "minute-pointer-ios6");
            secondPointer.getStyleClass().setAll(nightDayStyleClass, "second-pointer-ios6");
            centerKnob.getStyleClass().setAll(nightDayStyleClass, "center-knob-ios6");
            foreground.getStyleClass().setAll(nightDayStyleClass, "foreground-ios6");
        } else if (Clock.Design.BRAUN == getSkinnable().getDesign()) {
            nightDayStyleClass = getSkinnable().isNightMode() ? "night-mode-braun" : "day-mode-braun";
            background.getStyleClass().setAll(nightDayStyleClass, "background-braun");
            int index = 0;
            for (double angle = 0 ; angle < 360 ; angle += 6) {
                if (angle % 30 == 0) {
                    ticks.get(index).getStyleClass().setAll(nightDayStyleClass, "major-tick-braun");
                } else {
                    ticks.get(index).getStyleClass().setAll(nightDayStyleClass, "minor-tick-braun");
                }
                index++;
            }
            for (index = 0 ; index < 12 ; index++) {
                tickLabels.get(index).getStyleClass().setAll(nightDayStyleClass, "tick-label-braun");
            }
            hourPointer.getStyleClass().setAll(nightDayStyleClass, "hour-pointer-braun");
            minutePointer.getStyleClass().setAll(nightDayStyleClass, "minute-pointer-braun");
            secondPointer.getStyleClass().setAll(nightDayStyleClass, "second-pointer-braun");
            centerKnob.getStyleClass().setAll(nightDayStyleClass, "center-knob-braun");
            foreground.getStyleClass().setAll(nightDayStyleClass, "foreground-braun");
        } else if (Clock.Design.BOSCH == getSkinnable().getDesign()) {
            nightDayStyleClass = getSkinnable().isNightMode() ? "night-mode-bosch" : "day-mode-bosch";
            background.getStyleClass().setAll(nightDayStyleClass, "background-bosch");
            int index = 0;
            for (double angle = 0 ; angle < 360 ; angle += 6) {
                Region tick = ticks.get(index);
                if (angle % 30 == 0) {
                    tick.getStyleClass().setAll(nightDayStyleClass, "major-tick-bosch");
                } else {
                    tick.getStyleClass().setAll(nightDayStyleClass, "minor-tick-bosch");
                }
                ticks.add(tick);
                index++;
            }
            hourPointer.getStyleClass().setAll(nightDayStyleClass, "hour-pointer-bosch");
            minutePointer.getStyleClass().setAll(nightDayStyleClass, "minute-pointer-bosch");
            secondPointer.getStyleClass().setAll(nightDayStyleClass, "second-pointer-bosch");
            centerKnob.getStyleClass().setAll(nightDayStyleClass, "center-knob-bosch");
            foreground.getStyleClass().setAll(nightDayStyleClass, "foreground-bosch");
        } else {
            background.getStyleClass().setAll(nightDayStyleClass, "background-db");
            int index = 0;
            for (double angle = 0 ; angle < 360 ; angle += 6) {
                Region tick = ticks.get(index);
                if (angle % 30 == 0) {
                    tick.getStyleClass().setAll(nightDayStyleClass, "major-tick-db");
                } else {
                    tick.getStyleClass().setAll(nightDayStyleClass, "minor-tick-db");
                }
                ticks.add(tick);
                index++;
            }
            hourPointer.getStyleClass().setAll(nightDayStyleClass, "hour-pointer-db");
View Full Code Here

            double cosValue;
            int index = 0;
            for (double angle = 0 ; angle < 360 ; angle += 6) {
                sinValue = Math.sin(Math.toRadians(angle));
                cosValue = Math.cos(Math.toRadians(angle));
                Region tick = ticks.get(index);
                if (angle % 30 == 0) {
                    tick.setPrefWidth(size * majorTickWidthFactor);
                    tick.setPrefHeight(size * majorTickHeightFactor);
                    tick.setTranslateX(size * 0.5 + ((size * (radius + majorTickOffset) * sinValue) - (size * (majorTickWidthFactor) * 0.5)));
                    tick.setTranslateY(size * 0.5 + ((size * (radius + majorTickOffset) * cosValue) - (size * (majorTickHeightFactor) * 0.5)));
                } else {
                    tick.setPrefWidth(size * minorTickWidthFactor);
                    tick.setPrefHeight(size * minorTickHeightFactor);
                    tick.setTranslateX(size * 0.5 + ((size * (radius + minorTickOffset) * sinValue) - (size * (minorTickWidthFactor) * 0.5)));
                    tick.setTranslateY(size * 0.5 + ((size * (radius + minorTickOffset) * cosValue) - (size * (minorTickHeightFactor) * 0.5)));
                }
                tick.setRotate(-angle);
                index++;
            }

            if (Clock.Design.BRAUN == getSkinnable().getDesign()) {
                int tickLabelCounter = 0;
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.