Package javafx.scene

Examples of javafx.scene.Group


    final Lighting lighting = createLighting();
    lighting.setSurfaceScale(5d * sizeScale);
    final Shape indicatorBolt = createIndicatorBolt();
    indicatorBolt.setEffect(lighting);
   
      final Group handShapeGroup = new Group();
      handShapeGroup.setCache(true);
      handShapeGroup.setCacheHint(CacheHint.ROTATE);
    handShapeGroup.getChildren().addAll(dialNode, indicatorBolt, indicatorShape);
    return handShapeGroup;
    }
View Full Code Here


     * @return the knob surface
     */
    protected Group createKnobSurface(final double startAngle, final double centerX,
        final double centerY, final double radiusX, final double radiusY,
        final Color... colors) {
      Group group = new Group();
      final Shape background = new Ellipse(centerX, centerY, radiusX, radiusY);
      background.setFill(new RadialGradient(0, 0, this.centerX, this.centerY,
        Math.max(radiusX, radiusY), false, CycleMethod.NO_CYCLE,
        new Stop(0, Color.BLACK), new Stop(0.95d, Color.DARKGRAY.darker()),
        new Stop(0.97d, Color.GRAY.brighter())));
      group.getChildren().add(background);
      double startRadians = startAngle * 2d * Math.PI;
      //double stepRadians = (2d * Math.PI) / colors.length;
      //double oldX = centerX + Math.cos(startRadians) * radiusX;
      //double oldY = centerY + Math.sin(startRadians) * radiusY;
      //double newX, newY, newRadians;
      double angle = Math.toDegrees(startRadians), angleLength = 360d / colors.length;
      //angleLength *= 2d;
      for (double i=0; i<colors.length; i++) {
        //newRadians = startRadians + stepRadians * (i + 2d);
        //newX = centerX + Math.cos(newRadians) * radiusX / 1.1d;
        //newY = centerY + Math.sin(newRadians) * radiusY / 1.1d;
        //Polygon shape = new Polygon(oldX, oldY, centerX, centerY, newX, newY, oldX, oldY);
        final Arc shape = new Arc(centerX, centerY, radiusX / 1.1d, radiusY / 1.1d, angle, angleLength);
        angle += angleLength;
        shape.setType(ArcType.ROUND);
        shape.setSmooth(false);
        shape.setCache(true);
        shape.setCacheHint(CacheHint.SPEED);
        shape.setFill(colors[(int)i]);
        shape.setStroke(colors[(int)i]);
        shape.setStrokeWidth(angleLength);
        shape.setStrokeType(StrokeType.INSIDE);
        group.getChildren().add(shape);
        //oldX = newX;
            //oldY = newY;
      }
      //final Ellipse cap = new Ellipse(radiusX, radiusY);
      //cap
View Full Code Here

        return (Parent)fxmlLoader.load();
      } catch (IOException exception) {
        throw new RuntimeException(exception);
      }
    }
    return new Group();
  }
View Full Code Here

    }

    @Override
    public void start(Stage stage) {
        stage.setTitle("BalsaWings2");
        Group root = new Group();
        Scene scene = new GameScene(root);
        stage.setScene(scene);
        stage.show();
    }
View Full Code Here

        this.setHbarPolicy(ScrollBarPolicy.ALWAYS);
        this.setVbarPolicy(ScrollBarPolicy.ALWAYS);

        this.contentProperty().addListener(new ChangeListener<Node>() {
            private Group group = new Group();

            @Override
            public void changed(ObservableValue<? extends Node> observable, Node oldValue, Node newValue) {
                if (newValue == group) {
                    return;
                }
                group.getChildren().clear();
                group.getChildren().add(newValue);
                ZoomableScrollPane.this.setContent(group);
                scaling.setNode(newValue);
            }
        });
    }
View Full Code Here

    GraphicsContext gc;

    @Override
    public void start(Stage primaryStage) throws Exception {
        Group root = new Group();

        Canvas canvas = new Canvas(width, height);
        gc = canvas.getGraphicsContext2D();

        startX = 10;
        startY = 10;

        endX = 300;
        endY = 20;

        toleransi = 5;

        canvas.addEventHandler(MouseEvent.MOUSE_PRESSED, (MouseEvent event) -> {
            double x = event.getX();
            double y = event.getY();
            isRedraw = isAccessible(x, y);
        });

        canvas.addEventHandler(MouseEvent.MOUSE_DRAGGED, (MouseEvent event) -> {
            processMouse(event.getX(), event.getY());
        });

        canvas.addEventHandler(MouseEvent.MOUSE_RELEASED, (MouseEvent event) -> {
            isRedraw = false;
        });

        draw(gc);

        root.getChildren().add(canvas);

        primaryStage.setScene(new Scene(root, width, height));
        primaryStage.show();
    }
View Full Code Here

        dropShadow.setColor(Color.rgb(0, 0, 0, 0.25));
        dropShadow.setBlurType(BlurType.TWO_PASS_BOX);
        dropShadow.setRadius(0.015 * PREFERRED_WIDTH);
        dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH);

        shadowGroup = new Group(needle, needleHighlight);//, knob);
        shadowGroup.setEffect(getSkinnable().isDropShadowEnabled() ? dropShadow : null);

        title = new Text(getSkinnable().getTitle());
        title.setTextOrigin(VPos.CENTER);
        title.getStyleClass().setAll("title");
View Full Code Here

        dateText.getStyleClass().setAll("fg");

        dayOfWeekText = new Text("");
        dayOfWeekText.getStyleClass().setAll("fg");

        shadowGroup = new Group();
        shadowGroup.setEffect(getSkinnable().isForegroundShadowVisible() ? FOREGROUND_SHADOW : null);
        shadowGroup.getChildren().setAll(alarm,
                                         timeText,
                                         secondText,
                                         title,
View Full Code Here

        upperRightText.setOpacity(getSkinnable().isMaxMeasuredValueVisible() ? 1 : 0);

        lowerCenterText = new Text(getSkinnable().isFormerValueVisible() ? Double.toString(getSkinnable().getFormerValue()) : getSkinnable().getLowerCenterText());
        lowerCenterText.getStyleClass().setAll("fg");

        shadowGroup = new Group();
        shadowGroup.setEffect(getSkinnable().isForegroundShadowVisible() ? FOREGROUND_SHADOW : null);
        shadowGroup.getChildren().setAll(threshold,
                                         trendDown,
                                         trendFalling,
                                         trendSteady,
View Full Code Here

        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();
View Full Code Here

TOP

Related Classes of javafx.scene.Group

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.